当前位置: 首页>>代码示例>>PHP>>正文


PHP FakeAccess::clearAccess方法代码示例

本文整理汇总了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);
 }
开发者ID:piwik,项目名称:piwik,代码行数:7,代码来源:ConfigReaderTest.php

示例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());
 }
开发者ID:piwik,项目名称:plugin-AnonymousPiwikUsageMeasurement,代码行数:17,代码来源:CustomVariablesTest.php

示例4: testGetSettingValue_shouldThrowException_IfNoPermissionToRead

 /**
  * @expectedException \Exception
  * @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
  */
 public function testGetSettingValue_shouldThrowException_IfNoPermissionToRead()
 {
     FakeAccess::clearAccess();
     $this->createSetting()->getValue();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:9,代码来源:MeasurableSettingTest.php

示例5: setAnonymous

 private function setAnonymous()
 {
     FakeAccess::clearAccess();
     FakeAccess::$identity = 'anonymous';
 }
开发者ID:JoeHorn,项目名称:piwik,代码行数:5,代码来源:ApiTest.php

示例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));
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:9,代码来源:ApiTest.php

示例7: setAnonymousUser

 protected function setAnonymousUser()
 {
     FakeAccess::clearAccess();
     FakeAccess::$identity = 'anonymous';
 }
开发者ID:ep123,项目名称:plugin-CustomDimensions,代码行数:5,代码来源:ApiTest.php

示例8: testGetSettingValue_shouldThrowException_IfNoPermissionToRead

 /**
  * @expectedException \Exception
  * @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
  */
 public function testGetSettingValue_shouldThrowException_IfNoPermissionToRead()
 {
     FakeAccess::clearAccess();
     $this->measurable->getSettingValue('app_id');
 }
开发者ID:mgou-net,项目名称:piwik,代码行数:9,代码来源:MeasurableTest.php

示例9: test_save_shouldCheckAdminPermissionsForThatSite

 /**
  * @expectedException \Exception
  * @expectedExceptionMessage checkUserHasAdminAccess
  */
 public function test_save_shouldCheckAdminPermissionsForThatSite()
 {
     FakeAccess::clearAccess();
     $this->settings->save();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:9,代码来源:MeasurableSettingsTest.php

示例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');
 }
开发者ID:sebastianpiskorski,项目名称:piwik,代码行数:9,代码来源:UsersManagerTest.php

示例11: test_getLogConfig_shouldThrowExceptionIfNotEnoughPermission

 /**
  * @expectedException \Exception
  * @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
  */
 public function test_getLogConfig_shouldThrowExceptionIfNotEnoughPermission()
 {
     FakeAccess::clearAccess(false);
     $this->api->getLogConfig();
 }
开发者ID:piwik,项目名称:plugin-LogViewer,代码行数:9,代码来源:ApiTest.php

示例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);
 }
开发者ID:JoeHorn,项目名称:piwik,代码行数:13,代码来源:UserAccessFilterTest.php

示例13: setAnonymousUser

 protected function setAnonymousUser()
 {
     FakeAccess::clearAccess();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:4,代码来源:IntegrationTestCase.php

示例14: setAdminUser

 protected function setAdminUser($userName = 'myUserLogin')
 {
     FakeAccess::clearAccess($superUser = false, $idSitesAdmin = array(1, 2), $idSitesView = array(1, 2), $userName);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:4,代码来源:ApiTest.php

示例15: setAnonymous

 private function setAnonymous()
 {
     FakeAccess::clearAccess();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:4,代码来源:APITest.php


注:本文中的Piwik\Tests\Framework\Mock\FakeAccess::clearAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。