@@ -262,6 +262,62 @@ public function testWithRenderersInvalidRendererTypeThrowsException(): void
262262 ]);
263263 }
264264
265+ public function testWithRenderersNullRendererThrowsException (): void
266+ {
267+ $ view = TestHelper::createView ();
268+
269+ $ this ->expectException (InvalidArgumentException::class);
270+ $ this ->expectExceptionMessage (
271+ 'Renderer null is not an instance of ' . TemplateRendererInterface::class . '. '
272+ );
273+
274+ $ view ->withRenderers ([
275+ 'php ' => null ,
276+ ]);
277+ }
278+
279+ public function testWithRenderersStringRendererThrowsException (): void
280+ {
281+ $ view = TestHelper::createView ();
282+
283+ $ this ->expectException (InvalidArgumentException::class);
284+ $ this ->expectExceptionMessage (
285+ 'Renderer string is not an instance of ' . TemplateRendererInterface::class . '. '
286+ );
287+
288+ $ view ->withRenderers ([
289+ 'php ' => 'invalid-renderer ' ,
290+ ]);
291+ }
292+
293+ public function testWithRenderersArrayRendererThrowsException (): void
294+ {
295+ $ view = TestHelper::createView ();
296+
297+ $ this ->expectException (InvalidArgumentException::class);
298+ $ this ->expectExceptionMessage (
299+ 'Renderer array is not an instance of ' . TemplateRendererInterface::class . '. '
300+ );
301+
302+ $ view ->withRenderers ([
303+ 'php ' => [],
304+ ]);
305+ }
306+
307+ public function testWithRenderersIntegerRendererThrowsException (): void
308+ {
309+ $ view = TestHelper::createView ();
310+
311+ $ this ->expectException (InvalidArgumentException::class);
312+ $ this ->expectExceptionMessage (
313+ 'Renderer int is not an instance of ' . TemplateRendererInterface::class . '. '
314+ );
315+
316+ $ view ->withRenderers ([
317+ 'php ' => 123 ,
318+ ]);
319+ }
320+
265321 public function testWithRenderersNumericKeyImplicitThrowsException (): void
266322 {
267323 $ view = TestHelper::createView ();
0 commit comments