"Krinkle" posted a comment on MediaWiki.r108873.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/108873#c29533

Commit summary for MediaWiki.r108873:

some tests for MWDebug

Really incomplete. We need better testing.

Added two new public methods so we can get or clear the internal logs.

Krinkle's comment:

<pre>
+       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' => 'MWDebug::warning',
+                       ) ),
+                       MWDebug::getLog()
+               );
+       }
+
</pre>

So log() takes stacktrace(-1) as caller, but warning() doesn't ?

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to