mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add STRIP option
This commit is contained in:
@@ -185,7 +185,7 @@ class TemplateTest extends TestCase
|
||||
'Mod: {$lorem|str_rot13}!',
|
||||
'Fenom\Error\CompileException',
|
||||
"Modifier str_rot13 not found",
|
||||
Fenom::DENY_INLINE_FUNCS
|
||||
Fenom::DENY_NATIVE_FUNCS
|
||||
),
|
||||
array('Mod: {$lorem|my_encode}!', 'Fenom\Error\CompileException', "Modifier my_encode not found"),
|
||||
array('Mod: {$lorem|truncate:}!', 'Fenom\Error\CompileException', "Unexpected end of expression"),
|
||||
|
||||
@@ -13,7 +13,8 @@ class FenomTest extends \Fenom\TestCase
|
||||
array("auto_reload", Fenom::AUTO_RELOAD),
|
||||
array("force_include", Fenom::FORCE_INCLUDE),
|
||||
array("auto_escape", Fenom::AUTO_ESCAPE),
|
||||
array("force_verify", Fenom::FORCE_VERIFY)
|
||||
array("force_verify", Fenom::FORCE_VERIFY),
|
||||
array("strip", Fenom::AUTO_STRIP),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -289,6 +290,19 @@ class FenomTest extends \Fenom\TestCase
|
||||
);
|
||||
$this->assertSame(3, $iteration);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group strip
|
||||
*/
|
||||
public function testStrip() {
|
||||
$this->fenom->setOptions(Fenom::AUTO_STRIP);
|
||||
$tpl = <<<TPL
|
||||
<div class="item item-one">
|
||||
<a href="/item/{\$one}">number {\$num.1}</a>
|
||||
</div>
|
||||
TPL;
|
||||
$this->assertRender($tpl, '<div class="item item-one"><a href="/item/1">number one</a></div>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user