コード例 #1
0
ファイル: SimpleTest.php プロジェクト: phalcon/cphalcon
 /**
  * Tests the Simple::getRegisteredEngines
  *
  * @author Kamil Skowron <*****@*****.**>
  * @since  2014-05-28
  */
 public function testGetRegisteredEngines()
 {
     $this->specify('Unable to get all registered engines', function () {
         $expected = ['.mhtml' => MustacheEngine::class, '.phtml' => PhpEngine::class, '.twig' => TwigEngine::class, '.volt' => VoltEngine::class];
         $view = new Simple();
         $view->setViewsDir(PATH_DATA . 'views' . DIRECTORY_SEPARATOR);
         $view->registerEngines($expected);
         expect($view->getRegisteredEngines())->equals($expected);
     });
 }
コード例 #2
0
ファイル: ViewSimpleTest.php プロジェクト: lisong/cphalcon
 public function testGetRegisteredEngines()
 {
     $expected = array('.mhtml' => 'My_Mustache_Engine', '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php', '.twig' => 'My_Twig_Engine', '.volt' => 'Phalcon\\Mvc\\View\\Engine\\Volt');
     $di = new Phalcon\DI();
     $view = new Phalcon\Mvc\View\Simple();
     $view->setDI($di);
     $view->setViewsDir('unit-tests/views/');
     $view->registerEngines($expected);
     $this->assertEquals($expected, $view->getRegisteredEngines());
 }