我在PHPunit上遇到了问题
我的设计路线是
我的设计路线是
/v1/outlet/{outlet_id}/test Route::get('outlets/{outlet_id}/test',['as' => 'test'],function(){ return app('request')->route('outlet_id'); });
当我在邮差或浏览器中调用它时,它正在工作
但在PHPunit中显示为错误
Call to a member function parameter() on array
测试代码
$req = $this->call('GET','/v1/outlets/1/test'); $this->assertResponseStatus(200);
解决方法
您的测试中有多个出口,但在路径定义中出口是单数的.