Skip to content

Commit

Permalink
AuthPasswordBrokerTest in another way
Browse files Browse the repository at this point in the history
  • Loading branch information
chmv committed Oct 21, 2019
1 parent af4522e commit 5111a18
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/Auth/AuthPasswordBrokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,18 @@ protected function getBroker($mocks)
protected function getMocks()
{
return [
'tokens' => m::mock(TokenRepositoryInterface::class),
'tokens' => m::mock(TestTokenRepositoryInterface::class),
'users' => m::mock(UserProvider::class),
'mailer' => m::mock(Mailer::class),
'view' => 'resetLinkView',
];
}
}

// Before 7.x we have to check the existence of a new method. In 7.x, this code must be removed.
// Before 7.x we have to check the existence of a new method. In 7.x, this code must be moved to
// Illuminate\Auth\Passwords\TokenRepositoryInterface

namespace Illuminate\Auth\Passwords;

function method_exists($object, $method_name)
interface TestTokenRepositoryInterface extends TokenRepositoryInterface
{
if ($method_name == 'recentlyCreated') {
return true;
}

return \method_exists($object, $method_name);
public function recentlyCreated(CanResetPassword $user);
}

0 comments on commit 5111a18

Please sign in to comment.