Phalcon\Test\Unit\Mvc\ViewTest::testMustacheMixedEngine PHP Method

testMustacheMixedEngine() public method

Tests the mix Mustache with PHP Engines
Since: 2012-08-17
Author: Andres Gutierrez ([email protected])
    public function testMustacheMixedEngine()
    {
        $this->specify('The Mustache Engine does not work as expected', function () {
            $view = new View();
            $view->setDI(Di::getDefault());
            $view->setViewsDir(PATH_DATA . 'views' . DIRECTORY_SEPARATOR);
            $view->registerEngines(['.mhtml' => MustacheEngine::class, '.phtml' => PhpEngine::class]);
            $view->setParamToView('name', 'Sonny');
            $view->start();
            $view->setRenderLevel(View::LEVEL_LAYOUT);
            $view->render('test6', 'index');
            $view->finish();
            expect($view->getContent())->equals('Well, this is the view content: Hello Sonny.');
        });
    }