本文整理汇总了PHP中Piwik\Tests\Framework\Mock\FakeAccess::idSitesAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP FakeAccess::idSitesAdmin方法的具体用法?PHP FakeAccess::idSitesAdmin怎么用?PHP FakeAccess::idSitesAdmin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tests\Framework\Mock\FakeAccess
的用法示例。
在下文中一共展示了FakeAccess::idSitesAdmin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUser
protected function setUser()
{
FakeAccess::$superUser = false;
FakeAccess::$idSitesAdmin = array();
FakeAccess::$idSitesView = array(99);
FakeAccess::$identity = 'aUser';
}
示例2: testMethodPermissions
/**
* @dataProvider getPermissionsFailData
*/
public function testMethodPermissions($hasAdminAccess, $hasViewAccess, $request, $checkException, $failMessage)
{
// create fake access that denies user access
FakeAccess::$superUser = false;
FakeAccess::$idSitesAdmin = $hasAdminAccess ? array(self::$fixture->idSite1) : array();
FakeAccess::$idSitesView = $hasViewAccess ? array(self::$fixture->idSite1) : array();
if ($checkException) {
try {
$request = new Request($request);
$request->process();
$this->fail($failMessage);
} catch (Exception $ex) {
// pass
}
} else {
$request = new Request($request);
$request->process();
}
}
示例3: setUser
protected function setUser()
{
FakeAccess::clearAccess(false);
FakeAccess::$idSitesView = array(1);
FakeAccess::$idSitesAdmin = array();
FakeAccess::$identity = 'aUser';
}
示例4: FakeAccess
return $previous;
}
}), 'Piwik\\Access' => DI\decorate(function ($previous, ContainerInterface $c) {
$testUseMockAuth = $c->get('test.vars.testUseMockAuth');
if ($testUseMockAuth) {
$idSitesAdmin = $c->get('test.vars.idSitesAdminAccess');
$idSitesView = $c->get('test.vars.idSitesViewAccess');
$access = new FakeAccess();
if (!empty($idSitesView)) {
FakeAccess::$superUser = false;
FakeAccess::$idSitesView = $idSitesView;
FakeAccess::$idSitesAdmin = !empty($idSitesAdmin) ? $idSitesAdmin : array();
FakeAccess::$identity = 'viewUserLogin';
} elseif (!empty($idSitesAdmin)) {
FakeAccess::$superUser = false;
FakeAccess::$idSitesAdmin = $idSitesAdmin;
FakeAccess::$identity = 'adminUserLogin';
} else {
FakeAccess::$superUser = true;
FakeAccess::$superUserLogin = 'superUserLogin';
}
return $access;
} else {
return $previous;
}
}), 'observers.global' => DI\add(array(array('AssetManager.getStylesheetFiles', function (&$stylesheets) {
$useOverrideCss = \Piwik\Container\StaticContainer::get('test.vars.useOverrideCss');
if ($useOverrideCss) {
$stylesheets[] = 'tests/resources/screenshot-override/override.css';
}
}), array('AssetManager.getJavaScriptFiles', function (&$jsFiles) {