Merge "Add release notes for protect log changes"
[lhc/web/wiklou.git] / tests / phpunit / structure / ResourcesTest.php
index 69f4525..23afabd 100644 (file)
@@ -118,6 +118,22 @@ class ResourcesTest extends MediaWikiTestCase {
                }
        }
 
+       /**
+        * CSSMin::getAllLocalFileReferences should ignore url(...) expressions
+        * that have been commented out.
+        */
+       public function testCommentedLocalFileReferences() {
+               $basepath = __DIR__ . '/../data/css/';
+               $css = file_get_contents( $basepath . 'comments.css' );
+               $files = CSSMin::getAllLocalFileReferences( $css, $basepath );
+               $expected = array( $basepath . 'not-commented.gif' );
+               $this->assertArrayEquals(
+                       $expected,
+                       $files,
+                       'Url(...) expression in comment should be omitted.'
+               );
+       }
+
        /**
         * Get all registered modules from ResouceLoader.
         * @return array
@@ -182,7 +198,7 @@ class ResourcesTest extends MediaWikiTestCase {
                                                        $media,
                                                        $file,
                                                        // XXX: Wrapped in an object to keep it out of PHPUnit output
-                                                       (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ),
+                                                       (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip, $data['context'] ) ),
                                                );
                                        }
                                }