userRepository = $this->mock(UserRepository::class); $this->tokenManager = $this->mock(TokenManager::class); $this->passwordBroker = $this->mock(PasswordBroker::class); $this->service = new AuthenticationService( $this->userRepository, $this->tokenManager, $this->passwordBroker ); } public function testTrySendResetPasswordLink(): void { $this->passwordBroker ->shouldReceive('sendResetLink') ->with(['email' => 'foo@bar.com']) ->andReturn(Password::RESET_LINK_SENT); $this->assertTrue($this->service->trySendResetPasswordLink('foo@bar.com')); } }