r109034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109033‎ | r109034 | r109035 >
Date:13:56, 16 January 2012
Author:hashar
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/debug/MWDebugTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/debug/MWDebugTest.php
@@ -17,9 +17,6 @@
1818 MWDebug::clearLog();
1919 }
2020
21 - /**
22 - * @group Broken
23 - */
2421 function testAddLog() {
2522 MWDebug::log( 'logging a string' );
2623 $this->assertEquals( array( array(
@@ -31,9 +28,6 @@
3229 );
3330 }
3431
35 - /**
36 - * @group Broken
37 - */
3832 function testAddWarning() {
3933 MWDebug::warning( 'Warning message' );
4034 $this->assertEquals( array( array(
@@ -45,24 +39,17 @@
4640 );
4741 }
4842
49 - /**
50 - * Broken on gallium which use an old PHPUnit version
51 - * @group Broken
52 - */
5343 function testAvoidDuplicateDeprecations() {
5444 MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
5545 MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
5646
57 - $this->assertCount( 1,
58 - MWDebug::getLog(),
 47+ // assertCount() not available on WMF integration server
 48+ $this->assertEquals( 1,
 49+ count( MWDebug::getLog() ),
5950 "Only one deprecated warning per function should be kept"
6051 );
6152 }
6253
63 - /**
64 - * Broken on gallium which use an old PHPUnit version
65 - * @group Broken
66 - */
6754 function testAvoidNonConsecutivesDuplicateDeprecations() {
6855 MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
6956 MWDebug::warning( 'some warning' );
@@ -70,8 +57,9 @@
7158 // Another deprecation
7259 MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
7360
74 - $this->assertCount( 3,
75 - MWDebug::getLog(),
 61+ // assertCount() not available on WMF integration server
 62+ $this->assertEquals( 3,
 63+ count( MWDebug::getLog() ),
7664 "Only one deprecated warning per function should be kept"
7765 );
7866 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108877Disable MWDebug tests for now...hashar23:26, 13 January 2012
r109033test with MWDebug enabled (made possible by r109032)hashar13:50, 16 January 2012

Status & tagging log