本文整理汇总了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);
}