Merge "Change php extract() to explicit code"
[lhc/web/wiklou.git] / tests / phpunit / includes / debug / MWDebugTest.php
index 9c2bc75..25cfd3c 100644 (file)
@@ -4,20 +4,20 @@ class MWDebugTest extends MediaWikiTestCase {
 
        protected function setUp() {
                parent::setUp();
-               // Make sure MWDebug class is enabled
-               static $MWDebugEnabled = false;
-               if ( !$MWDebugEnabled ) {
-                       MWDebug::init();
-                       $MWDebugEnabled = true;
-               }
                /** Clear log before each test */
                MWDebug::clearLog();
+       }
+
+       public static function setUpBeforeClass() {
+               parent::setUpBeforeClass();
+               MWDebug::init();
                MediaWiki\suppressWarnings();
        }
 
-       protected function tearDown() {
+       public static function tearDownAfterClass() {
+               parent::tearDownAfterClass();
+               MWDebug::deinit();
                MediaWiki\restoreWarnings();
-               parent::tearDown();
        }
 
        /**
@@ -110,7 +110,7 @@ class MWDebugTest extends MediaWikiTestCase {
                        $this->assertArrayHasKey( $expectedKey, $data['debuginfo'], "debuginfo has $expectedKey" );
                }
 
-               $xml = ApiFormatXml::recXmlPrint( 'help', $data );
+               $xml = ApiFormatXml::recXmlPrint( 'help', $data, null );
 
                // exception not thrown
                $this->assertInternalType( 'string', $xml );