Пример #1
0
 protected function tearDown()
 {
     $dir = $this->templateHelper->getActiveMailTemplate()->getAbsolutePath();
     ConfigQuery::write('active-mail-template', $this->backup_mail_template);
     $fs = new Filesystem();
     $fs->remove($dir);
 }
Пример #2
0
 /**
  * Check that views for the front routes exists.
  */
 public function testTargetFrontViewsExists()
 {
     /** @var Request $request */
     $request = $this->getContainer()->get('request');
     /** @var EventDispatcherInterface $eventDispatcher */
     $eventDispatcher = $this->getContainer()->get('event_dispatcher');
     // we are not going to do any actual rendering, so a mock ParserContext should be enough
     /** @var ParserContext $parserContext */
     $parserContext = $this->getMockBuilder('Thelia\\Core\\Template\\ParserContext')->disableOriginalConstructor()->getMock();
     $templateHelper = new TheliaTemplateHelper();
     $parser = new SmartyParser($request, $eventDispatcher, $parserContext, $templateHelper);
     $parser->setTemplateDefinition($templateHelper->getActiveFrontTemplate());
     $frontRouterFileLoader = $this->routerFileLoaders[static::$routingFilesPathFront];
     foreach (static::$routingFiles[static::$routingFilesPathFront] as $fileName) {
         $router = new Router($frontRouterFileLoader, $fileName);
         /** @var Route $route */
         foreach ($router->getRouteCollection() as $route) {
             if (null === ($view = $route->getDefault('_view'))) {
                 continue;
             }
             $this->assertTrue($parser->templateExists($view . '.html'), "Front view '{$view}' does not exist.");
         }
     }
 }
 public function getActiveFrontTemplate()
 {
     return parent::getActiveFrontTemplate();
     // TODO: Change the autogenerated stub
 }