OutputPageTest should be independent of $wgResourceLoaderDebug setting
authorC. Scott Ananian <cscott@cscott.net>
Tue, 25 Sep 2018 14:31:57 +0000 (10:31 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Tue, 25 Sep 2018 16:56:40 +0000 (12:56 -0400)
`OutputPageTest::testMakeResourceLoaderLink()` and
`OutputPageTest::testBuildExemptModules()` tried to force
`$wgResourceLoaderDebug=false` before running the test, but they
neglected to clear the resource loader debug cache
(`ResourceLoader::clearCache()`) so the user's local setting of
`$wgResourceLoaderDebug` would be used despite it all.

Change-Id: I3e7dec762c8a02683fc66a630c950b72a4840a9b

tests/phpunit/includes/OutputPageTest.php

index d334b73..d48da70 100644 (file)
@@ -12,6 +12,16 @@ class OutputPageTest extends MediaWikiTestCase {
        const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
        const SCREEN_ONLY_MEDIA_QUERY = 'only screen and (min-width: 982px)';
 
+       // Ensure that we don't affect the global ResourceLoader state.
+       protected function setUp() {
+               parent::setUp();
+               ResourceLoader::clearCache();
+       }
+       protected function tearDown() {
+               parent::tearDown();
+               ResourceLoader::clearCache();
+       }
+
        /**
         * @dataProvider provideRedirect
         *