]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(tests): Adjust unit tests
authorJoas Schilling <coding@schilljs.com>
Mon, 15 May 2023 14:12:14 +0000 (16:12 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 15 May 2023 14:12:54 +0000 (16:12 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
tests/Core/Controller/LostControllerTest.php

index 7a28cd864e33a13dabe0772e5b185b3a79e02daf..1ee0d00c169df85eb9ee9963bbad618bd325579a 100644 (file)
@@ -574,7 +574,7 @@ class LostControllerTest extends \Test\TestCase {
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
                $expectedResponse = ['status' => 'error', 'msg' => ''];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSetPasswordSuccessful() {
@@ -604,7 +604,7 @@ class LostControllerTest extends \Test\TestCase {
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
                $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSetPasswordExpiredToken() {
@@ -628,7 +628,7 @@ class LostControllerTest extends \Test\TestCase {
                        'status' => 'error',
                        'msg' => 'Couldn\'t reset password because the token is expired',
                ];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSetPasswordInvalidDataInDb() {
@@ -679,7 +679,7 @@ class LostControllerTest extends \Test\TestCase {
                        'status' => 'error',
                        'msg' => 'Couldn\'t reset password because the token is expired',
                ];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testIsSetPasswordWithoutTokenFailing() {
@@ -717,7 +717,7 @@ class LostControllerTest extends \Test\TestCase {
                        'status' => 'error',
                        'msg' => 'Couldn\'t reset password because the token is invalid'
                ];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSetPasswordForDisabledUser() {
@@ -740,7 +740,7 @@ class LostControllerTest extends \Test\TestCase {
                        'status' => 'error',
                        'msg' => 'Couldn\'t reset password because the token is invalid'
                ];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSendEmailNoEmail() {
@@ -776,7 +776,7 @@ class LostControllerTest extends \Test\TestCase {
                        }]]);
                $response = $this->lostController->setPassword('myToken', 'user', 'newpass', false);
                $expectedResponse = ['status' => 'error', 'msg' => '', 'encryption' => true];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testSetPasswordDontProceedMasterKey() {
@@ -812,7 +812,7 @@ class LostControllerTest extends \Test\TestCase {
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false);
                $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
-               $this->assertSame($expectedResponse, $response);
+               $this->assertSame($expectedResponse, $response->getData());
        }
 
        public function testTwoUsersWithSameEmail() {