/**
  * Match configuration with current request
  *
  * @throws \InvalidArgumentException
  * @param $categoryId
  * @return mixed
  */
 public function match($categoryId)
 {
     $this->filterAccessible = false;
     if (!$this->optionHelper->hasEnabledCategories()) {
         $this->filterAccessible = true;
     }
     if (in_array($categoryId, $this->optionHelper->getEnabledCategoryIds())) {
         $this->filterAccessible = true;
     }
     return $this;
 }
Пример #2
0
 public static function setupTestDatabase($database, $tablePrefix)
 {
     Model::setInstallationDir(ipFile(''));
     Model::createDatabaseStructure($database, $tablePrefix);
     Model::importData($tablePrefix);
     OptionHelper::import(__DIR__ . '/options.json');
     Model::insertAdmin('test', '*****@*****.**', 'test');
     ipSetOptionLang('Config.websiteTitle', 'TestSite', 'en');
     ipSetOptionLang('Config.websiteEmail', '*****@*****.**', 'en');
 }