File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/Symfony/Component/Security/Http
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 {
54
54
'resolved ' => $ badge ->isResolved (),
55
55
];
56
56
},
57
- $ this ->passport ->getBadges (),
57
+ $ this ->passport ? ->getBadges() ?? [] ,
58
58
),
59
59
];
60
60
}
Original file line number Diff line number Diff line change @@ -36,4 +36,14 @@ public function testGetInfo()
36
36
$ this ->assertSame ($ passport , $ traceable ->authenticate ($ request ));
37
37
$ this ->assertSame ($ passport , $ traceable ->getInfo ()['passport ' ]);
38
38
}
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
+ }
39
49
}
You can’t perform that action at this time.
0 commit comments