Selenium: replace UserLoginPage with BlankPage where possible
[lhc/web/wiklou.git] / tests / phpunit / includes / registration / ExtensionProcessorTest.php
index 71a3a4f..d5a2b3a 100644 (file)
@@ -357,13 +357,20 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
        /**
         * @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() {
@@ -503,6 +510,27 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
                                        ],
                                ],
                        ],
+                       'QUnit test module' => [
+                               // Input
+                               [
+                                       'QUnitTestModule' => [
+                                               'localBasePath' => '',
+                                               'remoteExtPath' => 'Foo',
+                                               'scripts' => 'bar.js',
+                                       ],
+                               ],
+                               // Expected
+                               [],
+                               [
+                                       'QUnitTestModules' => [
+                                               'test.FooBar' => [
+                                                       'localBasePath' => $dir,
+                                                       'remoteExtPath' => 'Foo',
+                                                       'scripts' => 'bar.js',
+                                               ],
+                                       ],
+                               ],
+                       ],
                ];
        }