3 class DeferredStringifierTest
extends PHPUnit_Framework_TestCase
{
5 use MediaWikiCoversValidator
;
8 * @covers DeferredStringifier
9 * @dataProvider provideToString
11 public function testToString( $params, $expected ) {
12 $class = new ReflectionClass( 'DeferredStringifier' );
13 $ds = $class->newInstanceArgs( $params );
14 $this->assertEquals( $expected, (string)$ds );
17 public static function provideToString() {
42 * Verify that the callback is not called if
43 * it is never converted to a string
45 public function testCallbackNotCalled() {
46 $ds = new DeferredStringifier( function () {
47 throw new Exception( 'This should not be reached!' );
49 // No exception was thrown
50 $this->assertTrue( true );