PHPUnit未定义函数expectException

时间:2017-02-01 18:09:25

标签: phpunit

我尝试运行我的测试来测试异常情况,但是我得到错误 - 未定义的函数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/"
 }
 }
 }

0 个答案:

没有答案