當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Mock\FakeAccess類代碼示例

本文整理匯總了PHP中Piwik\Tests\Framework\Mock\FakeAccess的典型用法代碼示例。如果您正苦於以下問題:PHP FakeAccess類的具體用法?PHP FakeAccess怎麽用?PHP FakeAccess使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FakeAccess類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUser

 protected function setUser()
 {
     FakeAccess::$superUser = false;
     FakeAccess::$idSitesAdmin = array();
     FakeAccess::$idSitesView = array(99);
     FakeAccess::$identity = 'aUser';
 }
開發者ID:andrzejewsky,項目名稱:plugin-CustomAlerts,代碼行數:7,代碼來源:BaseTest.php

示例2: testGetUnit

 /**
  * @dataProvider getUnitColumns
  * @group Core
  */
 public function testGetUnit($column, $expected)
 {
     Site::setSites(array(1 => array('name' => 'TestSite', 'currency' => 'EUR')));
     FakeAccess::$superUser = true;
     $actual = Metrics::getUnit($column, 1);
     $this->assertEquals($expected, $actual);
 }
開發者ID:mgou-net,項目名稱:piwik,代碼行數:11,代碼來源:MetricsTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     FakeAccess::$superUser = true;
     $idSite = Fixture::createWebsite('2014-01-01 00:00:00');
     $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'idSite' => $idSite));
 }
開發者ID:hongquan,項目名稱:piwik,代碼行數:7,代碼來源:RssRendererTest.php

示例4: 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

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     Fixture::createWebsite('2015-01-01 00:00:00');
 }
開發者ID:mgou-net,項目名稱:piwik,代碼行數:7,代碼來源:ChunksTest.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     ArchiveTableCreator::$tablesAlreadyInstalled = null;
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:7,代碼來源:ArchiveProcessingTest.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     $this->manager = new SitesManager();
     $this->siteId = Fixture::createWebsite('2014-03-03 00:00:00');
 }
開發者ID:dorelljames,項目名稱:piwik,代碼行數:8,代碼來源:SitesManagerTest.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     $this->idSiteAccess = APISitesManager::getInstance()->addSite("test", "http://test");
     \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports', 'MobileMessaging', 'MultiSites'));
     \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:MobileMessagingTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     for ($i = 0; $i < $this->site2; $i++) {
         Fixture::createWebsite('2015-01-01 00:00:00');
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:DataTableFactoryTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::$superUser = true;
     Manager::getInstance()->loadTrackerPlugins();
     Manager::getInstance()->loadPlugin('SitesManager');
     Visit::$dimensions = null;
 }
開發者ID:Michael2008S,項目名稱:piwik,代碼行數:9,代碼來源:VisitTest.php

示例11: 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

示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->api = API::getInstance();
     FakeAccess::$superUser = true;
     Fixture::createWebsite('2014-01-01 00:00:00');
     Fixture::createWebsite('2014-01-01 00:00:00');
     Fixture::createWebsite('2014-01-01 00:00:00');
     $this->api->addUser($this->login, 'password', 'userlogin@password.de');
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:APITest.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::setIdSitesView(array(1, 2));
     FakeAccess::setIdSitesAdmin(array(3, 4));
     //finally we set the user as a Super User by default
     FakeAccess::$superUser = true;
     $this->auth = new Auth();
 }
開發者ID:ahdinosaur,項目名稱:analytics.dinosaur.is,代碼行數:10,代碼來源:LoginTest.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::setIdSitesView(array(1, 2));
     FakeAccess::setIdSitesAdmin(array(3, 4));
     //finally we set the user as a Super User by default
     FakeAccess::$superUser = true;
     $user_agents = array('Mozilla/6.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4', 'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1');
     $_SERVER['HTTP_USER_AGENT'] = $user_agents[mt_rand(0, count($user_agents) - 1)];
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:11,代碼來源:SEOTest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     // setup the access layer
     FakeAccess::setIdSitesView(array(1, 2));
     FakeAccess::setIdSitesAdmin(array(3, 4));
     //finally we set the user as a Super User by default
     FakeAccess::$superUser = true;
     $this->auth = new Auth();
     $ga = new GoogleAuthenticator();
     $this->secret = $ga->createSecret(32);
 }
開發者ID:sgiehl,項目名稱:piwik-plugin-GoogleAuthenticator,代碼行數:12,代碼來源:GoogleAuthenticatorTest.php


注:本文中的Piwik\Tests\Framework\Mock\FakeAccess類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。