作者:阿宅是时候听孙燕姿思_542 | 来源:互联网 | 2023-05-16 07:23
Ivegotaproblemwhenusingcommandlinetoruntests:ifIrunphpunitlikethis:使用命令行运行测试时遇到问题
I've got a problem when using command line to run tests: if I run phpunit like this:
使用命令行运行测试时遇到问题:如果我运行phpunit这样:
phpunit -–no-configuration -–filter testAdd DataTest DataProviderTest.php
it works fine. But we use a regular expression to specify exactly the name of the method that we want to be tested:
它工作正常。但是我们使用正则表达式来指定我们想要测试的方法的名称:
phpunit -–no-configuration -–filter /::testAdd$/ DataTest DataProviderTest.php
The second approach is not working unfortunately. Source code is:
不幸的是,第二种方法不起作用。源代码是:
assertEquals($c, $a + $b);
}
public function provider()
{
return array(
array(0, 0, 0),
array(0, 1, 1),
array(1, 0, 1),
array(1, 1, 3)
);
}
}
?>
4 个解决方案