@@ -239,6 +239,57 @@ public function testInfoLinkOption() : void
239239 self ::assertStringContainsString ('Foo Website ' , $ debugbar );
240240 }
241241
242+ public function testInvalidInfoLinkOption () : void
243+ {
244+ $ this ->debugger ->setOption ('info_link ' , []);
245+ try {
246+ $ this ->debugger ->renderDebugbar ();
247+ } catch (\LogicException $ e ) {
248+ self ::assertSame (
249+ 'Info link must contain "href" and "text" keys ' ,
250+ $ e ->getMessage ()
251+ );
252+ }
253+ if (\ob_get_level ()) {
254+ \ob_end_clean ();
255+ }
256+ $ this ->debugger ->setOption ('info_link ' , [
257+ 'href ' => '# ' ,
258+ ]);
259+ try {
260+ $ this ->debugger ->renderDebugbar ();
261+ } catch (\LogicException $ e ) {
262+ self ::assertSame (
263+ 'Info link must contain "href" and "text" keys ' ,
264+ $ e ->getMessage ()
265+ );
266+ }
267+ if (\ob_get_level ()) {
268+ \ob_end_clean ();
269+ }
270+ $ this ->debugger ->setOption ('info_link ' , [
271+ 'text ' => '# ' ,
272+ ]);
273+ try {
274+ $ this ->debugger ->renderDebugbar ();
275+ } catch (\LogicException $ e ) {
276+ self ::assertSame (
277+ 'Info link must contain "href" and "text" keys ' ,
278+ $ e ->getMessage ()
279+ );
280+ }
281+ if (\ob_get_level ()) {
282+ \ob_end_clean ();
283+ }
284+ $ this ->debugger ->setOption ('info_link ' , [
285+ 'href ' => 'https://foo.com ' ,
286+ 'text ' => 'Foo Website ' ,
287+ ]);
288+ $ debugbar = $ this ->debugger ->renderDebugbar ();
289+ self ::assertStringContainsString ('https://foo.com ' , $ debugbar );
290+ self ::assertStringContainsString ('Foo Website ' , $ debugbar );
291+ }
292+
242293 public function testMakeSafeName () : void
243294 {
244295 self ::assertSame (
0 commit comments