From 4391b608548c5af91f1e93a49246598dbd585c56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Fri, 11 Jul 2014 16:35:14 +0200 Subject: [PATCH] Make OutputPageTest more independent from global state This does not fix all problems (the "combined" test still fails horribly on my machine for a reason I don't understand). However, this patch fixes at least two of the problems: Make the test independent from the wgResourceLoaderDebug setting. Make the test independent from the wgLanguageCode setting. Change-Id: I3aa52fed530d852b34b6058e29620749e11092a0 --- tests/phpunit/includes/OutputPageTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 542b3d6630..5fee505361 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -175,13 +175,13 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{" ); } - /** * @dataProvider provideMakeResourceLoaderLink * @covers OutputPage::makeResourceLoaderLink */ public function testMakeResourceLoaderLink( $args, $expectedHtml) { $this->setMwGlobals( array( + 'wgResourceLoaderDebug' => false, 'wgResourceLoaderUseESI' => true, 'wgLoadScript' => 'http://127.0.0.1:8080/w/load.php', // Affects whether CDATA is inserted @@ -195,6 +195,7 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{" $method = $class->getMethod( 'makeResourceLoaderLink' ); $method->setAccessible( true ); $ctx = new RequestContext(); + $ctx->setLanguage( 'en' ); $out = new OutputPage( $ctx ); $rl = $out->getResourceLoader(); $rl->register( array( -- 2.20.1