Merge "(bug 22750) <logitem> is at wrong location in export.xsd"
[lhc/web/wiklou.git] / tests / phpunit / includes / debug / MWDebugTest.php
index a2bbb27..1627c47 100644 (file)
@@ -2,14 +2,18 @@
 
 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();
        }
 
-       /**
-        * @group Broken
-        */
        function testAddLog() {
                MWDebug::log( 'logging a string' );
                $this->assertEquals( array( array(
@@ -21,38 +25,28 @@ class MWDebugTest extends MediaWikiTestCase {
                );
        }
 
-       /**
-        * @group Broken
-        */
        function testAddWarning() {
                MWDebug::warning( 'Warning message' );
                $this->assertEquals( array( array(
                        'msg' => 'Warning message',
                        'type' => 'warn',
-                       'caller' => 'MWDebug::warning',
+                       'caller' => 'MWDebugTest::testAddWarning',
                        ) ),
                        MWDebug::getLog()
                );
        }
 
-       /**
-        * Broken on gallium which use an old PHPUnit version
-        * @group Broken
-        */
        function testAvoidDuplicateDeprecations() {
                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"
                );
        }
 
-       /**
-        * Broken on gallium which use an old PHPUnit version
-        * @group Broken
-        */
        function testAvoidNonConsecutivesDuplicateDeprecations() {
                MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
                MWDebug::warning( 'some warning' );
@@ -60,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"
                );
        }