3 class DeferredStringifierTest
extends PHPUnit_Framework_TestCase
{
6 * @covers DeferredStringifier
7 * @dataProvider provideToString
9 public function testToString( $params, $expected ) {
10 $class = new ReflectionClass( 'DeferredStringifier' );
11 $ds = $class->newInstanceArgs( $params );
12 $this->assertEquals( $expected, (string)$ds );
15 public static function provideToString() {
18 array( array( function() {
22 array( array( function( $i ) {
29 * Verify that the callback is not called if
30 * it is never converted to a string
32 public function testCallbackNotCalled() {
33 $ds = new DeferredStringifier( function() {
34 throw new Exception( 'This should not be reached!' );
36 // No exception was thrown
37 $this->assertTrue( true );