From: Kunal Mehta Date: Sun, 24 Aug 2014 03:26:48 +0000 (-0700) Subject: Improve tests for OutputPage::makeResourceLoaderLink X-Git-Tag: 1.31.0-rc.0~14146^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=f32a59fadc514b2274e694981433c063d564fb3c;p=lhc%2Fweb%2Fwiklou.git Improve tests for OutputPage::makeResourceLoaderLink Change-Id: I0880c2b92bcf96ca1d25952d55464bbfb755ade0 --- diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 5c1994b4a8..b26968d58a 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -175,6 +175,24 @@ class OutputPageTest extends MediaWikiTestCase { array( array( 'test.foo', ResourceLoaderModule::TYPE_STYLES, true ), ' +', + ), + // Load no modules + array( + array( array(), ResourceLoaderModule::TYPE_COMBINED ), + '', + ), + // noscript group + array( + array( 'test.noscript', ResourceLoaderModule::TYPE_STYLES ), + ' +' + ), + // Load two modules in separate groups + array( + array( array( 'test.group.foo', 'test.group.bar' ), ResourceLoaderModule::TYPE_COMBINED ), + ' + ', ), ); @@ -218,6 +236,18 @@ class OutputPageTest extends MediaWikiTestCase { 'styles' => '/* pref-animate=off */ .mw-icon { transition: none; }', 'group' => 'private', )), + 'test.noscript' => new ResourceLoaderTestModule( array( + 'styles' => '.mw-test-noscript { content: "style"; }', + 'group' => 'noscript', + )), + 'test.group.bar' => new ResourceLoaderTestModule( array( + 'styles' => '.mw-group-bar { content: "style"; }', + 'group' => 'bar', + )), + 'test.group.foo' => new ResourceLoaderTestModule( array( + 'styles' => '.mw-group-foo { content: "style"; }', + 'group' => 'foo', + )), ) ); $links = $method->invokeArgs( $out, $args ); // Strip comments to avoid variation due to wgDBname in WikiID and cache key