Move tests into separate ResourceLoaderFileModuleTest
authorKunal Mehta <legoktm@gmail.com>
Wed, 22 Oct 2014 05:32:13 +0000 (22:32 -0700)
committerLegoktm <legoktm.wikipedia@gmail.com>
Wed, 22 Oct 2014 17:16:47 +0000 (17:16 +0000)
Change-Id: I2504867850b7e6bda2afb8c4fedbe6b8819bc15b

tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php [new file with mode: 0644]
tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php

diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
new file mode 100644 (file)
index 0000000..fb436ee
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+
+class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
+
+       protected function setUp() {
+               parent::setUp();
+
+               // The return value of the closure shouldn't matter since this test should
+               // never call it
+               SkinFactory::getDefaultInstance()->register(
+                       'fakeskin',
+                       'FakeSkin',
+                       function () {
+                       }
+               );
+       }
+
+       /**
+        * @covers ResourceLoaderFileModule::getAllSkinStyleFiles
+        */
+       public function testGetAllSkinStyleFiles() {
+               $baseParams = array(
+                       'scripts' => array(
+                               'foo.js',
+                               'bar.js',
+                       ),
+                       'styles' => array(
+                               'foo.css',
+                               'bar.css' => array( 'media' => 'print' ),
+                               'screen.less' => array( 'media' => 'screen' ),
+                               'screen-query.css' => array( 'media' => 'screen and (min-width: 400px)' ),
+                       ),
+                       'skinStyles' => array(
+                               'default' => 'quux-fallback.less',
+                               'fakeskin' => array(
+                                       'baz-vector.css',
+                                       'quux-vector.less',
+                               ),
+                       ),
+                       'messages' => array(
+                               'hello',
+                               'world',
+                       ),
+               );
+
+               $module = new ResourceLoaderFileModule( $baseParams );
+
+               $this->assertEquals(
+                       array(
+                               'foo.css',
+                               'baz-vector.css',
+                               'quux-vector.less',
+                               'quux-fallback.less',
+                               'bar.css',
+                               'screen.less',
+                               'screen-query.css',
+                       ),
+                       array_map( 'basename', $module->getAllStyleFiles() )
+               );
+       }
+}
index b0edaaf..b25e9b0 100644 (file)
@@ -2,65 +2,6 @@
 
 class ResourceLoaderModuleTest extends ResourceLoaderTestCase {
 
-       protected function setUp() {
-               parent::setUp();
-
-               // The return value of the closure shouldn't matter since this test should
-               // never call it
-               SkinFactory::getDefaultInstance()->register(
-                       'fakeskin',
-                       'FakeSkin',
-                       function () {
-                       }
-               );
-       }
-
-       /**
-        * @covers ResourceLoaderFileModule::getAllSkinStyleFiles
-        */
-       public function testGetAllSkinStyleFiles() {
-               $context = self::getResourceLoaderContext();
-
-               $baseParams = array(
-                       'scripts' => array(
-                               'foo.js',
-                               'bar.js',
-                       ),
-                       'styles' => array(
-                               'foo.css',
-                               'bar.css' => array( 'media' => 'print' ),
-                               'screen.less' => array( 'media' => 'screen' ),
-                               'screen-query.css' => array( 'media' => 'screen and (min-width: 400px)' ),
-                       ),
-                       'skinStyles' => array(
-                               'default' => 'quux-fallback.less',
-                               'fakeskin' => array(
-                                       'baz-vector.css',
-                                       'quux-vector.less',
-                               ),
-                       ),
-                       'messages' => array(
-                               'hello',
-                               'world',
-                       ),
-               );
-
-               $module = new ResourceLoaderFileModule( $baseParams );
-
-               $this->assertEquals(
-                       array(
-                               'foo.css',
-                               'baz-vector.css',
-                               'quux-vector.less',
-                               'quux-fallback.less',
-                               'bar.css',
-                               'screen.less',
-                               'screen-query.css',
-                       ),
-                       array_map( 'basename', $module->getAllStyleFiles() )
-               );
-       }
-
        /**
         * @covers ResourceLoaderModule::getDefinitionSummary
         * @covers ResourceLoaderFileModule::getDefinitionSummary