8
0
Dieser Commit ist enthalten in:
Daniel Seifert 2022-11-25 20:11:04 +01:00
Ursprung 7a2648fe7b
Commit a9a279a753
Signiert von: DanielS
GPG-Schlüssel-ID: 6A513E13AEE66170
2 geänderte Dateien mit 15 neuen und 16 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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