From 19854b4e2852e927bf4aa7dd2a8592b8f15e19a6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 16 Jan 2012 13:56:18 +0000 Subject: [PATCH] enable MWDebug tests The first ones were failing because the test suite ran on gallium without MWDebug being initialized. This is now the case since r109033. The second part was failling because PHPUnit on gallium does not have the assertCount() method. Use a assertEquals() / count() workaround instead. Tests added by 108873 Reverts r108877 --- tests/phpunit/includes/debug/MWDebugTest.php | 24 +++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index e4d462ddd1..ffb1c7a58b 100644 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -17,9 +17,6 @@ class MWDebugTest extends MediaWikiTestCase { MWDebug::clearLog(); } - /** - * @group Broken - */ function testAddLog() { MWDebug::log( 'logging a string' ); $this->assertEquals( array( array( @@ -31,9 +28,6 @@ class MWDebugTest extends MediaWikiTestCase { ); } - /** - * @group Broken - */ function testAddWarning() { MWDebug::warning( 'Warning message' ); $this->assertEquals( array( array( @@ -45,24 +39,17 @@ class MWDebugTest extends MediaWikiTestCase { ); } - /** - * 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' ); @@ -70,8 +57,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" ); } -- 2.20.1