From b5ffca00f7c7132cc58dce97a6adf002efa564de Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 16 Apr 2021 09:41:54 +0200 Subject: Fix unit test * Fix namespace * Fix test Was broken after https://github.com/nextcloud/server/pull/26529 Signed-off-by: Roeland Jago Douma --- tests/lib/Authentication/Login/ALoginCommandTest.php | 2 +- .../Authentication/Login/ClearLostPasswordTokensCommandTest.php | 1 - tests/lib/Authentication/Login/CompleteLoginCommandTest.php | 2 +- tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php | 6 +++--- tests/lib/Authentication/Login/EmailLoginCommandTest.php | 2 +- .../lib/Authentication/Login/FinishRememberedLoginCommandTest.php | 2 +- tests/lib/Authentication/Login/LoggedInCheckCommandTest.php | 2 +- tests/lib/Authentication/Login/PreLoginHookCommandTest.php | 2 +- tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php | 2 +- tests/lib/Authentication/Login/TwoFactorCommandTest.php | 2 +- tests/lib/Authentication/Login/UidLoginCommandTest.php | 2 +- .../Authentication/Login/UpdateLastPasswordConfirmCommandTest.php | 2 +- tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php | 2 +- tests/lib/Collaboration/Collaborators/LookupPluginTest.php | 8 ++++---- 14 files changed, 18 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/lib/Authentication/Login/ALoginCommandTest.php b/tests/lib/Authentication/Login/ALoginCommandTest.php index 03cc7dfadc7..7c66e102704 100644 --- a/tests/lib/Authentication/Login/ALoginCommandTest.php +++ b/tests/lib/Authentication/Login/ALoginCommandTest.php @@ -22,7 +22,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\ALoginCommand; use OC\Authentication\Login\LoginData; diff --git a/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php b/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php index 49c81b4f385..ded03cd95cd 100644 --- a/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php +++ b/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace Test\Authentication\Login; -use lib\Authentication\Login\ALoginCommandTest; use OC\Authentication\Login\ClearLostPasswordTokensCommand; use OCP\IConfig; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/lib/Authentication/Login/CompleteLoginCommandTest.php b/tests/lib/Authentication/Login/CompleteLoginCommandTest.php index 7d6152f97a1..f90de10cdda 100644 --- a/tests/lib/Authentication/Login/CompleteLoginCommandTest.php +++ b/tests/lib/Authentication/Login/CompleteLoginCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\CompleteLoginCommand; use OC\User\Session; diff --git a/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php b/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php index 9e49413e344..ef23e072c60 100644 --- a/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php +++ b/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\CreateSessionTokenCommand; use OC\Authentication\Token\IToken; @@ -54,7 +54,7 @@ class CreateSessionTokenCommandTest extends ALoginCommandTest { public function testProcess() { $data = $this->getLoggedInLoginData(); $this->config->expects($this->once()) - ->method('getSystemValue') + ->method('getSystemValueInt') ->with( 'remember_login_cookie_lifetime', 60 * 60 * 24 * 15 @@ -87,7 +87,7 @@ class CreateSessionTokenCommandTest extends ALoginCommandTest { public function testProcessDoNotRemember() { $data = $this->getLoggedInLoginData(); $this->config->expects($this->once()) - ->method('getSystemValue') + ->method('getSystemValueInt') ->with( 'remember_login_cookie_lifetime', 60 * 60 * 24 * 15 diff --git a/tests/lib/Authentication/Login/EmailLoginCommandTest.php b/tests/lib/Authentication/Login/EmailLoginCommandTest.php index 4c1f0bd0e5b..9de372148b9 100644 --- a/tests/lib/Authentication/Login/EmailLoginCommandTest.php +++ b/tests/lib/Authentication/Login/EmailLoginCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\EmailLoginCommand; use OCP\IUser; diff --git a/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php b/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php index 7b461219456..e24a3ca8f8d 100644 --- a/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php +++ b/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\FinishRememberedLoginCommand; use OC\User\Session; diff --git a/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php b/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php index 4762c601bb8..afe486ab095 100644 --- a/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php +++ b/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\LoggedInCheckCommand; use OC\Core\Controller\LoginController; diff --git a/tests/lib/Authentication/Login/PreLoginHookCommandTest.php b/tests/lib/Authentication/Login/PreLoginHookCommandTest.php index 66822291ba8..d83717399d4 100644 --- a/tests/lib/Authentication/Login/PreLoginHookCommandTest.php +++ b/tests/lib/Authentication/Login/PreLoginHookCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\PreLoginHookCommand; use OC\User\Manager; diff --git a/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php b/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php index 88514fec237..8f7057e9d69 100644 --- a/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php +++ b/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\SetUserTimezoneCommand; use OCP\IConfig; diff --git a/tests/lib/Authentication/Login/TwoFactorCommandTest.php b/tests/lib/Authentication/Login/TwoFactorCommandTest.php index 4796aecad2e..fd37712c130 100644 --- a/tests/lib/Authentication/Login/TwoFactorCommandTest.php +++ b/tests/lib/Authentication/Login/TwoFactorCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\TwoFactorCommand; use OC\Authentication\TwoFactorAuth\Manager; diff --git a/tests/lib/Authentication/Login/UidLoginCommandTest.php b/tests/lib/Authentication/Login/UidLoginCommandTest.php index 6e22609631d..1f00ba77da4 100644 --- a/tests/lib/Authentication/Login/UidLoginCommandTest.php +++ b/tests/lib/Authentication/Login/UidLoginCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\UidLoginCommand; use OC\User\Manager; diff --git a/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php b/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php index 3db23d471ec..3ff82b38acc 100644 --- a/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php +++ b/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\UpdateLastPasswordConfirmCommand; use OCP\ISession; diff --git a/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php b/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php index 8c15ebe6c8f..65cfd0a71ac 100644 --- a/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php +++ b/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php @@ -23,7 +23,7 @@ declare(strict_types=1); -namespace lib\Authentication\Login; +namespace Test\Authentication\Login; use OC\Authentication\Login\UserDisabledCheckCommand; use OC\Core\Controller\LoginController; diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php index 0a1febe33a5..81279c4c569 100644 --- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php @@ -97,7 +97,7 @@ class LookupPluginTest extends TestCase { ->willReturn(false); $this->config->expects($this->at(2)) - ->method('getSystemValue') + ->method('getSystemValueBool') ->with('has_internet_connection', true) ->willReturn(true); $this->config->expects($this->at(3)) @@ -125,7 +125,7 @@ class LookupPluginTest extends TestCase { ->willReturn(false); $this->config->expects($this->at(2)) - ->method('getSystemValue') + ->method('getSystemValueBool') ->with('has_internet_connection', true) ->willReturn(false); @@ -161,7 +161,7 @@ class LookupPluginTest extends TestCase { ->willReturn(false); $this->config->expects($this->at(2)) - ->method('getSystemValue') + ->method('getSystemValueBool') ->with('has_internet_connection', true) ->willReturn(true); $this->config->expects($this->at(3)) @@ -224,7 +224,7 @@ class LookupPluginTest extends TestCase { ->with($type, $searchParams['expectedResult'], []); $this->config->expects($this->at(2)) - ->method('getSystemValue') + ->method('getSystemValueBool') ->with('has_internet_connection', true) ->willReturn(true); $this->config->expects($this->at(3)) -- cgit v1.2.3