summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/debug/MWDebugTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /tests/phpunit/includes/debug/MWDebugTest.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'tests/phpunit/includes/debug/MWDebugTest.php')
-rw-r--r--tests/phpunit/includes/debug/MWDebugTest.php68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php
deleted file mode 100644
index 246b2918..00000000
--- a/tests/phpunit/includes/debug/MWDebugTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-class MWDebugTest extends MediaWikiTestCase {
-
-
- function setUp() {
- // Make sure MWDebug class is enabled
- static $MWDebugEnabled = false;
- if( !$MWDebugEnabled ) {
- MWDebug::init();
- $MWDebugEnabled = true;
- }
- /** Clear log before each test */
- MWDebug::clearLog();
- wfSuppressWarnings();
- }
-
- function tearDown() {
- wfRestoreWarnings();
- }
-
- function testAddLog() {
- MWDebug::log( 'logging a string' );
- $this->assertEquals( array( array(
- 'msg' => 'logging a string',
- 'type' => 'log',
- 'caller' => __METHOD__ ,
- ) ),
- MWDebug::getLog()
- );
- }
-
- function testAddWarning() {
- MWDebug::warning( 'Warning message' );
- $this->assertEquals( array( array(
- 'msg' => 'Warning message',
- 'type' => 'warn',
- 'caller' => 'MWDebugTest::testAddWarning',
- ) ),
- MWDebug::getLog()
- );
- }
-
- 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"
- );
- }
-
- 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"
- );
- }
-}