Php Laravel 5模拟密码代理

Php Laravel 5模拟密码代理,php,unit-testing,laravel,laravel-5,mockery,Php,Unit Testing,Laravel,Laravel 5,Mockery,从样板文件PasswordController::postmail()我正在尝试模拟(使用mockry)这部分: // $this->password is an instance of PasswordBroker $response = $this->passwords->sendResetLink($request->only('email'), function($m) { $m->subject($this->getEmail

从样板文件
PasswordController::postmail()
我正在尝试模拟(使用
mockry
)这部分:

// $this->password is an instance of PasswordBroker
$response = $this->passwords->sendResetLink($request->only('email'), function($m)
    {
        $m->subject($this->getEmailSubject());
    });
在我的测试用例中,我使用($postData,?)调用
->shouldReceive('sendResetLink')->

由于这是一个闭包,我确信我必须通过一个闭包,并且还要模拟
$m->subject($this->getEmailSubject())但我在这一点上是空白的,因为我对TDD比较陌生

我能知道一些方向吗

->shouldReceive('sendResetLink')
->once()
->with($postData, \Mockery::type('Closure'));