parent::setUp();
// Make sure MWDebug class is enabled
static $MWDebugEnabled = false;
- if( !$MWDebugEnabled ) {
+ if ( !$MWDebugEnabled ) {
MWDebug::init();
$MWDebugEnabled = true;
}
parent::tearDown();
}
- function testAddLog() {
+ /**
+ * @covers MWDebug::log
+ */
+ 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() {
+ /**
+ * @covers MWDebug::warning
+ */
+ 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() {
+ /**
+ * @covers MWDebug::deprecated
+ */
+ public function testAvoidDuplicateDeprecations() {
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
);
}
- function testAvoidNonConsecutivesDuplicateDeprecations() {
+ /**
+ * @covers MWDebug::deprecated
+ */
+ public function testAvoidNonConsecutivesDuplicateDeprecations() {
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
MWDebug::warning( 'some warning' );
MWDebug::log( 'we could have logged something too' );