本文整理汇总了PHP中Piwik\Tests\Framework\Mock\FakeAccess::clearAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP FakeAccess::clearAccess方法的具体用法?PHP FakeAccess::clearAccess怎么用?PHP FakeAccess::clearAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tests\Framework\Mock\FakeAccess
的用法示例。
在下文中一共展示了FakeAccess::clearAccess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$settings = new GlobalSettingsProvider($this->configPath('global.ini.php'), $this->configPath('config.ini.php'), $this->configPath('common.config.ini.php'));
$this->configReader = new ConfigReader($settings, new IniReader());
FakeAccess::clearAccess($superUser = true);
}
示例2: test_shouldAlwaysAddTrackingCallAndNotFail_IfUserIsAnonmyous
public function test_shouldAlwaysAddTrackingCallAndNotFail_IfUserIsAnonmyous()
{
$this->makePluginSettings();
FakeAccess::clearAccess($superUser = false, array(), array(), $login = 'anonymous');
$out = '';
Piwik::postEvent('Template.jsGlobalVariables', array(&$out));
$this->assertContains('var piwikUsageTracking = {"targets":[{"url"', $out);
$this->assertContains('{"id":1,"name":"Access","value":"anonymous"}', $out);
}
开发者ID:andrzejewsky,项目名称:plugin-AnonymousPiwikUsageMeasurement,代码行数:9,代码来源:AnonymousPiwikUsageMeasurementTest.php
示例3: test_getServerVisitCustomVariables_shouldReturnSystemReport
public function test_getServerVisitCustomVariables_shouldReturnSystemReport()
{
FakeAccess::clearAccess($superUser = true);
for ($i = 1; $i < 15; $i++) {
if (!Fixture::siteCreated($i)) {
Fixture::createWebsite('2014-01-01 00:00:00');
}
}
for ($i = 1; $i < 9; $i++) {
UsersApi::getInstance()->addUser($login = 'test' . $i, 'password0815', "lorem{$i}@piwik.org");
}
for ($i = 1; $i < 5; $i++) {
SegmentApi::getInstance()->add('Segment' . $i, 'pageUrl%3D@inde');
}
$customVars = array(array('id' => 1, 'name' => 'Piwik Version', 'value' => '2.14.3'), array('id' => 2, 'name' => 'PHP Version', 'value' => '5.5.27'), array('id' => 3, 'name' => 'Num Users', 'value' => 8), array('id' => 4, 'name' => 'Num Websites', 'value' => 14), array('id' => 5, 'name' => 'Num Segments', 'value' => 4), array('id' => 6, 'name' => 'MySQL Version', 'value' => Db::get()->getServerVersion()));
$this->assertSame($customVars, $this->customVars->getServerVisitCustomVariables());
}
示例4: testGetSettingValue_shouldThrowException_IfNoPermissionToRead
/**
* @expectedException \Exception
* @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
*/
public function testGetSettingValue_shouldThrowException_IfNoPermissionToRead()
{
FakeAccess::clearAccess();
$this->createSetting()->getValue();
}
示例5: setAnonymous
private function setAnonymous()
{
FakeAccess::clearAccess();
FakeAccess::$identity = 'anonymous';
}
示例6: test_getAlerts_shouldFail_IfUserDoesNotHaveAccessToWebsite
/**
* @expectedException \Exception
* @expectedExceptionMessage checkUserHasViewAccess Fake exception
*/
public function test_getAlerts_shouldFail_IfUserDoesNotHaveAccessToWebsite()
{
FakeAccess::clearAccess();
$this->api->getAlerts(array($this->idSite));
}
示例7: setAnonymousUser
protected function setAnonymousUser()
{
FakeAccess::clearAccess();
FakeAccess::$identity = 'anonymous';
}
示例8: testGetSettingValue_shouldThrowException_IfNoPermissionToRead
/**
* @expectedException \Exception
* @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
*/
public function testGetSettingValue_shouldThrowException_IfNoPermissionToRead()
{
FakeAccess::clearAccess();
$this->measurable->getSettingValue('app_id');
}
示例9: test_save_shouldCheckAdminPermissionsForThatSite
/**
* @expectedException \Exception
* @expectedExceptionMessage checkUserHasAdminAccess
*/
public function test_save_shouldCheckAdminPermissionsForThatSite()
{
FakeAccess::clearAccess();
$this->settings->save();
}
示例10: testGetUserLoginFromUserEmail_shouldThrowException_IfUserDoesNotHaveAtLeastAdminPermission
/**
* @expectedException \Exception
* @expectedExceptionMessage checkUserHasSomeAdminAccess Fake exception
*/
public function testGetUserLoginFromUserEmail_shouldThrowException_IfUserDoesNotHaveAtLeastAdminPermission()
{
FakeAccess::clearAccess($superUser = false, $admin = array(), $view = array(1));
$this->api->getUserLoginFromUserEmail('tegst@tesgt.com');
}
示例11: test_getLogConfig_shouldThrowExceptionIfNotEnoughPermission
/**
* @expectedException \Exception
* @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
*/
public function test_getLogConfig_shouldThrowExceptionIfNotEnoughPermission()
{
FakeAccess::clearAccess(false);
$this->api->getLogConfig();
}
示例12: configureAcccessForLogin
private function configureAcccessForLogin($login)
{
$hasSuperUser = false;
$idSitesAdmin = array();
$idSitesView = array();
if ($login === 'login1') {
$hasSuperUser = true;
} elseif (isset($this->users[$login])) {
$idSitesAdmin = $this->users[$login]['admin'];
$idSitesView = $this->users[$login]['view'];
}
FakeAccess::clearAccess($hasSuperUser, $idSitesAdmin, $idSitesView, $login);
}
示例13: setAnonymousUser
protected function setAnonymousUser()
{
FakeAccess::clearAccess();
}
示例14: setAdminUser
protected function setAdminUser($userName = 'myUserLogin')
{
FakeAccess::clearAccess($superUser = false, $idSitesAdmin = array(1, 2), $idSitesView = array(1, 2), $userName);
}
示例15: setAnonymous
private function setAnonymous()
{
FakeAccess::clearAccess();
}