false,
'UnexpectedValueException'
],
+ [
+ "\000../foobar",
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
+ [
+ '/',
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
+ [
+ // Allegedly this can strip ext in windows.
+ 'baz<',
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
+ [
+ '\\foo',
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
+ [
+ 'C:\bar',
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
+ [
+ "foo\000bar",
+ [],
+ false,
+ 'UnexpectedValueException'
+ ],
[
'nonexistenttemplate',
[],
],
];
}
+
+ public function testEnableRecursivePartials() {
+ $tp = new TemplateParser( $this->templateDir );
+ $data = [ 'r' => [ 'r' => [ 'r' => [] ] ] ];
+
+ $tp->enableRecursivePartials( true );
+ $this->assertEquals( 'rrr', $tp->processTemplate( 'recurse', $data ) );
+
+ $tp->enableRecursivePartials( false );
+ $this->setExpectedException( 'Exception' );
+ $tp->processTemplate( 'recurse', $data );
+ }
+
}