@@ -141,10 +141,12 @@ static function (stdClass $userGroup): string {
141
141
* @throws JsonException
142
142
*/
143
143
#[DataProvider('dataProviderTestThatGroupsActionReturnExpectedWithValidApiKey ' )]
144
- #[TestDox('Test that `GET /v1/profile/groups` request returns `401` with valid `$token` API key token ' )]
145
- public function testThatGroupsActionReturnExpectedWithValidApiKey (string $ token ): void
144
+ #[TestDox(
145
+ 'Test that `GET /v1/profile/groups` request returns `401` with valid `$token` API key token ($role - ROLE) '
146
+ )]
147
+ public function testThatGroupsActionReturnExpectedWithValidApiKey (string $ token , string $ role ): void
146
148
{
147
- $ client = $ this ->getApiKeyClient ($ token );
149
+ $ client = $ this ->getApiKeyClient ($ role );
148
150
$ client ->request ('GET ' , $ this ->baseUrl );
149
151
150
152
$ response = $ client ->getResponse ();
@@ -163,7 +165,7 @@ public function testThatGroupsActionReturnExpectedWithValidApiKey(string $token)
163
165
self ::assertSame (401 , $ responseContent ->code , 'Response code was not expected ' . $ info );
164
166
self ::assertTrue (property_exists ($ responseContent , 'message ' ), 'Response does not contain "message" ' . $ info );
165
167
self ::assertSame (
166
- 'JWT Token not found ' ,
168
+ 'Invalid API key ' ,
167
169
$ responseContent ->message ,
168
170
'Response message was not expected ' . $ info ,
169
171
);
@@ -202,10 +204,10 @@ public static function dataProviderTestThatGroupsActionReturnExpectedWithValidAp
202
204
203
205
if (getenv ('USE_ALL_USER_COMBINATIONS ' ) === 'yes ' ) {
204
206
foreach ($ rolesService ->getRoles () as $ role ) {
205
- yield [str_pad ($ rolesService ->getShort ($ role ), 40 , '_ ' )];
207
+ yield [str_pad ($ rolesService ->getShort ($ role ), 40 , '_ ' ), $ role ];
206
208
}
207
209
} else {
208
- yield [str_pad ($ rolesService ->getShort (Role::LOGGED ->value ), 40 , '_ ' )];
210
+ yield [str_pad ($ rolesService ->getShort (Role::LOGGED ->value ), 40 , '_ ' ), Role:: LOGGED -> value ];
209
211
}
210
212
}
211
213
0 commit comments