@@ 158-167 (lines=10) @@ | ||
155 | ]; |
|
156 | } |
|
157 | ||
158 | public function handleObjectWithNoToStringMethod() |
|
159 | { |
|
160 | $object = m::mock(); |
|
161 | ||
162 | $formatter = new CsvFormatter(new CsvFormat()); |
|
163 | ||
164 | static::expectException(InvalidArgumentException::class); |
|
165 | ||
166 | $formatter->format([$object]); |
|
167 | } |
|
168 | ||
169 | public function testInvoke() |
|
170 | { |
|
@@ 223-232 (lines=10) @@ | ||
220 | static::assertEmpty($formatter->getClosingBlock()); |
|
221 | } |
|
222 | ||
223 | public function testFormatWithInvalidInputWillThrowAnException() |
|
224 | { |
|
225 | $formatter = new CsvFormatter(new CsvFormat()); |
|
226 | ||
227 | static::expectException(InvalidArgumentException::class); |
|
228 | ||
229 | $stuff = (object) ['cake']; |
|
230 | ||
231 | $formatter->format($stuff); |
|
232 | } |
|
233 | } |
|
234 |