@@ -47,27 +47,24 @@ public function testGetSecurityIdentities($user, array $roles, string $authentic
47
47
->method ('getRoleNames ' )
48
48
->willReturn (['foo ' ])
49
49
;
50
- }
51
-
52
- $ strategy = $ this ->getStrategy ($ roles , $ authenticationStatus );
53
50
54
- if ('anonymous ' !== $ authenticationStatus ) {
55
51
$ token
56
52
->expects ($ this ->once ())
57
53
->method ('getUser ' )
58
54
->willReturn ($ user )
59
55
;
60
56
}
61
57
58
+ $ strategy = $ this ->getStrategy ($ roles , $ authenticationStatus );
62
59
$ extractedSids = $ strategy ->getSecurityIdentities ($ token );
63
60
64
61
foreach ($ extractedSids as $ index => $ extractedSid ) {
65
62
if (!isset ($ sids [$ index ])) {
66
- $ this ->fail (sprintf ('Expected SID at index %d, but there was none. ' , true ));
63
+ $ this ->fail (sprintf ('Expected SID at index %d, but there was none. ' , $ index ));
67
64
}
68
65
69
66
if (false === $ sids [$ index ]->equals ($ extractedSid )) {
70
- $ this ->fail (sprintf ('Index: %d, expected SID "%s", but got "%s". ' , $ index , $ sids [$ index ], $ extractedSid ));
67
+ $ this ->fail (sprintf ('Index: %d, expected SID "%s", but got "%s". ' , $ index , $ sids [$ index ], ( string ) $ extractedSid ));
71
68
}
72
69
}
73
70
}
@@ -122,11 +119,11 @@ public function testDeprecatedGetSecurityIdentities($user, array $roles, string
122
119
123
120
foreach ($ extractedSids as $ index => $ extractedSid ) {
124
121
if (!isset ($ sids [$ index ])) {
125
- $ this ->fail (sprintf ('Expected SID at index %d, but there was none. ' , true ));
122
+ $ this ->fail (sprintf ('Expected SID at index %d, but there was none. ' , $ index ));
126
123
}
127
124
128
125
if (false === $ sids [$ index ]->equals ($ extractedSid )) {
129
- $ this ->fail (sprintf ('Index: %d, expected SID "%s", but got "%s". ' , $ index , $ sids [$ index ], $ extractedSid ));
126
+ $ this ->fail (sprintf ('Index: %d, expected SID "%s", but got "%s". ' , $ index , $ sids [$ index ], ( string ) $ extractedSid ));
130
127
}
131
128
}
132
129
}
0 commit comments