fenom/tests/cases/Fenom/CommentTest.php
Sergey Beresnev 748ef29a1d Refactoring Fenom\Template::compile: Removed goto, $from
Fixed issues with templates
    '{if 0}none{/if} literal: {  $a}{$a}{  $a} end'
    '{* '
2013-07-08 12:43:20 +09:00

31 lines
853 B
PHP

<?php
namespace Fenom;
class CommentTest extends TestCase {
/**
* @dataProvider providerScalars
*/
public function testInline($tpl_val) {
$this->assertRender("before {* $tpl_val *} after", "before after");
$this->assertRender("before {* {{$tpl_val}} {{$tpl_val}} *} after", "before after");
$this->assertRender("before {*{{$tpl_val}}*} after", "before after");
}
public function testError() {
$this->execError('{* ', 'Fenom\CompileException', "Unclosed comment block in line");
}
/**
* @dataProvider providerScalars
*/
public function testMultiLine($tpl_val) {
$this->assertRender(
"before-1\nbefore-2 {* before-3\nbefore-4 $tpl_val after-1\nafter-2 *} after-3\nafter-4{* dummy *}\nafter-5",
"before-1\nbefore-2 after-3\nafter-4\nafter-5"
);
}
}