我的DeveloperTinker上有一个静态方法,但是,当我运行它时,出现
[BadMethodCallException]
调用未定义的方法Illuminate \ Database \ Query \ Builder :: firstName()
这是我的代码
$mockUser = Mockery::mock('User');
$mockUser -> shouldReceive("firstName")->with('1')->andReturn('Luis');
Test::double('User', ["firstName" => $mockUser]);
$userOP = User::firstName('user-51e06817-c03c822b');
$this->info($userOP->firstName('1'));
return;`