adjust tests
This commit is contained in:
bovenliggende
7a2648fe7b
commit
a9a279a753
@ -645,7 +645,7 @@ class d3totpadminloginTest extends d3TotpUnitTestCase
|
||||
/**
|
||||
* @test
|
||||
* @throws ReflectionException
|
||||
* @covers \D3\Totp\Application\Controller\Admin\d3totpadminlogin::d3GetLoginControllert
|
||||
* @covers \D3\Totp\Application\Controller\Admin\d3totpadminlogin::d3GetLoginController
|
||||
*/
|
||||
public function d3GetLoginControllerReturnsRightObject()
|
||||
{
|
||||
|
@ -173,14 +173,15 @@ class d3_totp_LoginControllerTest extends d3TotpUnitTestCase
|
||||
* @test
|
||||
* @throws ReflectionException
|
||||
* @covers \D3\Totp\Modules\Application\Controller\Admin\d3_totp_LoginController::d3totpAfterLoginSetLanguage
|
||||
* @dataProvider canRunTotpAfterLoginSetLanguageDataProvider
|
||||
*/
|
||||
public function canRunTotpAfterLoginSetLanguage()
|
||||
public function canRunTotpAfterLoginSetLanguage($languageId)
|
||||
{
|
||||
/** @var Session|MockObject $sessionMock */
|
||||
$sessionMock = $this->getMockBuilder(Session::class)
|
||||
->onlyMethods(['getVariable'])
|
||||
->getMock();
|
||||
$sessionMock->method('getVariable')->willReturn(0);
|
||||
$sessionMock->method('getVariable')->willReturn($languageId);
|
||||
|
||||
/** @var UtilsServer|MockObject $utilsServerMock */
|
||||
$utilsServerMock = $this->getMockBuilder(UtilsServer::class)
|
||||
@ -208,6 +209,17 @@ class d3_totp_LoginControllerTest extends d3TotpUnitTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function canRunTotpAfterLoginSetLanguageDataProvider(): array
|
||||
{
|
||||
return [
|
||||
'existing language' => [0],
|
||||
'not existing language' => [50],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @param $totpActive
|
||||
@ -266,19 +278,6 @@ class d3_totp_LoginControllerTest extends d3TotpUnitTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @throws ReflectionException
|
||||
* @covers \D3\Totp\Modules\Application\Controller\Admin\d3_totp_LoginController::d3TotpGetUserObject
|
||||
*/
|
||||
public function d3GetUserObjectReturnsRightObject()
|
||||
{
|
||||
$this->assertInstanceOf(
|
||||
User::class,
|
||||
$this->callMethod($this->_oController, 'd3TotpGetUserObject')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @throws ReflectionException
|
||||
|
Laden…
Verwijs in nieuw issue
Block a user