@@ 23-32 (lines=10) @@ | ||
20 | ||
21 | class ObjectToStringProcessorTest extends TestCase |
|
22 | { |
|
23 | public function testObjectWithStringMagicMethod() |
|
24 | { |
|
25 | $object = m::mock(); |
|
26 | $object->shouldReceive('__toString') |
|
27 | ->andReturn('some string'); |
|
28 | ||
29 | $processor = new ObjectToStringProcessor(); |
|
30 | ||
31 | static::assertEquals(['some string'], $processor->process([$object])); |
|
32 | } |
|
33 | ||
34 | public function testObjectWithNoToStringWillThrowException() |
|
35 | { |
|
@@ 52-61 (lines=10) @@ | ||
49 | static::assertEquals(['text', 1, 2.4, false, null], $processor->process(['text', 1, 2.4, false, null])); |
|
50 | } |
|
51 | ||
52 | public function testInvoke() |
|
53 | { |
|
54 | $object = m::mock(); |
|
55 | $object->shouldReceive('__toString') |
|
56 | ->andReturn('some string'); |
|
57 | ||
58 | $processor = new ObjectToStringProcessor(); |
|
59 | ||
60 | static::assertEquals(['some string'], $processor([$object])); |
|
61 | } |
|
62 | } |
|
63 |