From: Thiemo Mättig Date: Fri, 11 Jul 2014 14:35:14 +0000 (+0200) Subject: Make OutputPageTest more independent from global state X-Git-Tag: 1.31.0-rc.0~14965^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=4391b608548c5af91f1e93a49246598dbd585c56;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(