/**
* @dataProvider provideExtractResourceLoaderModules
*/
- public function testExtractResourceLoaderModules( $input, $expected ) {
+ public function testExtractResourceLoaderModules(
+ $input,
+ array $expectedGlobals,
+ array $expectedAttribs = []
+ ) {
$processor = new ExtensionProcessor();
$processor->extractInfo( $this->dir, $input + self::$default, 1 );
$out = $processor->getExtractedInfo();
- foreach ( $expected as $key => $value ) {
+ foreach ( $expectedGlobals as $key => $value ) {
$this->assertEquals( $value, $out['globals'][$key] );
}
+ foreach ( $expectedAttribs as $key => $value ) {
+ $this->assertEquals( $value, $out['attributes'][$key] );
+ }
}
public static function provideExtractResourceLoaderModules() {
],
],
],
+ 'QUnit test module' => [
+ // Input
+ [
+ 'QUnitTestModule' => [
+ 'localBasePath' => '',
+ 'remoteExtPath' => 'Foo',
+ 'scripts' => 'bar.js',
+ ],
+ ],
+ // Expected
+ [],
+ [
+ 'QUnitTestModules' => [
+ 'test.FooBar' => [
+ 'localBasePath' => $dir,
+ 'remoteExtPath' => 'Foo',
+ 'scripts' => 'bar.js',
+ ],
+ ],
+ ],
+ ],
];
}
$info = self::$default + [
'requires' => [
'MediaWiki' => '>= 1.25.0',
+ 'platform' => [
+ 'php' => '>= 5.5.9'
+ ],
'extensions' => [
'Bar' => '*'
]