Phalcon\Test\Unit\Mvc\View\Engine\Volt\CompilerTest::testVoltCompilerImportRecursiveFile PHP Метод

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

    public function testVoltCompilerImportRecursiveFile()
    {
        $this->specify("Volt files can't recursively import files", function () {
            @unlink(PATH_DATA . 'views/partials/header3.volt.php');
            @unlink(PATH_DATA . 'views/partials/header2.volt.php');
            @unlink(PATH_DATA . 'views/test10/import2.volt.php');
            $view = new View();
            $view->setViewsDir(PATH_DATA . 'views/');
            $volt = new Compiler($view);
            //extends
            $volt->compileFile(PATH_DATA . 'views/test10/import2.volt', PATH_DATA . 'views/test10/import2.volt.php');
            $compilation = file_get_contents(PATH_DATA . 'views/test10/import2.volt.php');
            expect($compilation)->equals('<div class="header"><h1>This is the title</h1></div>');
        });
    }