我创建了以下接口:interface Action public function execute(\requests\Request $request, array $params);然后我尝试用PHPUnit 3.4为这个接口创建一个模拟对象,但是我得到了以下错误:
致命错误:Action()的声明必须与第2行的D:\Xampp\xampp\php\PEAR\PHPUnit\Framework\TestCase.php(1121
= new Person(); }); 'Interfaces\Person' => 'Entities\Person' Entities\Person cannot implement Entities\Person - it is not an interface我似乎陷入了在应用程序中使用IoC和接口的第22条,从而阻止了类的实际实例化。不知道这是否相关,