Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php')
-rw-r--r--plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php
index 154e343cce..d70bc8010e 100644
--- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php
+++ b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php
@@ -39,7 +39,7 @@ class TwoFactorAuthenticationTest extends IntegrationTestCase
*/
private $twoFa;
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
@@ -92,21 +92,19 @@ class TwoFactorAuthenticationTest extends IntegrationTestCase
$this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('mylogin'));
}
- /**
- * @expectedExceptionMessage Anonymous cannot use
- * @expectedException \Exception
- */
public function test_saveSecret_neverWorksForAnonymous()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Anonymous cannot use');
+
$this->twoFa->saveSecret('anonymous', '123456');
}
- /**
- * @expectedExceptionMessage no recovery codes have been created
- * @expectedException \Exception
- */
public function test_saveSecret_notWorksWhenNoRecoveryCodesCreated()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('no recovery codes have been created');
+
$this->twoFa->saveSecret('not', '123456');
}