diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-05 15:30:48 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-05 15:30:48 -0400 |
commit | 3d86add3dfa5e0b3ead9859593d4a52cf7555a34 (patch) | |
tree | 453d8bd3fda4dbb3020017ea1a469291da5cdc71 /tests/phpunit/includes/debug/MWDebugTest.php | |
parent | 064cec79ca4c8201de0d06bbca6cb7a5345d11be (diff) | |
parent | 2e44b49a2db3026050b136de9b00f749dd3ff939 (diff) |
Merge branch 'archwiki'
Diffstat (limited to 'tests/phpunit/includes/debug/MWDebugTest.php')
-rw-r--r-- | tests/phpunit/includes/debug/MWDebugTest.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php deleted file mode 100644 index 6926b1c8..00000000 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -class MWDebugTest extends MediaWikiTestCase { - - - protected function setUp() { - parent::setUp(); - // Make sure MWDebug class is enabled - static $MWDebugEnabled = false; - if ( !$MWDebugEnabled ) { - MWDebug::init(); - $MWDebugEnabled = true; - } - /** Clear log before each test */ - MWDebug::clearLog(); - wfSuppressWarnings(); - } - - protected function tearDown() { - wfRestoreWarnings(); - parent::tearDown(); - } - - public function testAddLog() { - MWDebug::log( 'logging a string' ); - $this->assertEquals( - array( array( - 'msg' => 'logging a string', - 'type' => 'log', - 'caller' => __METHOD__, - ) ), - MWDebug::getLog() - ); - } - - public function testAddWarning() { - MWDebug::warning( 'Warning message' ); - $this->assertEquals( - array( array( - 'msg' => 'Warning message', - 'type' => 'warn', - 'caller' => 'MWDebugTest::testAddWarning', - ) ), - MWDebug::getLog() - ); - } - - public function testAvoidDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 1, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } - - public function testAvoidNonConsecutivesDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::warning( 'some warning' ); - MWDebug::log( 'we could have logged something too' ); - // Another deprecation - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 3, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } -} |