lithium\tests\cases\template\view\CompilerTest::testTemplateContentRewriting PHP Метод

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

    public function testTemplateContentRewriting()
    {
        $template = Compiler::template("{$this->_path}/{$this->_file}");
        $this->assertFileExists($template);
        $expected = array("<?php echo 'this is unescaped content'; ?" . ">", "<?php echo \$h('this is escaped content'); ?" . ">", "<?php echo \$h(\$alsoEscaped); ?" . ">", "<?php echo \$this->escape('this is also escaped content'); ?" . ">", '<?php echo $this->escape(', "'this, too, is escaped content'", '); ?>', "<?php echo \$h('This is", 'escaped content', 'that breaks over', 'several lines', "'); ?>", "<?php echo \$h('This is pre-escaped content'); ?>");
        $result = array_map('trim', explode("\n", trim(file_get_contents($template))));
        $this->assertEqual($expected, $result);
    }