| Línea 126... |
Línea 126... |
| 126 |
* @dataProvider get_strip_disallowed_helpers_testcases()
|
126 |
* @dataProvider get_strip_disallowed_helpers_testcases()
|
| 127 |
* @param string[] $disallowed The list of helpers to strip
|
127 |
* @param string[] $disallowed The list of helpers to strip
|
| 128 |
* @param string $input The input string for the helper
|
128 |
* @param string $input The input string for the helper
|
| 129 |
* @param string $expected The expected output of the string after disallowed strip
|
129 |
* @param string $expected The expected output of the string after disallowed strip
|
| 130 |
*/
|
130 |
*/
|
| 131 |
public function test_strip_disallowed_helpers($disallowed, $input, $expected) {
|
131 |
public function test_strip_disallowed_helpers($disallowed, $input, $expected): void {
|
| 132 |
$collection = new mustache_helper_collection(null, $disallowed);
|
132 |
$collection = new mustache_helper_collection(null, $disallowed);
|
| 133 |
$this->assertEquals($expected, $collection->strip_disallowed_helpers($disallowed, $input));
|
133 |
$this->assertEquals($expected, $collection->strip_disallowed_helpers($disallowed, $input));
|
| 134 |
}
|
134 |
}
|
| Línea 135... |
Línea 135... |
| 135 |
|
135 |
|
| Línea 138... |
Línea 138... |
| 138 |
* helpers.
|
138 |
* helpers.
|
| 139 |
*
|
139 |
*
|
| 140 |
* Any allowed helper should still be available to call during the
|
140 |
* Any allowed helper should still be available to call during the
|
| 141 |
* execution of a helper.
|
141 |
* execution of a helper.
|
| 142 |
*/
|
142 |
*/
|
| 143 |
public function test_disallowed_helpers_disabled_during_execution() {
|
143 |
public function test_disallowed_helpers_disabled_during_execution(): void {
|
| 144 |
$engine = new \Mustache_Engine();
|
144 |
$engine = new \Mustache_Engine();
|
| 145 |
$context = new \Mustache_Context();
|
145 |
$context = new \Mustache_Context();
|
| 146 |
$lambdahelper = new \Mustache_LambdaHelper($engine, $context);
|
146 |
$lambdahelper = new \Mustache_LambdaHelper($engine, $context);
|
| 147 |
$disallowed = ['bad'];
|
147 |
$disallowed = ['bad'];
|
| 148 |
$collection = new mustache_helper_collection(null, $disallowed);
|
148 |
$collection = new mustache_helper_collection(null, $disallowed);
|