diff --git a/src/tests/unit/Application/Controller/Admin/d3totpadminloginTest.php b/src/tests/unit/Application/Controller/Admin/d3totpadminloginTest.php index 34c5137..833ad36 100644 --- a/src/tests/unit/Application/Controller/Admin/d3totpadminloginTest.php +++ b/src/tests/unit/Application/Controller/Admin/d3totpadminloginTest.php @@ -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() { diff --git a/src/tests/unit/Modules/Application/Controller/Admin/d3_totp_LoginControllerTest.php b/src/tests/unit/Modules/Application/Controller/Admin/d3_totp_LoginControllerTest.php index 94f8309..41d39ed 100644 --- a/src/tests/unit/Modules/Application/Controller/Admin/d3_totp_LoginControllerTest.php +++ b/src/tests/unit/Modules/Application/Controller/Admin/d3_totp_LoginControllerTest.php @@ -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