您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
phpunit未完成的测试与markTestIncomplete重载
发布时间:2021-09-21 20:55:59编辑:雪饮阅读()
就说之前用的markTestIncomplete是有带参的重载,那么实际上markTestIncomplete方法既然有带参的重载,那么也会有不带参的markTestIncomplete。
DatabaseTest.php:
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class DatabaseTest extends TestCase
{
public function testAdd(): void
{
// 可选:如果愿意,在这里随便测试点什么。
$this->assertTrue(true, 'This should already work.');
// 在这里停止,并将此测试标记为未完成。
$this->markTestIncomplete();
}
}
use PHPUnit\Framework\TestCase;
final class DatabaseTest extends TestCase
{
public function testAdd(): void
{
// 可选:如果愿意,在这里随便测试点什么。
$this->assertTrue(true, 'This should already work.');
// 在这里停止,并将此测试标记为未完成。
$this->markTestIncomplete();
}
}
运行效果还是一样的了
C:\Users\Administrator\PhpstormProjects\untitled\organizing>D:\phpstudy_pro\Extensions\php\php7.3.4nts\php.exe D:\phpstudy_pro\Extensions\php\php7.3.4nts\phpunit-9.5.8.phar --testsuite Database
PHPUnit 9.5.8 by Sebastian Bergmann and contributors.
...I 4 / 4 (100%)
Time: 00:00.007, Memory: 20.00 MB
OK, but incomplete, skipped, or risky tests!
Tests: 4, Assertions: 5, Incomplete: 1.
带参或者不带参在这里体现的效果其实并不明显。
关键字词:phpunit,markTestIncomplete
相关文章
- phpunit未完成的测试与markTestIncomplete
- phpunit参数enforce-time-limit与enforceTimeLimit(2)
- phpunit参数enforce-time-limit与enforceTimeLimit
- phpunit测试执行期间产生的输出-被测试代码及beStrict
- phpunit无用测试的检查和关闭
- phpunit中testsuite配置的file模式
- phpunit中configuration免加载phpunit.xml
- phpunit参数testsuite的使用
- phpunit单文件测试的更细粒度filter
- phpunit组织测试中的单文件测试(单类测试)