Fix unit test

* Fix namespace
* Fix test

Was broken after https://github.com/nextcloud/server/pull/26529

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2021-04-16 09:41:54 +02:00
parent 07278ed57d
commit b5ffca00f7
14 changed files with 18 additions and 19 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -23,7 +23,7 @@
declare(strict_types=1);
namespace lib\Authentication\Login;
namespace Test\Authentication\Login;
use OC\Authentication\Login\EmailLoginCommand;
use OCP\IUser;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -23,7 +23,7 @@
declare(strict_types=1);
namespace lib\Authentication\Login;
namespace Test\Authentication\Login;
use OC\Authentication\Login\SetUserTimezoneCommand;
use OCP\IConfig;

View File

@ -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;

View File

@ -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;

View File

@ -23,7 +23,7 @@
declare(strict_types=1);
namespace lib\Authentication\Login;
namespace Test\Authentication\Login;
use OC\Authentication\Login\UpdateLastPasswordConfirmCommand;
use OCP\ISession;

View File

@ -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;

View File

@ -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))