您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
phpunit命令行的verbose参数
发布时间:2021-09-12 22:46:36编辑:雪饮阅读()
该参数在官方文档有讲说是更详细的信息。参考文档:https://phpunit.readthedocs.io/zh_CN/latest/textui.html
实际上讲过我的测试:
MultipleDependenciesTest.php:
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class MultipleDependenciesTest extends TestCase
{
public function testProducerFirst(): string
{
$this->assertTrue(true);
return 'first';
}
/**
* @depends testProducerFirst
* @depends testProducerSecond
*/
public function testConsumer(string $a, string $b): void
{
$this->assertSame('first', $a);
$this->assertSame('second', $b);
}
public function testProducerSecond(): string
{
$this->assertTrue(true);
return 'second';
}
}
use PHPUnit\Framework\TestCase;
final class MultipleDependenciesTest extends TestCase
{
public function testProducerFirst(): string
{
$this->assertTrue(true);
return 'first';
}
/**
* @depends testProducerFirst
* @depends testProducerSecond
*/
public function testConsumer(string $a, string $b): void
{
$this->assertSame('first', $a);
$this->assertSame('second', $b);
}
public function testProducerSecond(): string
{
$this->assertTrue(true);
return 'second';
}
}
运行效果:
C:\Users\Administrator>D:\phpstudy_pro\Extensions\php\php7.3.4nts\php.exe D:\phpstudy_pro\Extensions\php\php7.3.4nts\phpunit-9.5.8.phar --verbose C:\Users\Administrator\PhpstormProjects\untitled\MultipleDependenciesTest.php
PHPUnit 9.5.8 by Sebastian Bergmann and contributors.
Runtime: PHP 7.3.4
... 3 / 3 (100%)
Time: 00:00.009, Memory: 20.00 MB
OK (3 tests, 4 assertions)
看起来好像也就只是多了一个Runtime,然后显示了下当前的php版本。
不过可能在某些情况下有用吧。
关键字词:phpunit,verbose
下一篇:phpunit数据供给器