Convert MWExceptionHandler to use structured logging
[lhc/web/wiklou.git] / tests / phpunit / includes / debug / logger / LegacyLoggerTest.php
index 415fa04..c63ce66 100644 (file)
@@ -35,6 +35,8 @@ class LegacyLoggerTest extends MediaWikiTestCase {
        }
 
        public function provideInterpolate() {
+               $e = new \Exception( 'boom!' );
+               $d = new \DateTime();
                return array(
                        array(
                                'no-op',
@@ -68,6 +70,50 @@ class LegacyLoggerTest extends MediaWikiTestCase {
                                ),
                                '{ not interpolated }',
                        ),
+                       array(
+                               '{null}',
+                               array(
+                                       'null' => null,
+                               ),
+                               '[Null]',
+                       ),
+                       array(
+                               '{bool}',
+                               array(
+                                       'bool' => true,
+                               ),
+                               'true',
+                       ),
+                       array(
+                               '{array}',
+                               array(
+                                       'array' => array( 1, 2, 3 ),
+                               ),
+                               '[Array(3)]',
+                       ),
+                       array(
+                               '{exception}',
+                               array(
+                                       'exception' => $e,
+                               ),
+                               '[Exception ' . get_class( $e ) . '( ' .
+                               $e->getFile() . ':' . $e->getLine() . ') ' .
+                               $e->getMessage() . ']',
+                       ),
+                       array(
+                               '{datetime}',
+                               array(
+                                       'datetime' => $d,
+                               ),
+                               $d->format( 'c' ),
+                       ),
+                       array(
+                               '{object}',
+                               array(
+                                       'object' => new \stdClass,
+                               ),
+                               '[Object stdClass]',
+                       ),
                );
        }