本文整理匯總了PHP中Piwik\Tests\Framework\Mock\FakeAccess::setSuperUserAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP FakeAccess::setSuperUserAccess方法的具體用法?PHP FakeAccess::setSuperUserAccess怎麽用?PHP FakeAccess::setSuperUserAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Tests\Framework\Mock\FakeAccess
的用法示例。
在下文中一共展示了FakeAccess::setSuperUserAccess方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
parent::setUp();
FakeAccess::setSuperUserAccess(true);
$idSite = Fixture::createWebsite('2014-01-01 00:00:00');
$this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'idSite' => $idSite));
}
示例2: setNonAdminUser
protected function setNonAdminUser()
{
FakeAccess::setSuperUserAccess(false);
FakeAccess::$idSitesView = array(99);
FakeAccess::$identity = 'aUser';
}
示例3: test_getSitesIdFromSiteUrl_matchesBothHttpAndHttpsUrls_asUserWithViewPermission
public function test_getSitesIdFromSiteUrl_matchesBothHttpAndHttpsUrls_asUserWithViewPermission()
{
API::getInstance()->addSite("site1", array("https://piwik.org", "http://example.com", "fb://special-url"));
APIUsersManager::getInstance()->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
APIUsersManager::getInstance()->setUserAccess("user1", "view", array(1));
// Make sure we're not Super user
FakeAccess::setSuperUserAccess(false);
FakeAccess::$identity = 'user1';
$this->assertFalse(Piwik::hasUserSuperUserAccess());
$this->assert_getSitesIdFromSiteUrl_matchesBothHttpAndHttpsUrls();
}
示例4: setSuperUser
private function setSuperUser()
{
FakeAccess::setSuperUserAccess(true);
}
示例5: testSetSuperUserAccess_ShouldFail_IfUserHasNotSuperUserPermission
/**
* @expectedException \Exception
* @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
*/
public function testSetSuperUserAccess_ShouldFail_IfUserHasNotSuperUserPermission()
{
FakeAccess::setSuperUserAccess(false);
$this->api->setSuperUserAccess('nologin', false);
}