From f32a59fadc514b2274e694981433c063d564fb3c Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 23 Aug 2014 20:26:48 -0700 Subject: [PATCH] Improve tests for OutputPage::makeResourceLoaderLink Change-Id: I0880c2b92bcf96ca1d25952d55464bbfb755ade0 --- tests/phpunit/includes/OutputPageTest.php | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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 -- 2.20.1