我正在编写phpunit测试用例方法,该方法接受一个参数。
我的代码如下:
class myTestCase extends PHPUnit_Framework_TestCase
{
public function testMyCase($date){
$resultSet=$this->query("select * from testCase where date='$date'");
$this->assertTrue($resultSet,True);
}
}
我正在尝试从Linux终端运行上述测试用例。
phpunit --filter testMyCase myTestCase.php
但是不知道如何传递参数。请帮忙。
谢谢。
assertTrue()
的第二个参数应该是一个string
,请参见 https://github.com/sebastianbergmann/phpunit/blob/6.3.0/src/Framework/Assert.php#L1148-L1151。 - localheinz