Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
adapt testGetLoginCredentialsInvalidTokenLoginCredentials() unit test…
… to uid != loginname

Signed-off-by: Lionel Elie Mamane <[email protected]>
  • Loading branch information
Lionel Elie Mamane committed Jun 20, 2020
commit fa2b111696a85beae9a1ce4e326b9140c8799231
11 changes: 6 additions & 5 deletions tests/lib/Authentication/LoginCredentials/StoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public function testGetLoginCredentialsInvalidToken() {
}

public function testGetLoginCredentialsInvalidTokenLoginCredentials() {
$uid = 'user987';
$uid = 'id987';
$user = 'user987';
$password = '7389374';

$this->session->expects($this->once())
Expand All @@ -156,11 +157,11 @@ public function testGetLoginCredentialsInvalidTokenLoginCredentials() {
->method('exists')
->with($this->equalTo('login_credentials'))
->willReturn(true);
$this->session->expects($this->once())
$this->session->expects($this->exactly(2))
->method('get')
->with($this->equalTo('login_credentials'))
->willReturn('{"run":true,"uid":"user987","password":"7389374"}');
$expected = new Credentials('user987', 'user987', '7389374');
->withConsecutive(['login_credentials'], ['loginname'])
->willReturnOnConsecutiveCalls('{"run":true,"uid":"id987","password":"7389374"}', $user);
$expected = new Credentials($uid, $user, $password);

$actual = $this->store->getLoginCredentials();

Expand Down