Merge "(bug 22750) <logitem> is at wrong location in export.xsd"
[lhc/web/wiklou.git] / tests / phpunit / includes / debug / MWDebugTest.php
index e36e42f..1627c47 100644 (file)
@@ -2,7 +2,14 @@
 
 class MWDebugTest extends MediaWikiTestCase {
 
-       function tearDown() {
+
+       function setUp() {
+               // Make sure MWDebug class is enabled
+               static $MWDebugEnabled = false;
+               if( !$MWDebugEnabled ) {
+                       MWDebug::init();
+                       $MWDebugEnabled = true;
+               }
                /** Clear log before each test */
                MWDebug::clearLog();
        }
@@ -23,7 +30,7 @@ class MWDebugTest extends MediaWikiTestCase {
                $this->assertEquals( array( array(
                        'msg' => 'Warning message',
                        'type' => 'warn',
-                       'caller' => 'MWDebug::warning',
+                       'caller' => 'MWDebugTest::testAddWarning',
                        ) ),
                        MWDebug::getLog()
                );
@@ -33,8 +40,9 @@ class MWDebugTest extends MediaWikiTestCase {
                MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
                MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
 
-               $this->assertCount( 1,
-                       MWDebug::getLog(),
+               // assertCount() not available on WMF integration server
+               $this->assertEquals( 1,
+                       count( MWDebug::getLog() ),
                        "Only one deprecated warning per function should be kept"
                );
        }
@@ -46,8 +54,9 @@ class MWDebugTest extends MediaWikiTestCase {
                // Another deprecation
                MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
 
-               $this->assertCount( 3,
-                       MWDebug::getLog(),
+               // assertCount() not available on WMF integration server
+               $this->assertEquals( 3,
+                       count( MWDebug::getLog() ),
                        "Only one deprecated warning per function should be kept"
                );
        }