]> source.dussan.org Git - nextcloud-server.git/commitdiff
adapt testGetLoginCredentialsInvalidTokenLoginCredentials() unit test to uid != loginname 21499/head
authorLionel Elie Mamane <lionel@mamane.lu>
Sun, 7 Jun 2020 13:41:09 +0000 (15:41 +0200)
committerLionel Elie Mamane <lionel@mamane.lu>
Sat, 20 Jun 2020 09:52:42 +0000 (11:52 +0200)
Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
tests/lib/Authentication/LoginCredentials/StoreTest.php

index b75e149888911ac5b80008615829de74cf1e34da..259d852f808a09d15591f33f3c993f0566e25995 100644 (file)
@@ -142,7 +142,8 @@ class StoreTest extends TestCase {
        }
 
        public function testGetLoginCredentialsInvalidTokenLoginCredentials() {
-               $uid = 'user987';
+               $uid = 'id987';
+               $user = 'user987';
                $password = '7389374';
 
                $this->session->expects($this->once())
@@ -156,11 +157,11 @@ class StoreTest extends TestCase {
                        ->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();