-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the password encode domain object with its related implementa…
…tions
- Loading branch information
1 parent
9ac8e75
commit 3a5cd2e
Showing
13 changed files
with
84 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,16 +96,15 @@ function it_doesnt_log_if_user_does_not_exist(UserRepository $repository, User $ | |
|
||
function it_does_not_log_if_user_invalid_password(UserRepository $repository, User $user) | ||
{ | ||
$request = new LogInUserRequest('[email protected]', 'plainPassword'); | ||
$encoder = new DummyUserPasswordEncoder('otherEncodedPassword', false); | ||
$this->beConstructedWith($repository, $encoder); | ||
|
||
$user->login()->shouldNotBeCalled(); | ||
$user->isEnabled()->shouldBeCalled()->willReturn(true); | ||
$user->password()->shouldBeCalled()->willReturn( | ||
UserPassword::fromPlain('otherPassword', new DummyUserPasswordEncoder('otherEncodedPassword')) | ||
); | ||
$request = new LogInUserRequest('[email protected]', 'plainPassword'); | ||
$password = UserPassword::fromPlain('otherPassword', $encoder); | ||
|
||
$repository->userOfEmail(Argument::type(UserEmail::class))->shouldBeCalled()->willReturn($user); | ||
$repository->persist($user)->shouldNotBeCalled(); | ||
$user->isEnabled()->shouldBeCalled()->willReturn(true); | ||
$user->password()->shouldBeCalled()->willReturn($password); | ||
|
||
$this->shouldThrow(UserPasswordInvalidException::class)->duringExecute($request); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters