Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / tests / phpunit / includes / ContentSecurityPolicyTest.php
index 250d49d..a758f99 100644 (file)
@@ -37,7 +37,7 @@ class ContentSecurityPolicyTest extends MediaWikiTestCase {
                // Note, there are some obscure globals which
                // could affect the results which aren't included above.
 
-               RepoGroup::destroySingleton();
+               $this->overrideMwServices();
                $context = RequestContext::getMain();
                $resp = $context->getRequest()->response();
                $conf = $context->getConfig();
@@ -273,13 +273,9 @@ class ContentSecurityPolicyTest extends MediaWikiTestCase {
         * @covers ContentSecurityPolicy::isNonceRequired
         */
        public function testCSPIsEnabled( $main, $reportOnly, $expected ) {
-               global $wgCSPReportOnlyHeader, $wgCSPHeader;
-               global $wgCSPHeader;
-               $oldReport = wfSetVar( $wgCSPReportOnlyHeader, $reportOnly );
-               $oldMain = wfSetVar( $wgCSPHeader, $main );
+               $this->setMwGlobals( 'wgCSPReportOnlyHeader', $reportOnly );
+               $this->setMwGlobals( 'wgCSPHeader', $main );
                $res = ContentSecurityPolicy::isNonceRequired( RequestContext::getMain()->getConfig() );
-               wfSetVar( $wgCSPReportOnlyHeader, $oldReport );
-               wfSetVar( $wgCSPHeader, $oldMain );
                $this->assertEquals( $res, $expected );
        }