Phalcon\Test\Unit\Mvc\ViewTest::testMustacheMixedEnginePartials PHP Метод

testMustacheMixedEnginePartials() публичный Метод

Tests using partials with the mix Mustache with PHP Engines
С версии: 2012-08-17
Автор: Andres Gutierrez ([email protected])
    public function testMustacheMixedEnginePartials()
    {
        $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', 'info');
            $view->finish();
            expect($view->getContent())->equals('Well, this is the view content: Hello Sonny.');
        });
    }