Merge "ResourceLoaderImage: Allow shorthand syntax"
[lhc/web/wiklou.git] / tests / phpunit / includes / OutputPageTest.php
index 77a572d..6c6d95e 100644 (file)
@@ -172,7 +172,7 @@ mw.test.baz({token:123});mw.loader.state({"test.quux":"ready"});
                        array(
                                array( 'test.quux', ResourceLoaderModule::TYPE_COMBINED ),
                                '<script>if(window.mw){
-mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{"css":[".mw-icon{transition:none}\n"]},{},{});
+mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{"css":[".mw-icon{transition:none}\n"]});
 
 }</script>
 '
@@ -217,6 +217,11 @@ document.write("\u003Cscript src=\"http://127.0.0.1:8080/w/load.php?debug=false\
        /**
         * @dataProvider provideMakeResourceLoaderLink
         * @covers OutputPage::makeResourceLoaderLink
+        * @covers ResourceLoader::makeLoaderImplementScript
+        * @covers ResourceLoader::makeModuleResponse
+        * @covers ResourceLoader::makeInlineScript
+        * @covers ResourceLoader::makeLoaderStateScript
+        * @covers ResourceLoader::createLoaderURL
         */
        public function testMakeResourceLoaderLink( $args, $expectedHtml ) {
                $this->setMwGlobals( array(
@@ -234,6 +239,7 @@ document.write("\u003Cscript src=\"http://127.0.0.1:8080/w/load.php?debug=false\
                $ctx->setLanguage( 'en' );
                $out = new OutputPage( $ctx );
                $rl = $out->getResourceLoader();
+               $rl->setMessageBlobStore( new NullMessageBlobStore() );
                $rl->register( array(
                        'test.foo' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.foo( { a: true } );',
@@ -275,3 +281,26 @@ document.write("\u003Cscript src=\"http://127.0.0.1:8080/w/load.php?debug=false\
                $this->assertEquals( $expectedHtml, $actualHtml );
        }
 }
+
+/**
+ * MessageBlobStore that doesn't do anything
+ */
+class NullMessageBlobStore extends MessageBlobStore {
+       public function get ( ResourceLoader $resourceLoader, $modules, $lang ) {
+               return array();
+       }
+
+       public function insertMessageBlob ( $name, ResourceLoaderModule $module, $lang ) {
+               return false;
+       }
+
+       public function updateModule ( $name, ResourceLoaderModule $module, $lang ) {
+               return;
+       }
+
+       public function updateMessage ( $key ) {
+       }
+       public function clear() {
+       }
+}
+