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/APITest.php')
-rw-r--r--plugins/TwoFactorAuth/tests/Integration/APITest.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/TwoFactorAuth/tests/Integration/APITest.php b/plugins/TwoFactorAuth/tests/Integration/APITest.php
index af73c410d3..3ab31070c7 100644
--- a/plugins/TwoFactorAuth/tests/Integration/APITest.php
+++ b/plugins/TwoFactorAuth/tests/Integration/APITest.php
@@ -50,7 +50,7 @@ class APITest extends IntegrationTestCase
Fixture::createWebsite('2014-01-02 03:04:05');
}
- foreach (['mylogin1', 'mylogin2'] as $user) {
+ foreach (['mylogin1', 'mylogin2', 'login'] as $user) {
UsersAPI::getInstance()->addUser($user, '123abcDk3_l3', $user . '@matomo.org');
}
$this->twoFa = StaticContainer::get(TwoFactorAuthentication::class);
@@ -62,7 +62,7 @@ class APITest extends IntegrationTestCase
$this->expectExceptionMessage('checkUserHasSuperUserAccess Fake exception');
$this->setAdminUser();
- $this->api->resetTwoFactorAuth('login');
+ $this->api->resetTwoFactorAuth('login', 'superUserPass');
}
public function test_resetTwoFactorAuth_resetsSecret()
@@ -74,7 +74,7 @@ class APITest extends IntegrationTestCase
$this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin1'));
$this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2'));
- $this->api->resetTwoFactorAuth('mylogin1');
+ $this->api->resetTwoFactorAuth('mylogin1', 'superUserPass');
$this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin1'));
$this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2'));
@@ -95,4 +95,10 @@ class APITest extends IntegrationTestCase
'Piwik\Access' => new FakeAccess()
);
}
+
+ protected static function configureFixture($fixture)
+ {
+ parent::configureFixture($fixture);
+ $fixture->createSuperUser = true;
+ }
}