當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。