/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void */ protected function setUp() { $coreConfig = new CoreConfig(); $coreConfig->setValue('stream_wrapper_is_active', 1); $this->object = new Partial($coreConfig); $coreConfig->setValue('stream_wrapper_is_active', 0); $this->view = ViewModel::fromArray(array('name' => 'View Name', 'identifier' => 'view-identifier', 'description' => 'View Description', 'content' => 'View Content')); $this->view->save(); $view = new View(); $templatePathStack = new TemplatePathStack(); $templatePathStack->addPath(GC_TEMPLATE_PATH); $view->setResolver($templatePathStack); $this->object->setView($view); }
/** * Test * * @return void */ public function testOnBootstrap() { $oldAdapter = GlobalAdapterFeature::getStaticAdapter(); $this->config->setValue('debug_is_active', 1); $this->config->setValue('session_lifetime', 3600); $this->config->setValue('cookie_domain', 'got-cms.com'); $this->config->setValue('session_handler', CoreConfig::SESSION_DATABASE); $this->assertNull($this->object->onBootstrap(Registry::get('Application')->getMvcEvent())); GlobalAdapterFeature::setStaticAdapter($oldAdapter); }
/** * Test * * @return void */ public function testIndexActionWithOfflineWebsite() { $this->config->insert(array('identifier' => 'site_is_offline', 'value' => 1)); $this->dispatch('/404Page'); $this->assertResponseStatusCode(200); $this->assertModuleName('GcFrontend'); $this->assertControllerName('IndexController'); $this->assertControllerClass('IndexController'); $this->assertMatchedRouteName('cms'); $this->config->setValue('site_is_offline', 0); }
/** * Set data * * @param string $identifier Identifier * @param string $value Value * * @return boolean */ public function set($identifier, $value) { return $this->config->setValue($identifier, $value); }
/** * Save configuration to core_config_data table * * @return boolean */ public function saveConfig() { return $this->configTable->setValue('module_addthis', serialize($this->config)); }