protected function setUp() {
parent::setUp();
- $this->setMwGlobals( array(
+ $this->setMwGlobals( [
'wgSecretKey' => 'foo',
- ) );
+ ] );
$this->templateDir = dirname( __DIR__ ) . '/data/templates/';
}
}
public static function provideProcessTemplate() {
- return array(
- array(
+ return [
+ [
'foobar',
- array(),
+ [],
"hello world!\n"
- ),
- array(
+ ],
+ [
'foobar_args',
- array(
+ [
'planet' => 'world',
- ),
+ ],
"hello world!\n",
- ),
- array(
+ ],
+ [
'../foobar',
- array(),
+ [],
false,
'UnexpectedValueException'
- ),
- array(
+ ],
+ [
+ "\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',
- array(),
+ [],
false,
'RuntimeException',
- ),
- array(
+ ],
+ [
'has_partial',
- array(
+ [
'planet' => 'world',
- ),
+ ],
"Partial hello world!\n in here\n",
- ),
- array(
+ ],
+ [
'bad_partial',
- array(),
+ [],
false,
'Exception',
- ),
- );
+ ],
+ ];
}
}