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

testTwigMixedEnginePartials() public method

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