diff options
Diffstat (limited to 'plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php')
-rw-r--r-- | plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php index 07429e2916..797620443c 100644 --- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php +++ b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php @@ -44,7 +44,7 @@ class TwoFactorAuthTest extends IntegrationTestCase private $userPassword = '123abcDk3_l3'; private $user2faSecret = '123456'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -64,7 +64,7 @@ class TwoFactorAuthTest extends IntegrationTestCase unset($_GET['authCode']); } - public function tearDown() + public function tearDown(): void { unset($_GET['authCode']); } @@ -87,24 +87,22 @@ class TwoFactorAuthTest extends IntegrationTestCase $this->assertEquals(32, strlen($token)); } - /** - * @expectedException \Exception - * @expectedExceptionMessage TwoFactorAuth_MissingAuthCodeAPI - */ public function test_onApiGetTokenAuth_throwsErrorWhenMissingTokenWhenUsing2FaAndAuthenticatedCorrectly() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('TwoFactorAuth_MissingAuthCodeAPI'); + Request::processRequest('UsersManager.getTokenAuth', array( 'userLogin' => $this->userWith2Fa, 'md5Password' => md5($this->userPassword) )); } - /** - * @expectedException \Exception - * @expectedExceptionMessage TwoFactorAuth_InvalidAuthCode - */ public function test_onApiGetTokenAuth_throwsErrorWhenInvalidTokenWhenUsing2FaAndAuthenticatedCorrectly() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('TwoFactorAuth_InvalidAuthCode'); + $_GET['authCode'] = '111222'; Request::processRequest('UsersManager.getTokenAuth', array( 'userLogin' => $this->userWith2Fa, |