Phalcon\Test\Unit\Mvc\ViewTest::testLayoutAndPick PHP 메소드

testLayoutAndPick() 공개 메소드

Test using different layout and pick
부터: 2013-01-07
저자: Andres Gutierrez ([email protected])
public testLayoutAndPick ( )
    public function testLayoutAndPick()
    {
        $this->specify('Using different layout and pick does not work as expected', function () {
            $view = new View();
            $view->setDI(Di::getDefault());
            $view->setViewsDir(PATH_DATA . 'views' . DIRECTORY_SEPARATOR);
            $view->start();
            $view->setLayout('test6');
            $view->pick('test3/other');
            $view->render('test3', 'another');
            $view->finish();
            expect($view->getContent())->equals("<html>Well, this is the view content: here.</html>\n");
            $view->start();
            $view->setLayout('test6');
            $view->pick(['test3/other']);
            $view->render('test3', 'another');
            $view->finish();
            expect($view->getContent())->equals("<html>Well, this is the view content: here.</html>\n");
        });
    }