Merge "Add ability to filter based on rc_title in API"
[lhc/web/wiklou.git] / tests / phpunit / includes / resourceloader / ResourceLoaderTest.php
index e811d87..95006aa 100644 (file)
@@ -8,9 +8,7 @@ class ResourceLoaderTest extends ResourceLoaderTestCase {
                parent::setUp();
 
                $this->setMwGlobals( [
-                       'wgResourceLoaderLESSImportPaths' => [
-                               dirname( dirname( __DIR__ ) ) . '/data/less/common',
-                       ],
+                       'wgResourceLoaderLESSImportPaths' => [],
                        'wgResourceLoaderLESSVars' => [
                                'foo'  => '2px',
                                'Foo' => '#eeeeee',
@@ -264,6 +262,20 @@ class ResourceLoaderTest extends ResourceLoaderTestCase {
                $this->assertStringEqualsFile( $basePath . '/styles.css', $styles['all'] );
        }
 
+       /**
+        * @covers ResourceLoader::getLessCompiler
+        */
+       public function testLessImportDirs() {
+               $rl = new EmptyResourceLoader();
+               $lc = $rl->getLessCompiler();
+               $basePath = dirname( dirname( __DIR__ ) ) . '/data/less';
+               $lc->SetImportDirs( [
+                        "$basePath/common" => '',
+               ] );
+               $css = $lc->parseFile( "$basePath/module/use-import-dir.less" )->getCss();
+               $this->assertStringEqualsFile( "$basePath/module/styles.css", $css );
+       }
+
        public static function providePackedModules() {
                return [
                        [