diff options
Diffstat (limited to 'tests/phpunit/includes/debug/MWDebugTest.php')
-rw-r--r-- | tests/phpunit/includes/debug/MWDebugTest.php | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index 246b2918..6926b1c8 100644 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -3,10 +3,11 @@ class MWDebugTest extends MediaWikiTestCase { - function setUp() { + protected function setUp() { + parent::setUp(); // Make sure MWDebug class is enabled static $MWDebugEnabled = false; - if( !$MWDebugEnabled ) { + if ( !$MWDebugEnabled ) { MWDebug::init(); $MWDebugEnabled = true; } @@ -15,33 +16,36 @@ class MWDebugTest extends MediaWikiTestCase { wfSuppressWarnings(); } - function tearDown() { + protected function tearDown() { wfRestoreWarnings(); + parent::tearDown(); } - function testAddLog() { + public function testAddLog() { MWDebug::log( 'logging a string' ); - $this->assertEquals( array( array( - 'msg' => 'logging a string', - 'type' => 'log', - 'caller' => __METHOD__ , + $this->assertEquals( + array( array( + 'msg' => 'logging a string', + 'type' => 'log', + 'caller' => __METHOD__, ) ), MWDebug::getLog() ); } - function testAddWarning() { + public function testAddWarning() { MWDebug::warning( 'Warning message' ); - $this->assertEquals( array( array( - 'msg' => 'Warning message', - 'type' => 'warn', - 'caller' => 'MWDebugTest::testAddWarning', + $this->assertEquals( + array( array( + 'msg' => 'Warning message', + 'type' => 'warn', + 'caller' => 'MWDebugTest::testAddWarning', ) ), MWDebug::getLog() ); } - function testAvoidDuplicateDeprecations() { + public function testAvoidDuplicateDeprecations() { MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); @@ -52,7 +56,7 @@ class MWDebugTest extends MediaWikiTestCase { ); } - function testAvoidNonConsecutivesDuplicateDeprecations() { + public function testAvoidNonConsecutivesDuplicateDeprecations() { MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); MWDebug::warning( 'some warning' ); MWDebug::log( 'we could have logged something too' ); |