File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Tests/Authenticator/Debug Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ static function (BadgeInterface $badge): array {
5454 'resolved ' => $ badge ->isResolved (),
5555 ];
5656 },
57- $ this ->passport ->getBadges (),
57+ $ this ->passport ? ->getBadges() ?? [] ,
5858 ),
5959 ];
6060 }
Original file line number Diff line number Diff line change @@ -36,4 +36,14 @@ public function testGetInfo()
3636 $ this ->assertSame ($ passport , $ traceable ->authenticate ($ request ));
3737 $ this ->assertSame ($ passport , $ traceable ->getInfo ()['passport ' ]);
3838 }
39+
40+ public function testGetInfoWithoutAuth ()
41+ {
42+ $ authenticator = $ this ->createMock (AuthenticatorInterface::class);
43+
44+ $ traceable = new TraceableAuthenticator ($ authenticator );
45+ $ this ->assertNull ($ traceable ->getInfo ()['passport ' ]);
46+ $ this ->assertIsArray ($ traceable ->getInfo ()['badges ' ]);
47+ $ this ->assertSame ([], $ traceable ->getInfo ()['badges ' ]);
48+ }
3949}
You can’t perform that action at this time.
0 commit comments