Fixed (false positive) test in APIDocsAvailabilityTest

API Platform seems to have slightly changed the serialization process of errors and the requested HTML format was not available for error serialization
This commit is contained in:
Jan Böhmer 2023-11-17 23:59:32 +01:00
parent 74d75c6e1f
commit 3da656c08b

View file

@ -44,10 +44,7 @@ class APIDocsAvailabilityTest extends WebTestCase
self::assertResponseIsSuccessful(); self::assertResponseIsSuccessful();
} }
/** public function testDocForbidden(): void
* @dataProvider urlProvider
*/
public function testDocForbidden(string $url): void
{ {
self::ensureKernelShutdown(); self::ensureKernelShutdown();
$client = static::createClient(); $client = static::createClient();
@ -55,7 +52,7 @@ class APIDocsAvailabilityTest extends WebTestCase
->getRepository(User::class)->findOneBy(['name' => 'noread']); ->getRepository(User::class)->findOneBy(['name' => 'noread']);
$client->loginUser($user); $client->loginUser($user);
$client->request('GET',$url); $client->request('GET','/api/docs.json');
self::assertResponseStatusCodeSame(403); self::assertResponseStatusCodeSame(403);
} }