我尝试运行我的测试来测试异常情况,但是我得到错误 - 未定义的函数expectException:
public function testException($n)
{
$this->expectException(Exception::class);
$this->expectExceptionMessage('Parameter n must be > 0');
$task9 = new Source\Task9();
$task9->tower_builder($n);
}
我的composer.json文件是:
{
"name": "codewars/pack",
"description": "Codewars project",
"type": "project",
"require": {
"phpunit/phpunit": "5.5.*"
},
"autoload": {
"psr-4": {
"Source\\": "src/"
}
}
}