Show confirmation prompt on rollback links
[lhc/web/wiklou.git] / tests / phpunit / includes / ContentSecurityPolicyTest.php
index 250d49d..5f0200d 100644 (file)
@@ -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 );
        }