protected function setUp()
 {
     $this->dispatcher = $this->getMock('\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $this->logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     DataLogger::init($this->logger);
     Dispatcher::setDispatcher($this->dispatcher);
 }
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Logger does not support the bar method.
  */
 public function testEventAborted()
 {
     $message = 'foo';
     $method = 'bar';
     $this->dataLogger->expects($this->never())->method($method);
     DataLogger::init($this->dataLogger);
     DataLogger::log($message, $method);
 }
 private function boot()
 {
     BlockFactory::boot($this->app["red_kite_cms.configuration_handler"]);
     Dispatcher::setDispatcher($this->app["dispatcher"]);
     DataLogger::init($this->app["monolog"]);
     Translator::setTranslator($this->app["translator"]);
     $this->app["red_kite_cms.plugin_manager"]->boot();
     $theme = $this->app["red_kite_cms.plugin_manager"]->getActiveTheme();
     $this->app["red_kite_cms.theme"]->boot($theme);
     $this->app["red_kite_cms.theme_generator"]->boot($theme);
     $this->app["red_kite_cms.slots_generator"]->boot($theme);
     $this->app["red_kite_cms.theme_aligner"]->boot($theme);
     $siteIncompleteFile = $this->app["red_kite_cms.root_dir"] . '/app/data/' . $this->siteName . '/incomplete.json';
     if (file_exists($siteIncompleteFile)) {
         $this->createWebsitePages($theme);
         unlink($siteIncompleteFile);
     }
     $this->app["dispatcher"]->dispatch(CmsEvents::CMS_BOOTING, new CmsBootingEvent($this->app["red_kite_cms.configuration_handler"]));
     $this->app["red_kite_cms.template_assets"]->boot();
     $this->app["red_kite_cms.assetic"]->addFilter('cssrewrite', new CssRewriteFilter());
 }