mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Reformat. Fix pipe. Add more tests
This commit is contained in:
@@ -19,7 +19,7 @@ class AutoEscapeTest extends TestCase
|
||||
array('{$html}, {$html}', "$html, $html", $vars, 0),
|
||||
array('{$html}, {$html}', "$escaped, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{raw $html}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{raw $html}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{raw $html}, {$html}', "$html, $html", $vars, 0),
|
||||
array('{raw "{$html|up}"}, {$html}', strtoupper($html) . ", $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{$html}{/autoescape}, {$html}', "$escaped, $html", $vars, 0),
|
||||
array('{autoescape false}{$html}{/autoescape}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
@@ -29,34 +29,122 @@ class AutoEscapeTest extends TestCase
|
||||
array('{autoescape false}{raw $html}{/autoescape}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{raw $html}{/autoescape}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape false}{raw $html}{/autoescape}, {$html}', "$html, $html", $vars, 0),
|
||||
|
||||
// inline function
|
||||
array('{test_function text=$html}, {$html}', "$html, $html", $vars, 0),
|
||||
array('{test_function text=$html}, {$html}', "$escaped, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{test_function:raw text=$html}, {$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{test_function:raw text="{$html|up}"}, {$html}', strtoupper($html) . ", $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_function text=$html}{/autoescape}, {test_function text=$html}', "$escaped, $html", $vars, 0),
|
||||
array('{autoescape false}{test_function text=$html}{/autoescape}, {test_function text=$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_function text=$html}{/autoescape}, {test_function text=$html}', "$escaped, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape false}{test_function text=$html}{/autoescape}, {test_function text=$html}', "$html, $html", $vars, 0),
|
||||
array('{autoescape true}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}', "$html, $html", $vars, 0),
|
||||
array('{autoescape false}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape false}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}', "$html, $html", $vars, 0),
|
||||
|
||||
array(
|
||||
'{test_function:raw text="{$html|up}"}, {$html}',
|
||||
strtoupper($html) . ", $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_function text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$escaped, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_function text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_function text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$escaped, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_function text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_function:raw text=$html}{/autoescape}, {test_function text=$html}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
// block function
|
||||
array('{test_block_function}{$html}{/test_block_function}', $html, $vars, 0),
|
||||
array('{test_block_function}{$html}{/test_block_function}', $escaped, $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{test_block_function:raw}{$html}{/test_block_function}', $html, $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{test_block_function:raw}{"{$html|up}"}{/test_block_function}', strtoupper($html), $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$escaped, $html", $vars, 0),
|
||||
array('{autoescape false}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$escaped, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape false}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$html, $html", $vars, 0),
|
||||
array('{autoescape true}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$html, $html", $vars, 0),
|
||||
array('{autoescape false}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}', "$html, $escaped", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function:raw}{$html}{/test_block_function}', "$escaped, $html", $vars, \Fenom::AUTO_ESCAPE),
|
||||
array('{autoescape true}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function:raw}{$html}{/test_block_function}', "$html, $html", $vars, 0),
|
||||
array(
|
||||
'{test_block_function:raw}{"{$html|up}"}{/test_block_function}',
|
||||
strtoupper($html),
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$escaped, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$html, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$escaped, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
array(
|
||||
'{autoescape false}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function}{$html}{/test_block_function}',
|
||||
"$html, $escaped",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_block_function}{$html}{/test_block_function}{/autoescape}, {test_block_function:raw}{$html}{/test_block_function}',
|
||||
"$escaped, $html",
|
||||
$vars,
|
||||
\Fenom::AUTO_ESCAPE
|
||||
),
|
||||
array(
|
||||
'{autoescape true}{test_block_function:raw}{$html}{/test_block_function}{/autoescape}, {test_block_function:raw}{$html}{/test_block_function}',
|
||||
"$html, $html",
|
||||
$vars,
|
||||
0
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user