diff options
author | sgiehl <stefan@piwik.org> | 2015-03-14 20:54:42 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-03-14 20:54:42 +0300 |
commit | 3317ff82ffe45056a3fd9efb18c04b164ea25071 (patch) | |
tree | 9c77cadc0a32a7372eda0d1e23be393b7d7d40cd /plugins/UsersManager/tests/Integration/APITest.php | |
parent | 17339285b84b9140dea8997d40e54db78c7bf815 (diff) |
fixes #6359 - make UsersManager.getSitesAccessFromUser work for superuser
Diffstat (limited to 'plugins/UsersManager/tests/Integration/APITest.php')
-rw-r--r-- | plugins/UsersManager/tests/Integration/APITest.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/UsersManager/tests/Integration/APITest.php b/plugins/UsersManager/tests/Integration/APITest.php index 5bd81f75c6..d743ca01a0 100644 --- a/plugins/UsersManager/tests/Integration/APITest.php +++ b/plugins/UsersManager/tests/Integration/APITest.php @@ -135,4 +135,33 @@ class APITest extends IntegrationTestCase $this->api->setUserPreference($user2, 'ohOH_myPreferenceName', 'valueForUser2'); } + public function test_getSitesAccessFromUser_forSuperUser() + { + $user2 = 'userLogin2'; + $this->api->addUser($user2, 'password', 'userlogin2@password.de'); + + // new user doesn't have access to anything + $access = $this->api->getSitesAccessFromUser($user2); + $this->assertEmpty($access); + + $this->api->setSuperUserAccess($user2, true); + + // super user has admin access for every site + $access = $this->api->getSitesAccessFromUser($user2); + $expected = array( + array( + 'site' => 1, + 'access' => 'admin' + ), + array( + 'site' => 2, + 'access' => 'admin' + ), + array( + 'site' => 3, + 'access' => 'admin' + ), + ); + $this->assertEquals($expected, $access); + } } |