diff --git a/src/Laravel/Tests/AuthTest.php b/src/Laravel/Tests/AuthTest.php index 59b180438be..ecf47bf2c57 100644 --- a/src/Laravel/Tests/AuthTest.php +++ b/src/Laravel/Tests/AuthTest.php @@ -47,7 +47,7 @@ public function testGetCollection(): void { $response = $this->get('/api/vaults', ['accept' => ['application/ld+json']]); $this->assertArraySubset(['detail' => 'Unauthenticated.'], $response->json()); - $response->assertHeader('content-type', 'application/problem+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/problem+json'); $response->assertStatus(401); } diff --git a/src/Laravel/Tests/DocsTest.php b/src/Laravel/Tests/DocsTest.php index f8449f80adb..a48ab5b7896 100644 --- a/src/Laravel/Tests/DocsTest.php +++ b/src/Laravel/Tests/DocsTest.php @@ -26,28 +26,28 @@ public function testOpenApi(): void { $res = $this->get('/api/docs.jsonopenapi'); $this->assertArrayHasKey('openapi', $res->json()); - $this->assertSame('application/vnd.openapi+json; charset=utf-8', $res->headers->get('content-type')); + $this->assertSame('application/vnd.openapi+json', $res->headers->get('content-type')); } public function testOpenApiAccept(): void { $res = $this->get('/api/docs', headers: ['accept' => 'application/vnd.openapi+json']); $this->assertArrayHasKey('openapi', $res->json()); - $this->assertSame('application/vnd.openapi+json; charset=utf-8', $res->headers->get('content-type')); + $this->assertSame('application/vnd.openapi+json', $res->headers->get('content-type')); } public function testJsonLd(): void { $res = $this->get('/api/docs.jsonld'); $this->assertArrayHasKey('@context', $res->json()); - $this->assertSame('application/ld+json; charset=utf-8', $res->headers->get('content-type')); + $this->assertSame('application/ld+json', $res->headers->get('content-type')); } public function testJsonLdAccept(): void { $res = $this->get('/api/docs', headers: ['accept' => 'application/ld+json']); $this->assertArrayHasKey('@context', $res->json()); - $this->assertSame('application/ld+json; charset=utf-8', $res->headers->get('content-type')); + $this->assertSame('application/ld+json', $res->headers->get('content-type')); } public function testHtmlDocsRendersSwaggerUiByDefault(): void diff --git a/src/Laravel/Tests/HalTest.php b/src/Laravel/Tests/HalTest.php index e8f7d994b6e..68328fe2c7f 100644 --- a/src/Laravel/Tests/HalTest.php +++ b/src/Laravel/Tests/HalTest.php @@ -45,7 +45,7 @@ public function testGetEntrypoint(): void { $response = $this->get('/api/', ['accept' => ['application/hal+json']]); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/hal+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/hal+json'); $this->assertJsonContains( [ @@ -67,7 +67,7 @@ public function testGetCollection(): void BookFactory::new()->has(AuthorFactory::new())->count(10)->create(); $response = $this->get('/api/books', ['accept' => 'application/hal+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/hal+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/hal+json'); $this->assertJsonContains( [ '_links' => [ @@ -88,7 +88,7 @@ public function testGetBook(): void $iri = $this->getIriFromResource($book); $response = $this->get($iri, ['accept' => ['application/hal+json']]); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/hal+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/hal+json'); $this->assertJsonContains( [ 'name' => $book->name, // @phpstan-ignore-line diff --git a/src/Laravel/Tests/JsonApiTest.php b/src/Laravel/Tests/JsonApiTest.php index 8bb06a6f09c..8809f41e383 100644 --- a/src/Laravel/Tests/JsonApiTest.php +++ b/src/Laravel/Tests/JsonApiTest.php @@ -61,7 +61,7 @@ public function testGetEntrypoint(): void { $response = $this->get('/api/', ['accept' => ['application/vnd.api+json']]); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $this->assertJsonContains( [ 'links' => [ @@ -78,7 +78,7 @@ public function testGetCollection(): void BookFactory::new()->has(AuthorFactory::new())->count(10)->create(); $response = $this->get('/api/books', ['accept' => ['application/vnd.api+json']]); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $response->assertJsonFragment([ 'links' => [ 'self' => '/api/books?page=1', @@ -98,7 +98,7 @@ public function testGetBook(): void $iri = $this->getIriFromResource($book); $response = $this->get($iri, ['accept' => ['application/vnd.api+json']]); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ @@ -141,7 +141,7 @@ public function testCreateBook(): void ); $response->assertStatus(201); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'type' => 'Book', @@ -243,7 +243,7 @@ public function testValidateJsonApi(): void ); $response->assertStatus(422); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $json = $response->json(); $this->assertJsonContains([ 'errors' => [ @@ -289,7 +289,7 @@ public function testNotFound(): void { $response = $this->get('/api/books/notfound', headers: ['accept' => 'application/vnd.api+json']); $response->assertStatus(404); - $response->assertHeader('content-type', 'application/vnd.api+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'links' => ['type' => '/errors/404'], diff --git a/src/Laravel/Tests/JsonLdTest.php b/src/Laravel/Tests/JsonLdTest.php index e56fa6f5f0a..202b3ce8c2b 100644 --- a/src/Laravel/Tests/JsonLdTest.php +++ b/src/Laravel/Tests/JsonLdTest.php @@ -50,7 +50,7 @@ public function testGetCollection(): void BookFactory::new()->has(AuthorFactory::new())->count(10)->create(); $response = $this->get('/api/books', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Book', '@id' => '/api/books', @@ -66,7 +66,7 @@ public function testGetBook(): void $book = Book::first(); $response = $this->get($this->getIriFromResource($book), ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Book', '@id' => $this->getIriFromResource($book), @@ -94,7 +94,7 @@ public function testCreateBook(): void ); $response->assertStatus(201); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Book', '@type' => 'Book', @@ -184,7 +184,7 @@ public function testSkolemIris(): void { $response = $this->get('/api/outputs', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@type' => 'NotAResource', 'name' => 'test', @@ -198,7 +198,7 @@ public function testSubresourceCollection(): void PostFactory::new()->has(CommentFactory::new()->count(10))->count(10)->create(); $response = $this->get('/api/posts', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Post', @@ -244,7 +244,7 @@ public function testCreateNotValid(): void ); $response->assertStatus(422); - $response->assertHeader('content-type', 'application/problem+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/problem+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/ValidationError', '@type' => 'ValidationError', @@ -269,7 +269,7 @@ public function testCreateNotValidPost(): void ); $response->assertStatus(422); - $response->assertHeader('content-type', 'application/problem+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/problem+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/ValidationError', '@type' => 'ValidationError', @@ -286,7 +286,7 @@ public function testSluggable(): void SluggableFactory::new()->count(10)->create(); $response = $this->get('/api/sluggables', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Sluggable', '@id' => '/api/sluggables', @@ -308,7 +308,7 @@ public function testJsonLdContextHasCorrectContentType(): void { $response = $this->get('/api/contexts/Entrypoint', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $this->assertArrayHasKey('@context', $response->json()); } @@ -316,7 +316,7 @@ public function testJsonLdResourceContextHasCorrectContentType(): void { $response = $this->get('/api/contexts/Book', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $this->assertArrayHasKey('@context', $response->json()); } @@ -324,7 +324,7 @@ public function testJsonLdContextDefaultsToEntrypoint(): void { $response = $this->get('/api/contexts/', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $this->assertArrayHasKey('@context', $response->json()); } @@ -333,7 +333,7 @@ public function testHidden(): void PostFactory::new()->has(CommentFactory::new()->count(10))->count(10)->create(); $response = $this->get('/api/posts/1/comments/1', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonMissingPath('internalNote'); } @@ -342,7 +342,7 @@ public function testVisible(): void BookFactory::new()->has(AuthorFactory::new())->count(10)->create(); $response = $this->get('/api/books', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $this->assertStringNotContainsString('internalNote', (string) $response->getContent()); } @@ -386,7 +386,7 @@ public function testResourceWithOptionModel(): void { $response = $this->get('/api/resource_with_models?page=1', ['accept' => 'application/ld+json']); $response->assertStatus(200); - $response->assertHeader('content-type', 'application/ld+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/ld+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/ResourceWithModel', '@id' => '/api/resource_with_models', diff --git a/src/Laravel/Tests/JsonProblemTest.php b/src/Laravel/Tests/JsonProblemTest.php index 43027506711..0717b3cabd9 100644 --- a/src/Laravel/Tests/JsonProblemTest.php +++ b/src/Laravel/Tests/JsonProblemTest.php @@ -29,7 +29,7 @@ public function testNotFound(): void { $response = $this->get('/api/books/notfound', headers: ['accept' => 'application/ld+json']); $response->assertStatus(404); - $response->assertHeader('content-type', 'application/problem+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/problem+json'); $response->assertJsonFragment([ '@context' => '/api/contexts/Error', '@id' => '/api/errors/404', @@ -89,7 +89,7 @@ public function testProblemExceptionInterface(): void { $response = $this->get('/api/teapot', headers: ['accept' => 'application/json']); $response->assertStatus(418); - $response->assertHeader('content-type', 'application/problem+json; charset=utf-8'); + $response->assertHeader('content-type', 'application/problem+json'); $response->assertJsonFragment([ 'type' => '/problem/teapot', 'title' => 'I\'m a teapot', diff --git a/src/State/Util/HttpResponseHeadersTrait.php b/src/State/Util/HttpResponseHeadersTrait.php index 6b0190c50b6..c8ff29007e8 100644 --- a/src/State/Util/HttpResponseHeadersTrait.php +++ b/src/State/Util/HttpResponseHeadersTrait.php @@ -69,7 +69,7 @@ private function getHeaders(Request $request, HttpOperation $operation, array $c ]; if ($hasBody) { - $headers['Content-Type'] = \sprintf('%s; charset=utf-8', $request->getMimeType($request->getRequestFormat())); + $headers['Content-Type'] = $this->formatContentType($request->getMimeType($request->getRequestFormat())); } $exception = $request->attributes->get('exception'); @@ -148,6 +148,29 @@ private function getHeaders(Request $request, HttpOperation $operation, array $c return $headers; } + /** + * Appends `; charset=utf-8` only for media types whose IANA registration defines a charset parameter. + * + * JSON-based media types (RFC 8259, RFC 6839 `+json` suffix) do not define charset and MUST always be UTF-8; + * sending the parameter can break strict clients. + */ + private function formatContentType(?string $mimeType): string + { + if (null === $mimeType || '' === $mimeType) { + return ''; + } + + if (str_starts_with($mimeType, 'text/')) { + return $mimeType.'; charset=utf-8'; + } + + if ('application/xml' === $mimeType) { + return $mimeType.'; charset=utf-8'; + } + + return $mimeType; + } + private function addLinkedDataPlatformHeaders(array &$headers, HttpOperation $operation): void { if (!$this->resourceMetadataCollectionFactory) { diff --git a/tests/Fixtures/TestBundle/Controller/CustomController.php b/tests/Fixtures/TestBundle/Controller/CustomController.php index 6222d315f0b..de1f1a1da03 100644 --- a/tests/Fixtures/TestBundle/Controller/CustomController.php +++ b/tests/Fixtures/TestBundle/Controller/CustomController.php @@ -25,6 +25,6 @@ class CustomController extends AbstractController { public function customAction(int $id): JsonResponse { - return new JsonResponse(\sprintf('This is a custom action for %d.', $id), 200, ['Content-Type' => 'application/ld+json; charset=utf-8']); + return new JsonResponse(\sprintf('This is a custom action for %d.', $id), 200, ['Content-Type' => 'application/ld+json']); } } diff --git a/tests/Functional/AttributeResourceTest.php b/tests/Functional/AttributeResourceTest.php index 9c959ff4044..d8569eb86b9 100644 --- a/tests/Functional/AttributeResourceTest.php +++ b/tests/Functional/AttributeResourceTest.php @@ -51,7 +51,7 @@ public function testGetAttributeResourcesCollection(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/AttributeResources', '@id' => '/attribute_resources', @@ -87,7 +87,7 @@ public function testAliasedResourceRedirectsAndShowsTarget(): void $this->assertResponseStatusCodeSame(301); $this->assertResponseHeaderSame('Location', '/attribute_resources/2'); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/AttributeResource', '@id' => '/attribute_resources/2', @@ -107,7 +107,7 @@ public function testPatchAliasedResource(): void $this->assertResponseStatusCodeSame(301); $this->assertResponseHeaderSame('Location', '/attribute_resources/2'); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/AttributeResource', '@id' => '/attribute_resources/2', @@ -123,7 +123,7 @@ public function testIncompleteUriVariableConfigurationProducesProblem(): void $response = self::createClient()->request('GET', '/photos/1/resize/300/100'); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $linkHeader = $response->getHeaders(false)['link'][0] ?? ''; $this->assertStringContainsString('; rel="http://www.w3.org/ns/json-ld#error"', $linkHeader); $this->assertJsonContains(['detail' => 'Unable to generate an IRI for the item of type "ApiPlatform\\Tests\\Fixtures\\TestBundle\\Entity\\IncompleteUriVariableConfigured"']); diff --git a/tests/Functional/Authorization/DenyTest.php b/tests/Functional/Authorization/DenyTest.php index 838de50670b..0f1ff0ba0aa 100644 --- a/tests/Functional/Authorization/DenyTest.php +++ b/tests/Functional/Authorization/DenyTest.php @@ -56,7 +56,7 @@ public function testAuthenticatedUserGetCollectionReturns200(): void 'headers' => ['Accept' => 'application/ld+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testCustomDataProviderGeneratorReturns200(): void diff --git a/tests/Functional/Authorization/LegacyDenyTest.php b/tests/Functional/Authorization/LegacyDenyTest.php index d93149724a5..29ad6c3aa5d 100644 --- a/tests/Functional/Authorization/LegacyDenyTest.php +++ b/tests/Functional/Authorization/LegacyDenyTest.php @@ -48,7 +48,7 @@ public function testAuthenticatedUserGetCollectionReturns200(): void 'headers' => ['Accept' => 'application/ld+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testStandardUserCannotCreate(): void diff --git a/tests/Functional/CircularReferenceTest.php b/tests/Functional/CircularReferenceTest.php index 5dfc1e33557..4ecf03360e6 100644 --- a/tests/Functional/CircularReferenceTest.php +++ b/tests/Functional/CircularReferenceTest.php @@ -50,7 +50,7 @@ public function testSelfReferencingCircularReference(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CircularReference', '@id' => '/circular_references/1', diff --git a/tests/Functional/CompositeIdentifierTest.php b/tests/Functional/CompositeIdentifierTest.php index 1e7617ecdf4..552a7f69f6b 100644 --- a/tests/Functional/CompositeIdentifierTest.php +++ b/tests/Functional/CompositeIdentifierTest.php @@ -75,7 +75,7 @@ public function testCollectionWithCompositeIdentifiers(): void self::createClient()->request('GET', '/composite_items'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CompositeItem', '@id' => '/composite_items', @@ -103,7 +103,7 @@ public function testCollectionOfCompositeRelations(): void self::createClient()->request('GET', '/composite_relations'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/CompositeRelation', '@id' => '/composite_relations', @@ -124,7 +124,7 @@ public function testGetCompositeRelationByCanonicalOrder(): void self::createClient()->request('GET', '/composite_relations/compositeItem=1;compositeLabel=1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CompositeRelation', '@id' => '/composite_relations/compositeItem=1;compositeLabel=1', @@ -158,7 +158,7 @@ public function testGetCompositeItem(): void self::createClient()->request('GET', '/composite_items/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testCompositeIdentifierWithDifferentTypes(): void diff --git a/tests/Functional/ConfigurableTest.php b/tests/Functional/ConfigurableTest.php index 674beae78a4..e0cb1de9277 100644 --- a/tests/Functional/ConfigurableTest.php +++ b/tests/Functional/ConfigurableTest.php @@ -58,7 +58,7 @@ public function testCollectionOfFileConfigDummies(): void self::createClient()->request('GET', '/fileconfigdummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/fileconfigdummy', '@id' => '/fileconfigdummies', @@ -83,7 +83,7 @@ public function testCollectionOfSingleFileConfig(): void self::createClient()->request('GET', '/single_file_configs'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/single_file_config', '@id' => '/single_file_configs', @@ -100,7 +100,7 @@ public function testFileConfigDummyItem(): void self::createClient()->request('GET', '/fileconfigdummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/fileconfigdummy', '@id' => '/fileconfigdummies/1', diff --git a/tests/Functional/ContentNegotiationTest.php b/tests/Functional/ContentNegotiationTest.php index d159aa24129..707d78ad43f 100644 --- a/tests/Functional/ContentNegotiationTest.php +++ b/tests/Functional/ContentNegotiationTest.php @@ -97,7 +97,7 @@ public function testRetrieveCollectionInJson(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/json'); $data = $response->toArray(); $this->assertIsArray($data); $this->assertCount(1, $data); @@ -141,7 +141,7 @@ public function testWildcardAcceptDefaultsToFirstFormat(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testWildcardAcceptDefaultsToUrlFormat(): void @@ -165,7 +165,7 @@ public function testUnknownFormatReturns406(): void ]); $this->assertResponseStatusCodeSame(406); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testHtmlAcceptReturnsHtmlError(): void @@ -186,7 +186,7 @@ public function testRemovedFormatReturns406(): void ]); $this->assertResponseStatusCodeSame(406); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testPostCsvBodyOnCustomFormatResource(): void diff --git a/tests/Functional/CrudAbstractTest.php b/tests/Functional/CrudAbstractTest.php index 414ce6d2343..9d4a3cd5074 100644 --- a/tests/Functional/CrudAbstractTest.php +++ b/tests/Functional/CrudAbstractTest.php @@ -52,7 +52,7 @@ public function testCreateConcrete(): void $this->createConcrete(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/concrete_dummies/1.jsonld'); $this->assertResponseHeaderSame('Location', '/concrete_dummies/1'); $this->assertJsonEquals([ @@ -72,7 +72,7 @@ public function testGetItemViaAbstractUri(): void $response = self::createClient()->request('GET', '/abstract_dummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertArrayNotHasKey('content-location', array_change_key_case($response->getHeaders())); $this->assertJsonEquals([ '@context' => '/contexts/ConcreteDummy', @@ -91,7 +91,7 @@ public function testGetCollectionViaAbstractUri(): void $response = self::createClient()->request('GET', '/abstract_dummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertGreaterThanOrEqual(1, \count($data['hydra:member'])); $this->assertSame('ConcreteDummy', $data['hydra:member'][0]['@type']); diff --git a/tests/Functional/CrudTest.php b/tests/Functional/CrudTest.php index 99c015ffda9..ee16cdc5408 100644 --- a/tests/Functional/CrudTest.php +++ b/tests/Functional/CrudTest.php @@ -78,7 +78,7 @@ public function testCreateDummy(): void $this->createDummy(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/dummies/1.jsonld'); $this->assertResponseHeaderSame('Location', '/dummies/1'); $this->assertJsonContains(self::DUMMY); @@ -91,7 +91,7 @@ public function testGetItem(): void $response = self::createClient()->request('GET', '/dummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertArrayNotHasKey('content-location', array_change_key_case($response->getHeaders())); $this->assertJsonContains(self::DUMMY); } @@ -121,7 +121,7 @@ public function testGetCollection(): void $response = self::createClient()->request('GET', '/dummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/Dummy', $data['@context']); $this->assertSame('/dummies', $data['@id']); diff --git a/tests/Functional/CrudUriVariablesTest.php b/tests/Functional/CrudUriVariablesTest.php index 695d3b6938c..9111f02313e 100644 --- a/tests/Functional/CrudUriVariablesTest.php +++ b/tests/Functional/CrudUriVariablesTest.php @@ -110,7 +110,7 @@ public function testGetEmployeesCollectionByCompany(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Employee', '@id' => '/companies/2/employees', diff --git a/tests/Functional/CustomControllerTest.php b/tests/Functional/CustomControllerTest.php index 450ddbbf27b..b85e8f85ed7 100644 --- a/tests/Functional/CustomControllerTest.php +++ b/tests/Functional/CustomControllerTest.php @@ -144,7 +144,7 @@ public function testCreatePayment(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Payment', '@id' => '/payments/1', @@ -164,7 +164,7 @@ public function testVoidPayment(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/VoidPayment', '@id' => '/void_payments/1', @@ -186,7 +186,7 @@ public function testGetVoidPayment(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/VoidPayment', '@id' => '/void_payments/1', diff --git a/tests/Functional/CustomIdentifierTest.php b/tests/Functional/CustomIdentifierTest.php index a68627a7800..ac7a28a48a2 100644 --- a/tests/Functional/CustomIdentifierTest.php +++ b/tests/Functional/CustomIdentifierTest.php @@ -52,7 +52,7 @@ public function testCreate(): void $this->createDummy(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CustomIdentifierDummy', '@id' => '/custom_identifier_dummies/1', @@ -69,7 +69,7 @@ public function testGetItem(): void self::createClient()->request('GET', '/custom_identifier_dummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CustomIdentifierDummy', '@id' => '/custom_identifier_dummies/1', @@ -86,7 +86,7 @@ public function testGetCollection(): void self::createClient()->request('GET', '/custom_identifier_dummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CustomIdentifierDummy', '@id' => '/custom_identifier_dummies', @@ -111,7 +111,7 @@ public function testUpdate(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CustomIdentifierDummy', '@id' => '/custom_identifier_dummies/1', diff --git a/tests/Functional/CustomIdentifierWithSubresourceTest.php b/tests/Functional/CustomIdentifierWithSubresourceTest.php index fd91785325b..1edf9de12aa 100644 --- a/tests/Functional/CustomIdentifierWithSubresourceTest.php +++ b/tests/Functional/CustomIdentifierWithSubresourceTest.php @@ -58,7 +58,7 @@ public function testCreateParentWithSlug(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/SlugParentDummy', '@id' => '/slug_parent_dummies/parent-dummy', @@ -81,7 +81,7 @@ public function testCreateChildReferencingParentBySlug(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/SlugChildDummy', '@id' => '/slug_child_dummies/child-dummy', @@ -99,7 +99,7 @@ public function testGetChildDummiesOfParentBySlug(): void self::createClient()->request('GET', '/slug_parent_dummies/parent-dummy/child_dummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/SlugChildDummy', '@id' => '/slug_parent_dummies/parent-dummy/child_dummies', @@ -124,7 +124,7 @@ public function testGetParentOfChildBySlug(): void self::createClient()->request('GET', '/slug_child_dummies/child-dummy/parent_dummy'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/SlugParentDummy', '@id' => '/slug_child_dummies/child-dummy/parent_dummy', diff --git a/tests/Functional/CustomNormalizedTest.php b/tests/Functional/CustomNormalizedTest.php index 7fca11e774a..804ded5782f 100644 --- a/tests/Functional/CustomNormalizedTest.php +++ b/tests/Functional/CustomNormalizedTest.php @@ -52,7 +52,7 @@ public function testCreateCustomNormalized(): void $this->createCustom(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/custom_normalized_dummies/1.jsonld'); $this->assertResponseHeaderSame('Location', '/custom_normalized_dummies/1'); $this->assertJsonEquals([ @@ -73,7 +73,7 @@ public function testCreateRelatedNormalizedReturnsJson(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/json'); $this->assertResponseHeaderSame('Content-Location', '/related_normalized_dummies/1.json'); $this->assertResponseHeaderSame('Location', '/related_normalized_dummies/1'); $this->assertJsonEquals(['id' => 1, 'name' => 'My Dummy', 'customNormalizedDummy' => []]); @@ -102,7 +102,7 @@ public function testPutRelatedNormalizedReplacesEmbeddedDummies(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/json'); $this->assertResponseHeaderSame('Content-Location', '/related_normalized_dummies/1.json'); $this->assertJsonEquals([ 'id' => 1, @@ -118,7 +118,7 @@ public function testGetCustomNormalizedItem(): void self::createClient()->request('GET', '/custom_normalized_dummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/CustomNormalizedDummy', '@id' => '/custom_normalized_dummies/1', diff --git a/tests/Functional/CustomWritableIdentifierTest.php b/tests/Functional/CustomWritableIdentifierTest.php index 48affd6dd5a..e93b63b8491 100644 --- a/tests/Functional/CustomWritableIdentifierTest.php +++ b/tests/Functional/CustomWritableIdentifierTest.php @@ -51,7 +51,7 @@ public function testCreateWithWritableSlug(): void $this->createWithSlug('My Dummy', 'my_slug'); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/custom_writable_identifier_dummies/my_slug.jsonld'); $this->assertResponseHeaderSame('Location', '/custom_writable_identifier_dummies/my_slug'); $this->assertJsonEquals([ diff --git a/tests/Functional/DefaultOrderTest.php b/tests/Functional/DefaultOrderTest.php index 2d48386c8d1..f5acef6226a 100644 --- a/tests/Functional/DefaultOrderTest.php +++ b/tests/Functional/DefaultOrderTest.php @@ -67,7 +67,7 @@ public function testDefaultOrderOnFooCollection(): void self::createClient()->request('GET', '/foos?itemsPerPage=10'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Foo', '@id' => '/foos', @@ -112,7 +112,7 @@ public function testDefaultOrderByAssociationOnFooDummy(): void $response = self::createClient()->request('GET', '/foo_dummies?itemsPerPage=10'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $names = array_column($data['hydra:member'], 'name'); $this->assertSame(['Balbo', 'Sthenelus', 'Ephesian', 'Hawsepipe', 'Separativeness'], $names); diff --git a/tests/Functional/Doctrine/BooleanFilterTest.php b/tests/Functional/Doctrine/BooleanFilterTest.php index 985fcba3578..cc8a840bdb8 100644 --- a/tests/Functional/Doctrine/BooleanFilterTest.php +++ b/tests/Functional/Doctrine/BooleanFilterTest.php @@ -64,7 +64,7 @@ public function testFilterDummiesByBoolean(string $value, int $expectedTotal, ar ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/Dummy', $data['@context']); $this->assertSame('/dummies', $data['@id']); @@ -92,7 +92,7 @@ public function testFilterEmbeddedDummiesByEmbeddedBoolean(string $value, int $e ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/EmbeddedDummy', $data['@context']); $this->assertSame('/embedded_dummies', $data['@id']); diff --git a/tests/Functional/Doctrine/ExistsFilterTest.php b/tests/Functional/Doctrine/ExistsFilterTest.php index 04bdb592cb9..14cbff98922 100644 --- a/tests/Functional/Doctrine/ExistsFilterTest.php +++ b/tests/Functional/Doctrine/ExistsFilterTest.php @@ -53,7 +53,7 @@ public function testCollectionWhereScalarPropertyDoesNotExist(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame(0, $data['hydra:totalItems']); $this->assertSame([], $data['hydra:member']); diff --git a/tests/Functional/Doctrine/MultipleFilterTest.php b/tests/Functional/Doctrine/MultipleFilterTest.php index 787615cebf3..528356523b5 100644 --- a/tests/Functional/Doctrine/MultipleFilterTest.php +++ b/tests/Functional/Doctrine/MultipleFilterTest.php @@ -46,7 +46,7 @@ public function testCollectionFilteredByDateAndBoolean(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/Dummy', $data['@context']); diff --git a/tests/Functional/Doctrine/RangeFilterTest.php b/tests/Functional/Doctrine/RangeFilterTest.php index d8da6fda3ee..9cf23df777c 100644 --- a/tests/Functional/Doctrine/RangeFilterTest.php +++ b/tests/Functional/Doctrine/RangeFilterTest.php @@ -61,7 +61,7 @@ public function testRangeFilter(string $query, int $expectedTotal): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame($expectedTotal, $data['hydra:totalItems']); } diff --git a/tests/Functional/Doctrine/SeparatedResourceTest.php b/tests/Functional/Doctrine/SeparatedResourceTest.php index b19cd54d433..3aa66e74682 100644 --- a/tests/Functional/Doctrine/SeparatedResourceTest.php +++ b/tests/Functional/Doctrine/SeparatedResourceTest.php @@ -55,7 +55,7 @@ public function testGetCollection(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/'.$shortName, $data['@context']); $this->assertStringStartsWith($uri, $data['@id']); @@ -78,7 +78,7 @@ public function testGetOrderedCollection(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertSame('5', $response->toArray()['hydra:member'][0]['value']); } @@ -95,7 +95,7 @@ public function testGetItem(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testGetAllEntityClassAndCustomProviderResources(): void diff --git a/tests/Functional/Elasticsearch/MatchFilterTest.php b/tests/Functional/Elasticsearch/MatchFilterTest.php index d33585649ac..d7eb993ab13 100644 --- a/tests/Functional/Elasticsearch/MatchFilterTest.php +++ b/tests/Functional/Elasticsearch/MatchFilterTest.php @@ -41,7 +41,7 @@ public function testMatchFilterOnATextProperty(): void $response = self::createClient()->request('GET', '/tweets?message=Good%20job', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -95,7 +95,7 @@ public function testMatchFilterOnATextPropertyWithMultipleValues(): void $response = self::createClient()->request('GET', '/tweets?message%5B%5D=Good%20job&message%5B%5D=run', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -162,7 +162,7 @@ public function testMatchFilterOnANestedPropertyOfTextType(): void $response = self::createClient()->request('GET', '/tweets?author.firstName=Caroline', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -216,7 +216,7 @@ public function testCombiningMatchFiltersOnPropertiesOfTextTypeAndANestedPropert $response = self::createClient()->request('GET', '/tweets?message%5B%5D=Good%20job&message%5B%5D=run&author.firstName=Caroline', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -270,7 +270,7 @@ public function testMatchFilterOnATextPropertyWithNewElasticsearchOperations(): $response = self::createClient()->request('GET', '/books?message=Good%20job', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -324,7 +324,7 @@ public function testMatchFilterOnATextPropertyWithMultipleValuesWithNewElasticse $response = self::createClient()->request('GET', '/books?message%5B%5D=Good%20job&message%5B%5D=run', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -391,7 +391,7 @@ public function testMatchFilterOnANestedPropertyOfTextTypeWithNewElasticsearchOp $response = self::createClient()->request('GET', '/books?library.firstName=Caroline', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -445,7 +445,7 @@ public function testCombiningMatchFiltersOnPropertiesOfTextTypeAndANestedPropert $response = self::createClient()->request('GET', '/books?message%5B%5D=Good%20job&message%5B%5D=run&library.firstName=Caroline', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -499,7 +499,7 @@ public function testMatchFilterOnAMultiLevelNestedPropertyOfTextTypeWithNewElast $response = self::createClient()->request('GET', '/books?library.relatedGenres.name=Fiction', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", diff --git a/tests/Functional/Elasticsearch/OrderFilterTest.php b/tests/Functional/Elasticsearch/OrderFilterTest.php index 3a1ab3d9fa4..2a336fd0840 100644 --- a/tests/Functional/Elasticsearch/OrderFilterTest.php +++ b/tests/Functional/Elasticsearch/OrderFilterTest.php @@ -41,7 +41,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierProperty() $response = self::createClient()->request('GET', '/tweets?order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -104,7 +104,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierProperty( $response = self::createClient()->request('GET', '/tweets?order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -167,7 +167,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierPropertyAn $response = self::createClient()->request('GET', '/tweets?order%5Bauthor.id%5D=asc&order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -230,7 +230,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierPropertyA $response = self::createClient()->request('GET', '/tweets?order%5Bauthor.id%5D=asc&order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -293,7 +293,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierPropertyAn $response = self::createClient()->request('GET', '/tweets?order%5Bauthor.id%5D=desc&order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -356,7 +356,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierPropertyA $response = self::createClient()->request('GET', '/tweets?order%5Bauthor.id%5D=desc&order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -419,7 +419,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierPropertyWi $response = self::createClient()->request('GET', '/books?order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -482,7 +482,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierPropertyW $response = self::createClient()->request('GET', '/books?order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -545,7 +545,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierPropertyAn $response = self::createClient()->request('GET', '/books?order%5Blibrary.id%5D=asc&order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -608,7 +608,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierPropertyA $response = self::createClient()->request('GET', '/books?order%5Blibrary.id%5D=asc&order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -671,7 +671,7 @@ public function testGetCollectionOrderedInAscendingOrderOnAnIdentifierPropertyAn $response = self::createClient()->request('GET', '/books?order%5Blibrary.id%5D=desc&order%5Bid%5D=asc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -734,7 +734,7 @@ public function testGetCollectionOrderedInDescendingOrderOnAnIdentifierPropertyA $response = self::createClient()->request('GET', '/books?order%5Blibrary.id%5D=desc&order%5Bid%5D=desc', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", diff --git a/tests/Functional/Elasticsearch/ReadTest.php b/tests/Functional/Elasticsearch/ReadTest.php index 79f4cdf02ce..a4d7d106686 100644 --- a/tests/Functional/Elasticsearch/ReadTest.php +++ b/tests/Functional/Elasticsearch/ReadTest.php @@ -41,7 +41,7 @@ public function testGetAResource(): void $response = self::createClient()->request('GET', '/users/116b83f8-6c32-48d8-8e28-c5c247532d3f', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/User", @@ -98,7 +98,7 @@ public function testGetTheFirstPageOfACollection(): void $response = self::createClient()->request('GET', '/tweets', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Tweet", @@ -217,7 +217,7 @@ public function testGetAPageOfACollection(): void $response = self::createClient()->request('GET', '/tweets?page=3', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Tweet", @@ -337,7 +337,7 @@ public function testGetTheLastPageOfACollection(): void $response = self::createClient()->request('GET', '/tweets?page=7', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Tweet", @@ -440,7 +440,7 @@ public function testGetAResourceWithNewElasticsearchOperations(): void $response = self::createClient()->request('GET', '/libraries/116b83f8-6c32-48d8-8e28-c5c247532d3f', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Library", @@ -497,7 +497,7 @@ public function testGetTheFirstPageOfACollectionWithNewElasticsearchOperations() $response = self::createClient()->request('GET', '/books', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Book", @@ -628,7 +628,7 @@ public function testGetAPageOfACollectionWithNewElasticsearchOperations(): void $response = self::createClient()->request('GET', '/books?page=3', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Book", @@ -760,7 +760,7 @@ public function testGetTheLastPageOfACollectionWithNewElasticsearchOperations(): $response = self::createClient()->request('GET', '/books?page=7', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/Book", diff --git a/tests/Functional/Elasticsearch/TermFilterTest.php b/tests/Functional/Elasticsearch/TermFilterTest.php index 7db5145d2d9..190bf15f012 100644 --- a/tests/Functional/Elasticsearch/TermFilterTest.php +++ b/tests/Functional/Elasticsearch/TermFilterTest.php @@ -41,7 +41,7 @@ public function testTermFilterOnAnIdentifierProperty(): void $response = self::createClient()->request('GET', '/users?id=%2Fusers%2Fcf875c95-41ab-48df-af66-38c74db18f72', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -80,7 +80,7 @@ public function testTermFilterOnAPropertyOfKeywordType(): void $response = self::createClient()->request('GET', '/users?gender=female', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -126,7 +126,7 @@ public function testCombiningTermFiltersOnAPropertyOfIntegerTypeAndAPropertyOfKe $response = self::createClient()->request('GET', '/users?age=42&gender=female', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -175,7 +175,7 @@ public function testCombiningTermFiltersOnAPropertyOfIntegerTypeAndAPropertyOfKe $response = self::createClient()->request('GET', '/users?age=42&gender=male', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -208,7 +208,7 @@ public function testTermFilterOnAPropertyOfTextType(): void $response = self::createClient()->request('GET', '/users?firstName=xavier', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -248,7 +248,7 @@ public function testTermFilterOnANestedIdentifierProperty(): void $response = self::createClient()->request('GET', '/users?tweets.id=%2Ftweets%2Fdcaef1db-225d-442b-960e-5de6984a44be', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -287,7 +287,7 @@ public function testTermFilterOnANestedPropertyOfDateType(): void $response = self::createClient()->request('GET', '/users?tweets.date=2018-02-02%2014%3A14%3A14', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -326,7 +326,7 @@ public function testTermFilterOnAnIdentifierPropertyWithElasticsearchOperations( $response = self::createClient()->request('GET', '/libraries?id=%2Flibraries%2Fcf875c95-41ab-48df-af66-38c74db18f72', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -365,7 +365,7 @@ public function testTermFilterOnAPropertyOfKeywordTypeWithElasticsearchOperation $response = self::createClient()->request('GET', '/libraries?gender=female', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -411,7 +411,7 @@ public function testCombiningTermFiltersOnAPropertyOfIntegerTypeAndAPropertyOfKe $response = self::createClient()->request('GET', '/libraries?age=42&gender=female', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -460,7 +460,7 @@ public function testCombiningTermFiltersOnAPropertyOfIntegerTypeAndAPropertyOfKe $response = self::createClient()->request('GET', '/libraries?age=42&gender=male', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -493,7 +493,7 @@ public function testTermFilterOnAPropertyOfTextTypeWithElasticsearchOperations() $response = self::createClient()->request('GET', '/libraries?firstName=xavier', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -533,7 +533,7 @@ public function testTermFilterOnANestedIdentifierPropertyWithElasticsearchOperat $response = self::createClient()->request('GET', '/libraries?books.id=%2Fbooks%2Fdcaef1db-225d-442b-960e-5de6984a44be', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -572,7 +572,7 @@ public function testTermFilterOnANestedPropertyOfDateTypeWithElasticsearchOperat $response = self::createClient()->request('GET', '/libraries?books.date=2018-02-02%2014%3A14%3A14', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", diff --git a/tests/Functional/EnumDenormalizationValidationTest.php b/tests/Functional/EnumDenormalizationValidationTest.php index 3fa939623c8..80da9437fec 100644 --- a/tests/Functional/EnumDenormalizationValidationTest.php +++ b/tests/Functional/EnumDenormalizationValidationTest.php @@ -57,7 +57,7 @@ public function testInvalidBackedEnumValueProducesValidationViolation(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $content = $response->toArray(false); $this->assertArrayHasKey('violations', $content); diff --git a/tests/Functional/ErrorTest.php b/tests/Functional/ErrorTest.php index 92691c475a0..d1c496ffecb 100644 --- a/tests/Functional/ErrorTest.php +++ b/tests/Functional/ErrorTest.php @@ -130,7 +130,7 @@ public function testDataUriExceptionMessageIsNotWrapped(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $responseData = $response->toArray(false); diff --git a/tests/Functional/ExceptionToStatusTest.php b/tests/Functional/ExceptionToStatusTest.php index 66563a6d022..9496a268a53 100644 --- a/tests/Functional/ExceptionToStatusTest.php +++ b/tests/Functional/ExceptionToStatusTest.php @@ -51,7 +51,7 @@ public function testOperationExceptionToStatusMaps404(): void ]); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testResourceExceptionToStatusMaps400(): void @@ -62,7 +62,7 @@ public function testResourceExceptionToStatusMaps400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testFilterValidationExceptionMaps400(): void @@ -72,7 +72,7 @@ public function testFilterValidationExceptionMaps400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testOverrideValidationExceptionStatusOnDelete(): void diff --git a/tests/Functional/Hal/CollectionTest.php b/tests/Functional/Hal/CollectionTest.php index fa338eb8f08..a350d118839 100644 --- a/tests/Functional/Hal/CollectionTest.php +++ b/tests/Functional/Hal/CollectionTest.php @@ -34,7 +34,7 @@ public function testFirstPageHasFirstThreeItemsAndNextLink(): void 'headers' => ['Accept' => 'application/hal+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/hal_collection_paged?page=1', $body['_links']['self']['href']); diff --git a/tests/Functional/Hal/HalTest.php b/tests/Functional/Hal/HalTest.php index bf1fbc77072..5084f4bc7da 100644 --- a/tests/Functional/Hal/HalTest.php +++ b/tests/Functional/Hal/HalTest.php @@ -36,7 +36,7 @@ public function testEntrypointListsResourcesAsHalLinks(): void 'headers' => ['Accept' => 'application/hal+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/', $body['_links']['self']['href']); $hrefs = array_column($body['_links'], 'href'); @@ -49,7 +49,7 @@ public function testGetEmbedsRelatedResourceAndItsRelation(): void 'headers' => ['Accept' => 'application/hal+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/hal_relation_embedders/1', $body['_links']['self']['href']); @@ -92,7 +92,7 @@ public function testPutReturnsHalPayloadAndKeepsPreviousRelation(): void 'json' => ['krondstadt' => 'Updated'], ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/hal_relation_embedders/1', $body['_links']['self']['href']); $this->assertSame('/hal_related_resources/1', $body['_links']['related']['href']); @@ -110,7 +110,7 @@ public function testPatchReturnsHalPayloadWithMergePatch(): void 'json' => ['krondstadt' => 'Patched'], ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/hal_relation_embedders/1', $body['_links']['self']['href']); $this->assertSame('/hal_related_resources/1', $body['_links']['related']['href']); diff --git a/tests/Functional/Hal/InputOutputDtoTest.php b/tests/Functional/Hal/InputOutputDtoTest.php index 6ae2f29bb1f..63dc75675fe 100644 --- a/tests/Functional/Hal/InputOutputDtoTest.php +++ b/tests/Functional/Hal/InputOutputDtoTest.php @@ -34,7 +34,7 @@ public function testItemReturnsCustomOutput(): void 'headers' => ['Accept' => 'application/hal+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('test', $body['foo']); $this->assertSame(1, $body['bar']); diff --git a/tests/Functional/Hal/MaxDepthTest.php b/tests/Functional/Hal/MaxDepthTest.php index 007aa270b34..44995ee0d7e 100644 --- a/tests/Functional/Hal/MaxDepthTest.php +++ b/tests/Functional/Hal/MaxDepthTest.php @@ -85,7 +85,7 @@ public function testPutTruncatesSecondLevelChildByMaxDepth(): void ], ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertArrayHasKey('_embedded', $body); $this->assertArrayHasKey('child', $body['_embedded']); diff --git a/tests/Functional/Hal/NonResourceTest.php b/tests/Functional/Hal/NonResourceTest.php index 8292a16ec69..5396bce189a 100644 --- a/tests/Functional/Hal/NonResourceTest.php +++ b/tests/Functional/Hal/NonResourceTest.php @@ -34,7 +34,7 @@ public function testNestedResourceIsEmbeddedAndRawObjectIsInlined(): void 'headers' => ['Accept' => 'application/hal+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame('/hal_non_resource_containers/1', $body['_links']['self']['href']); diff --git a/tests/Functional/Hal/ProblemTest.php b/tests/Functional/Hal/ProblemTest.php index 4c5e5136763..c3c8799af7b 100644 --- a/tests/Functional/Hal/ProblemTest.php +++ b/tests/Functional/Hal/ProblemTest.php @@ -39,7 +39,7 @@ public function testValidationErrorIsReturnedAsProblemJson(): void 'json' => [], ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $body = $response->toArray(false); $this->assertSame('/validation_errors/c1051bb4-d103-4f74-8988-acbcafc7fdc3', $body['type']); $this->assertSame('An error occurred', $body['title']); @@ -67,7 +67,7 @@ public function testNestedRelationDocumentReturns400Problem(): void ], ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $body = $response->toArray(false); $this->assertSame('/errors/400', $body['type']); $this->assertSame('An error occurred', $body['title']); diff --git a/tests/Functional/Hal/TableInheritanceTest.php b/tests/Functional/Hal/TableInheritanceTest.php index d5c1f89e86e..ed6ccdb1dbf 100644 --- a/tests/Functional/Hal/TableInheritanceTest.php +++ b/tests/Functional/Hal/TableInheritanceTest.php @@ -61,7 +61,7 @@ public function testCreateChildExposesParentAndChildFields(): void 'json' => ['name' => 'foo', 'nickname' => 'bar'], ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/hal+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/hal+json'); $body = $response->toArray(); $this->assertSame([ '_links' => ['self' => ['href' => '/dummy_table_inheritance_children/1']], diff --git a/tests/Functional/Issue5926Test.php b/tests/Functional/Issue5926Test.php index 2f3aa2e11c8..ee046cd3f5d 100644 --- a/tests/Functional/Issue5926Test.php +++ b/tests/Functional/Issue5926Test.php @@ -34,10 +34,10 @@ public static function getResources(): array public static function formats(): iterable { - yield ['application/json', 'application/json; charset=utf-8']; - yield ['application/vnd.api+json', 'application/vnd.api+json; charset=utf-8']; - yield ['application/ld+json', 'application/ld+json; charset=utf-8']; - yield ['application/hal+json', 'application/hal+json; charset=utf-8']; + yield ['application/json', 'application/json']; + yield ['application/vnd.api+json', 'application/vnd.api+json']; + yield ['application/ld+json', 'application/ld+json']; + yield ['application/hal+json', 'application/hal+json']; } #[DataProvider('formats')] diff --git a/tests/Functional/Json/InputOutputTest.php b/tests/Functional/Json/InputOutputTest.php index 61846f32f71..3caf1d6e2ef 100644 --- a/tests/Functional/Json/InputOutputTest.php +++ b/tests/Functional/Json/InputOutputTest.php @@ -46,7 +46,7 @@ public function testPasswordResetRequest(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/json'); $this->assertJsonEquals(['emailSentAt' => '2019-07-05T15:44:00+00:00']); } @@ -61,7 +61,7 @@ public function testPasswordResetRequestForUnknownUser(): void ]); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonContains(['detail' => 'User does not exist.']); } } diff --git a/tests/Functional/Json/RelationTest.php b/tests/Functional/Json/RelationTest.php index d56ea46c187..71345ab068a 100644 --- a/tests/Functional/Json/RelationTest.php +++ b/tests/Functional/Json/RelationTest.php @@ -61,7 +61,7 @@ public function testCreateThirdLevelReturnsLdJson(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/ThirdLevel', '@id' => '/third_levels/1', @@ -83,7 +83,7 @@ public function testCreateEmbeddedRelation(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/RelationEmbedder', '@id' => '/relation_embedders/1', @@ -113,7 +113,7 @@ public function testReplaceEmbeddedRelationCreatesNewRelated(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@id' => '/relation_embedders/1', 'anotherRelated' => [ diff --git a/tests/Functional/JsonApi/AbsoluteUrlTest.php b/tests/Functional/JsonApi/AbsoluteUrlTest.php index 1566f03534c..96cda0ce7a9 100644 --- a/tests/Functional/JsonApi/AbsoluteUrlTest.php +++ b/tests/Functional/JsonApi/AbsoluteUrlTest.php @@ -37,7 +37,7 @@ public function testCollectionUsesAbsoluteUrls(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertSame('http://example.com/jsonapi_absolute_url_dummies', $body['links']['self']); $this->assertSame('http://example.com/jsonapi_absolute_url_dummies/1', $body['data'][0]['id']); diff --git a/tests/Functional/JsonApi/CollectionAttributesTest.php b/tests/Functional/JsonApi/CollectionAttributesTest.php index d19b84fa882..1a5e89699da 100644 --- a/tests/Functional/JsonApi/CollectionAttributesTest.php +++ b/tests/Functional/JsonApi/CollectionAttributesTest.php @@ -35,7 +35,7 @@ public function testCollectionAttributeSerializesAsRelationshipArray(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertSame('/jsonapi_circular_references/1', $body['data']['id']); $this->assertSame('/jsonapi_circular_references/1', $body['data']['relationships']['parent']['data']['id']); diff --git a/tests/Functional/JsonApi/CollectionUriTemplateTest.php b/tests/Functional/JsonApi/CollectionUriTemplateTest.php index 8541a7de3a7..f24e4bb35a3 100644 --- a/tests/Functional/JsonApi/CollectionUriTemplateTest.php +++ b/tests/Functional/JsonApi/CollectionUriTemplateTest.php @@ -73,7 +73,7 @@ public function testPropertyUriTemplatesRenderInJsonApi(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'links' => [ 'propertyCollectionIriOnlyRelation' => '/property-collection-relations', diff --git a/tests/Functional/JsonApi/CrudTest.php b/tests/Functional/JsonApi/CrudTest.php index fb759b9b4af..f39befe3121 100644 --- a/tests/Functional/JsonApi/CrudTest.php +++ b/tests/Functional/JsonApi/CrudTest.php @@ -75,7 +75,7 @@ public function testGetThirdLevelCollection(): void 'headers' => ['Accept' => 'application/vnd.api+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertCount(1, $body['data']); } diff --git a/tests/Functional/JsonApi/EntrypointTest.php b/tests/Functional/JsonApi/EntrypointTest.php index ddc220247a5..e67995357c6 100644 --- a/tests/Functional/JsonApi/EntrypointTest.php +++ b/tests/Functional/JsonApi/EntrypointTest.php @@ -36,7 +36,7 @@ public function testEntrypointHasSelfAndResourceLinks(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertSame('http://example.com/', $body['links']['self']); $this->assertSame('http://example.com/jsonapi_entrypoint_dummies', $body['links']['jsonApiEntrypointDummy']); @@ -49,7 +49,7 @@ public function testEmptyCollectionRendersEmptyDataArray(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertSame([], $body['data']); } diff --git a/tests/Functional/JsonApi/ErrorTest.php b/tests/Functional/JsonApi/ErrorTest.php index 96a813c1d0b..727c381a3d5 100644 --- a/tests/Functional/JsonApi/ErrorTest.php +++ b/tests/Functional/JsonApi/ErrorTest.php @@ -39,7 +39,7 @@ public function testErrorResourceRendersInJsonApiFormat(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'errors' => [ [ @@ -88,7 +88,7 @@ public function testRfc7807ErrorRendersJsonApiFormat(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(false); $this->assertSame('An error occurred', $body['errors'][0]['title']); $this->assertSame(400, $body['errors'][0]['status']); @@ -107,7 +107,7 @@ public function testNotFoundRouteRendersJsonApiFormat(): void ]); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(false); $this->assertSame('An error occurred', $body['errors'][0]['title']); $this->assertSame(404, $body['errors'][0]['status']); diff --git a/tests/Functional/JsonApi/IdentifierModeTest.php b/tests/Functional/JsonApi/IdentifierModeTest.php index 2f34c41ea5a..07dc79a6356 100644 --- a/tests/Functional/JsonApi/IdentifierModeTest.php +++ b/tests/Functional/JsonApi/IdentifierModeTest.php @@ -45,7 +45,7 @@ public function testGetSingleResourceIdentifierMode(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'id' => '10', @@ -68,7 +68,7 @@ public function testGetCollectionIdentifierMode(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ [ diff --git a/tests/Functional/JsonApi/InputDtoTest.php b/tests/Functional/JsonApi/InputDtoTest.php index b42bab554ff..0f429d5611d 100644 --- a/tests/Functional/JsonApi/InputDtoTest.php +++ b/tests/Functional/JsonApi/InputDtoTest.php @@ -56,7 +56,7 @@ public function testPostWithInputDtoPreservesAttributes(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'attributes' => [ diff --git a/tests/Functional/JsonApi/InputOutputTest.php b/tests/Functional/JsonApi/InputOutputTest.php index 7cb8c5aa4bb..f82d5387a5a 100644 --- a/tests/Functional/JsonApi/InputOutputTest.php +++ b/tests/Functional/JsonApi/InputOutputTest.php @@ -35,7 +35,7 @@ public function testItemUsesCustomOutputDto(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'type' => 'CustomOutputDto', @@ -54,7 +54,7 @@ public function testCollectionUsesCustomOutputDto(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ ['type' => 'CustomOutputDto', 'attributes' => ['foo' => 'test', 'bar' => 1]], diff --git a/tests/Functional/JsonApi/ItemUriTemplateTest.php b/tests/Functional/JsonApi/ItemUriTemplateTest.php index d80ed9965b7..25395c48452 100644 --- a/tests/Functional/JsonApi/ItemUriTemplateTest.php +++ b/tests/Functional/JsonApi/ItemUriTemplateTest.php @@ -34,7 +34,7 @@ public function testGetCollectionDerivesItemIriFromFirstGetOperation(): void 'headers' => ['Accept' => 'application/vnd.api+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $body = $response->toArray(); $this->assertSame('/jsonapi_uri_template_cars', $body['links']['self']); $this->assertCount(2, $body['data']); diff --git a/tests/Functional/JsonApi/NonResourceTest.php b/tests/Functional/JsonApi/NonResourceTest.php index 9f925752f6d..839df30bf52 100644 --- a/tests/Functional/JsonApi/NonResourceTest.php +++ b/tests/Functional/JsonApi/NonResourceTest.php @@ -36,7 +36,7 @@ public function testNonResourceObjectIsEmbeddedAsRelationship(): void 'headers' => ['Accept' => 'application/vnd.api+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'id' => '/jsonapi_non_resource_containers/1', @@ -82,7 +82,7 @@ public function testCreateResourceWithNonResourceRelation(): void ], ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonContains([ 'data' => [ 'id' => '/jsonapi_non_relation_resources/1', diff --git a/tests/Functional/JsonApi/RelatedResourcesInclusionTest.php b/tests/Functional/JsonApi/RelatedResourcesInclusionTest.php index b12ab711bfe..6a7e6daa916 100644 --- a/tests/Functional/JsonApi/RelatedResourcesInclusionTest.php +++ b/tests/Functional/JsonApi/RelatedResourcesInclusionTest.php @@ -64,7 +64,7 @@ public function testIncludeManyToOneRelation(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $this->assertJsonEquals([ 'data' => [ 'id' => '/dummy_properties/1', diff --git a/tests/Functional/JsonApiFlatPaginationTest.php b/tests/Functional/JsonApiFlatPaginationTest.php index 8766b2e1fa3..656aac92a85 100644 --- a/tests/Functional/JsonApiFlatPaginationTest.php +++ b/tests/Functional/JsonApiFlatPaginationTest.php @@ -62,7 +62,7 @@ public function testFlatPageWithBracketFilterDrivesCurrentPage(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $data = $response->toArray(); @@ -82,7 +82,7 @@ public function testFlatCustomParamWithFlatPagePreservesFilter(): void ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.api+json'); $data = $response->toArray(); diff --git a/tests/Functional/JsonLd/ContextTest.php b/tests/Functional/JsonLd/ContextTest.php index dd768a9cf55..6bf0e885493 100644 --- a/tests/Functional/JsonLd/ContextTest.php +++ b/tests/Functional/JsonLd/ContextTest.php @@ -33,7 +33,7 @@ public function testEntrypointContextListsResources(): void { $response = self::createClient()->request('GET', '/contexts/Entrypoint'); $this->assertResponseIsSuccessful(); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertSame('http://localhost/docs.jsonld#', $body['@context']['@vocab']); $this->assertSame('http://www.w3.org/ns/hydra/core#', $body['@context']['hydra']); diff --git a/tests/Functional/JsonLd/EntityClassWithDateTimeTest.php b/tests/Functional/JsonLd/EntityClassWithDateTimeTest.php index 5163f098908..b31a5ba586e 100644 --- a/tests/Functional/JsonLd/EntityClassWithDateTimeTest.php +++ b/tests/Functional/JsonLd/EntityClassWithDateTimeTest.php @@ -49,7 +49,7 @@ public function testGetExposesDateTimeProperty(): void 'headers' => ['Accept' => 'application/ld+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertSame('/EntityClassWithDateTime/1', $body['@id']); $this->assertSame('EntityClassWithDateTime', $body['@type']); diff --git a/tests/Functional/JsonLd/EntrypointTest.php b/tests/Functional/JsonLd/EntrypointTest.php index 502f464557a..59a03299805 100644 --- a/tests/Functional/JsonLd/EntrypointTest.php +++ b/tests/Functional/JsonLd/EntrypointTest.php @@ -35,7 +35,7 @@ public function testEntrypointListsRegisteredResources(): void 'headers' => ['Accept' => 'application/ld+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertSame('/contexts/Entrypoint', $body['@context']); $this->assertSame('/', $body['@id']); diff --git a/tests/Functional/JsonLd/HydraDocsTest.php b/tests/Functional/JsonLd/HydraDocsTest.php index 92bcd766405..8589cf949a8 100644 --- a/tests/Functional/JsonLd/HydraDocsTest.php +++ b/tests/Functional/JsonLd/HydraDocsTest.php @@ -41,7 +41,7 @@ public function testApiVocabularyShape(): void { $response = self::createClient()->request('GET', '/docs.jsonld'); $this->assertResponseIsSuccessful(); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertIsArray($body['@context']); diff --git a/tests/Functional/JsonLd/HydraErrorTest.php b/tests/Functional/JsonLd/HydraErrorTest.php index aadfdf41f6e..fec84992289 100644 --- a/tests/Functional/JsonLd/HydraErrorTest.php +++ b/tests/Functional/JsonLd/HydraErrorTest.php @@ -39,7 +39,7 @@ public function testBadRequestErrorIsRfc7807AndHydraCompliant(): void ]); $this->assertResponseStatusCodeSame(400); $headers = $response->getHeaders(false); - $this->assertSame('application/problem+json; charset=utf-8', $headers['content-type'][0]); + $this->assertSame('application/problem+json', $headers['content-type'][0]); $this->assertStringContainsString( '; rel="http://www.w3.org/ns/json-ld#error"', implode(',', $headers['link']), @@ -66,7 +66,7 @@ public function testValidationErrorReturnsConstraintViolationList(): void 'json' => new \stdClass(), ]); $this->assertResponseStatusCodeSame(422); - $this->assertSame('application/problem+json; charset=utf-8', $response->getHeaders(false)['content-type'][0]); + $this->assertSame('application/problem+json', $response->getHeaders(false)['content-type'][0]); $this->assertJsonContains([ '@context' => '/contexts/ConstraintViolation', '@id' => '/validation_errors/c1051bb4-d103-4f74-8988-acbcafc7fdc3', @@ -93,7 +93,7 @@ public function testNotFoundReturnsHydraError(): void ]); $this->assertResponseStatusCodeSame(404); $headers = $response->getHeaders(false); - $this->assertSame('application/problem+json; charset=utf-8', $headers['content-type'][0]); + $this->assertSame('application/problem+json', $headers['content-type'][0]); $this->assertStringContainsString( '; rel="http://www.w3.org/ns/json-ld#error"', implode(',', $headers['link']), @@ -117,7 +117,7 @@ public function testMethodNotAllowedReturnsHydraError(): void ]); $this->assertResponseStatusCodeSame(405); $headers = $response->getHeaders(false); - $this->assertSame('application/problem+json; charset=utf-8', $headers['content-type'][0]); + $this->assertSame('application/problem+json', $headers['content-type'][0]); $this->assertStringContainsString( '; rel="http://www.w3.org/ns/json-ld#error"', implode(',', $headers['link']), @@ -141,7 +141,7 @@ public function testNoHydraPrefixWhenDisabled(): void ]); $this->assertResponseStatusCodeSame(400); $headers = $response->getHeaders(false); - $this->assertSame('application/problem+json; charset=utf-8', $headers['content-type'][0]); + $this->assertSame('application/problem+json', $headers['content-type'][0]); $this->assertStringContainsString( '; rel="http://www.w3.org/ns/json-ld#error"', implode(',', $headers['link']), diff --git a/tests/Functional/JsonLd/InputOutputDtoTest.php b/tests/Functional/JsonLd/InputOutputDtoTest.php index e52474d0f82..2d7715dde34 100644 --- a/tests/Functional/JsonLd/InputOutputDtoTest.php +++ b/tests/Functional/JsonLd/InputOutputDtoTest.php @@ -58,7 +58,7 @@ public function testCreateResourceWithCustomInput(): void 'json' => ['foo' => 'test', 'bar' => 1], ]); $this->assertResponseStatusCodeSame(201); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $this->assertJsonContains([ '@context' => '/contexts/JsonLdCustomInput', '@id' => '/jsonld_custom_inputs/1', @@ -166,7 +166,7 @@ public function testCreateNoInputResource(): void 'headers' => ['Accept' => 'application/ld+json'], ]); $this->assertResponseStatusCodeSame(201); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertSame('JsonLdNoInput', $body['@type']); $this->assertSame(1, $body['id']); @@ -254,7 +254,7 @@ public function testResetPasswordViaInputDto(): void 'json' => ['email' => 'user@example.com'], ]); $this->assertResponseStatusCodeSame(201); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $body = $response->toArray(); $this->assertSame('user@example.com', $body['email']); } diff --git a/tests/Functional/JsonLd/IriOnlyTest.php b/tests/Functional/JsonLd/IriOnlyTest.php index 723d24b3d16..218cbaa3f70 100644 --- a/tests/Functional/JsonLd/IriOnlyTest.php +++ b/tests/Functional/JsonLd/IriOnlyTest.php @@ -34,7 +34,7 @@ public function testContextEndpointReturnsIriOnlyContext(string $uri): void { $response = self::createClient()->request('GET', $uri); $this->assertResponseIsSuccessful(); - $this->assertSame('application/ld+json; charset=utf-8', $response->getHeaders()['content-type'][0]); + $this->assertSame('application/ld+json', $response->getHeaders()['content-type'][0]); $this->assertSame([ '@context' => [ '@vocab' => 'http://localhost/docs.jsonld#', diff --git a/tests/Functional/JsonLd/MessengerTest.php b/tests/Functional/JsonLd/MessengerTest.php index 0a3f0c7e560..d86039bd7c6 100644 --- a/tests/Functional/JsonLd/MessengerTest.php +++ b/tests/Functional/JsonLd/MessengerTest.php @@ -39,7 +39,7 @@ public function testPostMessengerWithSynchronousResultReturnsLdPayload(): void 'json' => ['var' => 'test'], ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $body = $response->toArray(); $this->assertSame('/contexts/MessengerWithInput', $body['@context']); $this->assertSame('/messenger_with_inputs/1', $body['@id']); diff --git a/tests/Functional/Mercure/MercureTest.php b/tests/Functional/Mercure/MercureTest.php index 4304e7b5ba5..8521a1fbc11 100644 --- a/tests/Functional/Mercure/MercureTest.php +++ b/tests/Functional/Mercure/MercureTest.php @@ -81,7 +81,7 @@ public function testPublishUpdateOnPostWithIriTopic(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $updates = $hub->getUpdates(); $this->assertCount(1, $updates); @@ -114,7 +114,7 @@ public function testPublishUpdateWithExpressionLanguageTopics(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $updates = $hub->getUpdates(); $this->assertCount(1, $updates); diff --git a/tests/Functional/MongoDb/EmbedManyWithoutTargetDocumentTest.php b/tests/Functional/MongoDb/EmbedManyWithoutTargetDocumentTest.php index 6d4546c5148..b76cc7b3705 100644 --- a/tests/Functional/MongoDb/EmbedManyWithoutTargetDocumentTest.php +++ b/tests/Functional/MongoDb/EmbedManyWithoutTargetDocumentTest.php @@ -55,7 +55,7 @@ public function testPostHydratesEmbedManyWithoutTargetDocument(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/DummyWithEmbedManyOmittingTargetDocument', '@id' => '/dummy_with_embed_many_omitting_target_documents/1', diff --git a/tests/Functional/MongoDb/NestedReferenceFilterErrorTest.php b/tests/Functional/MongoDb/NestedReferenceFilterErrorTest.php index 52275103792..9c99b7a6a3f 100644 --- a/tests/Functional/MongoDb/NestedReferenceFilterErrorTest.php +++ b/tests/Functional/MongoDb/NestedReferenceFilterErrorTest.php @@ -76,7 +76,7 @@ public function testOwningSideBadReferenceTriggers500(): void $response = self::createClient()->request('GET', '/dummies?relatedDummy.thirdLevel.badFourthLevel.level=4', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(500); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $body = $response->toArray(false); $this->assertSame('/contexts/Error', $body['@context']); $this->assertSame('hydra:Error', $body['@type']); @@ -89,7 +89,7 @@ public function testNonOwningSideBadReferenceTriggers500(): void $response = self::createClient()->request('GET', '/dummies?relatedDummy.thirdLevel.fourthLevel.badThirdLevel.level=3', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(500); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $body = $response->toArray(false); $this->assertSame('/contexts/Error', $body['@context']); $this->assertSame('hydra:Error', $body['@type']); diff --git a/tests/Functional/NotExposedTest.php b/tests/Functional/NotExposedTest.php index 58ab2f5d9ff..36b37b20205 100644 --- a/tests/Functional/NotExposedTest.php +++ b/tests/Functional/NotExposedTest.php @@ -42,7 +42,7 @@ public function testChairsCollectionIsExposedWithGenIdIris(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/Chair', $data['@context']); $this->assertSame('/chairs', $data['@id']); @@ -153,7 +153,7 @@ public function testSpoonItemViaCuillersIsExposed(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Spoon', '@id' => '/cuillers/12345', diff --git a/tests/Functional/NullOnNonNullablePropertyTest.php b/tests/Functional/NullOnNonNullablePropertyTest.php index eba8ce3f10c..2203c644084 100644 --- a/tests/Functional/NullOnNonNullablePropertyTest.php +++ b/tests/Functional/NullOnNonNullablePropertyTest.php @@ -43,7 +43,7 @@ public function testNullOnNonNullablePropertyReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $body = $response->toArray(false); $this->assertStringContainsString('Expected argument of type "string", "null" given at property path "name"', $body['hydra:description'] ?? $body['detail'] ?? ''); } @@ -61,7 +61,7 @@ public function testNullOnNonNullablePropertyReturns422WhenCollectingErrors(): v ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $content = $response->toArray(false); $this->assertArrayHasKey('violations', $content); diff --git a/tests/Functional/ObjectMapperValidationTest.php b/tests/Functional/ObjectMapperValidationTest.php index 8726a3a4476..ecdffc90495 100644 --- a/tests/Functional/ObjectMapperValidationTest.php +++ b/tests/Functional/ObjectMapperValidationTest.php @@ -87,7 +87,7 @@ public function testUniqueEntityValidationOnCreate(): void // Should return 422 validation error, NOT 500 database error $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); // Verify we got the UniqueEntity validation error $this->assertJsonContains([ diff --git a/tests/Functional/OpenApiTest.php b/tests/Functional/OpenApiTest.php index c459611ab3e..326bede4a59 100644 --- a/tests/Functional/OpenApiTest.php +++ b/tests/Functional/OpenApiTest.php @@ -285,7 +285,7 @@ public function testRetrieveTheOpenApiDocumentation(): void { $response = self::createClient()->request('GET', '/docs', ['headers' => ['accept' => 'application/vnd.openapi+json']]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); $json = $response->toArray(); // Context @@ -477,7 +477,7 @@ public function testRetrieveTheOpenApiDocumentationWithApiGatewayCompatibility() $response = self::createClient()->request('GET', '/docs?api_gateway=true', ['headers' => ['accept' => 'application/vnd.openapi+json']]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); $json = $response->toArray(); $this->assertSame('/', $json['basePath']); @@ -518,7 +518,7 @@ public function testRetrieveTheJsonOpenApiDocumentation(): void 'headers' => ['Accept' => 'application/vnd.openapi+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); $json = $response->toArray(); // Context @@ -554,7 +554,7 @@ public function testRetrieveTheYamlOpenApiDocumentation(): void 'headers' => ['Accept' => 'application/vnd.openapi+yaml'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+yaml; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+yaml'); } public function testRetrieveTheOpenApiDocumentationHtml(): void @@ -630,7 +630,7 @@ public function testRetrieveTheOpenApiDocumentationInJson(): void 'headers' => ['Accept' => 'text/html,*/*;q=0.8'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); } public function testOpenApiUiIsEnabledForDocsEndpointWithDummyObject(): void @@ -649,7 +649,7 @@ public function testRetrieveTheEntrypoint(): void 'headers' => ['Accept' => 'application/vnd.openapi+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); $this->assertJson($response->getContent()); } @@ -659,7 +659,7 @@ public function testRetrieveTheEntrypointWithUrlFormat(): void 'headers' => ['Accept' => 'application/vnd.openapi+json'], ]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/vnd.openapi+json'); $this->assertJson($response->getContent()); } diff --git a/tests/Functional/OperationResourceTest.php b/tests/Functional/OperationResourceTest.php index 826c4042bc6..23a1289e099 100644 --- a/tests/Functional/OperationResourceTest.php +++ b/tests/Functional/OperationResourceTest.php @@ -70,7 +70,7 @@ public function testPatchOperationResource(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/OperationResource', '@id' => '/operation_resources/1', @@ -90,7 +90,7 @@ public function testPutOperationResource(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/operation_resources/1.jsonld'); $this->assertJsonEquals([ '@context' => '/contexts/OperationResource', diff --git a/tests/Functional/OperationTest.php b/tests/Functional/OperationTest.php index a8e175d561d..56223585acd 100644 --- a/tests/Functional/OperationTest.php +++ b/tests/Functional/OperationTest.php @@ -51,7 +51,7 @@ public function testReadOnlyPropertyIgnoresInput(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/ReadableOnlyProperty', '@id' => '/readable_only_properties/1', @@ -66,7 +66,7 @@ public function testCustomOperationOnRelationEmbedder(): void $response = self::createClient()->request('GET', '/relation_embedders/42/custom'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertSame('"This is a custom action for 42."', $response->getContent()); } @@ -88,7 +88,7 @@ public function testEmbeddedDummyWithGroups(): void self::createClient()->request('GET', '/embedded_dummies_groups/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/EmbeddedDummy', '@id' => '/embedded_dummies_groups/1', @@ -131,7 +131,7 @@ public function testGetBookByCustomUriTemplate(): void self::createClient()->request('GET', '/books/by_isbn/9780451524935'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Book', '@id' => '/books/by_isbn/9780451524935', diff --git a/tests/Functional/OverriddenOperationTest.php b/tests/Functional/OverriddenOperationTest.php index b75adf724ec..66552b3ea1f 100644 --- a/tests/Functional/OverriddenOperationTest.php +++ b/tests/Functional/OverriddenOperationTest.php @@ -56,7 +56,7 @@ public function testCreateRespectsNotWritable(): void $this->createDummy(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/OverriddenOperationDummy', '@id' => '/overridden_operation_dummies/1', @@ -74,7 +74,7 @@ public function testGetItem(): void self::createClient()->request('GET', '/overridden_operation_dummies/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/OverriddenOperationDummy', '@id' => '/overridden_operation_dummies/1', diff --git a/tests/Functional/PatchTest.php b/tests/Functional/PatchTest.php index c78fc9720aa..461ad3a29e1 100644 --- a/tests/Functional/PatchTest.php +++ b/tests/Functional/PatchTest.php @@ -116,7 +116,7 @@ public function testPatchRelation(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/PatchDummyRelation', '@id' => '/patch_dummy_relations/1', @@ -138,7 +138,7 @@ public function testPatchRelationWithNonIdUriVariable(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Beta', '@id' => '/betas/1', diff --git a/tests/Functional/ProviderProcessorEntityTest.php b/tests/Functional/ProviderProcessorEntityTest.php index ec0697814f5..7eaf3496f40 100644 --- a/tests/Functional/ProviderProcessorEntityTest.php +++ b/tests/Functional/ProviderProcessorEntityTest.php @@ -51,7 +51,7 @@ public function testCreateProcessorEntity(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/processor_entities/1.jsonld'); $this->assertResponseHeaderSame('Location', '/processor_entities/1'); $this->assertJsonEquals([ @@ -71,7 +71,7 @@ public function testCreateProviderEntity(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/provider_entities/1.jsonld'); $this->assertResponseHeaderSame('Location', '/provider_entities/1'); $this->assertJsonEquals([ @@ -93,7 +93,7 @@ public function testGetProviderEntityCollection(): void $response = self::createClient()->request('GET', '/provider_entities'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertArrayNotHasKey('content-location', array_change_key_case($response->getHeaders())); $this->assertJsonEquals([ '@context' => '/contexts/ProviderEntity', @@ -119,7 +119,7 @@ public function testGetProviderEntityItem(): void $response = self::createClient()->request('GET', '/provider_entities/1'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertArrayNotHasKey('content-location', array_change_key_case($response->getHeaders())); $this->assertJsonEquals([ '@context' => '/contexts/ProviderEntity', diff --git a/tests/Functional/RelationTest.php b/tests/Functional/RelationTest.php index 8fc88a1648b..8fb3671d2ee 100644 --- a/tests/Functional/RelationTest.php +++ b/tests/Functional/RelationTest.php @@ -313,7 +313,7 @@ public function testPostWrongRelationReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testPostRelationWithNotExistingIriReturns400(): void @@ -326,7 +326,7 @@ public function testPostRelationWithNotExistingIriReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testInvalidIriReturns400(): void @@ -339,7 +339,7 @@ public function testInvalidIriReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonContains(['detail' => 'Invalid IRI "certainly not an IRI".']); } @@ -353,7 +353,7 @@ public function testInvalidTypeReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $linkHeader = $response->getHeaders(false)['link'][0] ?? ''; $this->assertStringContainsString('; rel="http://www.w3.org/ns/json-ld#error"', $linkHeader); $data = $response->toArray(false); diff --git a/tests/Functional/Security/ContentNegotiationErrorsTest.php b/tests/Functional/Security/ContentNegotiationErrorsTest.php index e02bfa88145..8b4ba76b486 100644 --- a/tests/Functional/Security/ContentNegotiationErrorsTest.php +++ b/tests/Functional/Security/ContentNegotiationErrorsTest.php @@ -47,7 +47,7 @@ public function testUnsupportedRequestContentTypeReturns415(): void ); $this->assertResponseStatusCodeSame(415); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'The content-type "text/plain" is not supported. Supported MIME types are "application/ld+json", "application/hal+json", "application/vnd.api+json", "application/xml", "text/xml", "application/json", "text/html", "application/graphql", "multipart/form-data".', ]); @@ -58,7 +58,7 @@ public function testUnsupportedAcceptHeaderReturns406(): void self::createClient()->request('GET', '/dummies', ['headers' => ['Accept' => 'text/plain']]); $this->assertResponseStatusCodeSame(406); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Requested format "text/plain" is not supported. Supported MIME types are "application/ld+json", "application/hal+json", "application/vnd.api+json", "application/xml", "text/xml", "application/json", "text/html", "application/graphql", "multipart/form-data".', ]); @@ -69,7 +69,7 @@ public function testAcceptHeaderDifferentFromUrlFormatReturns406(): void self::createClient()->request('GET', '/dummies/1.json', ['headers' => ['Accept' => 'text/xml']]); $this->assertResponseStatusCodeSame(406); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Requested format "text/xml" is not supported. Supported MIME types are "application/json".', ]); @@ -80,7 +80,7 @@ public function testInvalidAcceptHeaderReturns406(): void self::createClient()->request('GET', '/dummies/1', ['headers' => ['Accept' => 'invalid']]); $this->assertResponseStatusCodeSame(406); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Requested format "invalid" is not supported. Supported MIME types are "application/ld+json", "application/hal+json", "application/vnd.api+json", "application/xml", "text/xml", "application/json", "text/html", "application/graphql", "multipart/form-data".', ]); @@ -91,7 +91,7 @@ public function testInvalidUrlFormatReturns404(): void self::createClient()->request('GET', '/dummies/1.invalid'); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Format "invalid" is not supported', ]); @@ -102,7 +102,7 @@ public function testInvalidUrlFormatAndAcceptReturns404(): void self::createClient()->request('GET', '/dummies/1.invalid', ['headers' => ['Accept' => 'text/invalid']]); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Format "invalid" is not supported', ]); diff --git a/tests/Functional/Security/SecurityHeadersTest.php b/tests/Functional/Security/SecurityHeadersTest.php index cacbf430537..2c048fc7a42 100644 --- a/tests/Functional/Security/SecurityHeadersTest.php +++ b/tests/Functional/Security/SecurityHeadersTest.php @@ -39,7 +39,7 @@ public function testCollectionResponseIncludesSecurityHeaders(): void { self::createClient()->request('GET', '/dummies', ['headers' => ['Accept' => 'application/ld+json']]); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertResponseHeaderSame('x-content-type-options', 'nosniff'); $this->assertResponseHeaderSame('x-frame-options', 'deny'); } @@ -72,7 +72,7 @@ public function testValidationErrorResponseIncludesSecurityHeaders(): void ); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertResponseHeaderSame('x-content-type-options', 'nosniff'); $this->assertResponseHeaderSame('x-frame-options', 'deny'); } diff --git a/tests/Functional/Security/StrongTypingTest.php b/tests/Functional/Security/StrongTypingTest.php index d42b6a8aab9..114d2960f57 100644 --- a/tests/Functional/Security/StrongTypingTest.php +++ b/tests/Functional/Security/StrongTypingTest.php @@ -50,7 +50,7 @@ public function testIgnoreUnsupportedAttributes(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Dummy', '@id' => '/dummies/1', @@ -87,7 +87,7 @@ public function testNullValueForRequiredStringTriggersTypeError(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/Error', '@type' => 'hydra:Error', @@ -107,7 +107,7 @@ public function testStringInsteadOfIriOnRelationTriggersInvalidIri(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/Error', '@type' => 'hydra:Error', @@ -128,7 +128,7 @@ public function testInvalidDateStringIsRejected(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); } public function testDateWithUnexpectedFormatIsRejected(): void @@ -143,7 +143,7 @@ public function testDateWithUnexpectedFormatIsRejected(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); } public function testStringInsteadOfArrayOnCollectionRelationTriggersTypeError(): void @@ -158,7 +158,7 @@ public function testStringInsteadOfArrayOnCollectionRelationTriggersTypeError(): ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/Error', '@type' => 'hydra:Error', @@ -179,7 +179,7 @@ public function testAssociativeObjectInsteadOfListOnCollectionTriggersKeyTypeErr ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/Error', '@type' => 'hydra:Error', @@ -199,7 +199,7 @@ public function testIntegerInsteadOfStringScalarTriggersTypeError(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/Error', '@type' => 'hydra:Error', @@ -219,6 +219,6 @@ public function testIntegerIsAcceptedForFloatProperty(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); } } diff --git a/tests/Functional/Serializer/ConstructorDeserializationTest.php b/tests/Functional/Serializer/ConstructorDeserializationTest.php index d8439a9cfe5..bacbce105d0 100644 --- a/tests/Functional/Serializer/ConstructorDeserializationTest.php +++ b/tests/Functional/Serializer/ConstructorDeserializationTest.php @@ -50,7 +50,7 @@ public function testPostHydratesObjectViaConstructor(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/DummyEntityWithConstructor', '@id' => '/dummy_entity_with_constructors/1', diff --git a/tests/Functional/Serializer/EmptyArrayAsObjectTest.php b/tests/Functional/Serializer/EmptyArrayAsObjectTest.php index 876a7237056..6827b40eec6 100644 --- a/tests/Functional/Serializer/EmptyArrayAsObjectTest.php +++ b/tests/Functional/Serializer/EmptyArrayAsObjectTest.php @@ -33,7 +33,7 @@ public function testGetResourcePreservesEmptyArrayAsObject(): void self::createClient()->request('GET', '/empty_array_as_objects/5', ['headers' => ['Accept' => 'application/ld+json']]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/EmptyArrayAsObject", diff --git a/tests/Functional/Serializer/GroupFilterTest.php b/tests/Functional/Serializer/GroupFilterTest.php index 6540516b346..4e7cf095264 100644 --- a/tests/Functional/Serializer/GroupFilterTest.php +++ b/tests/Functional/Serializer/GroupFilterTest.php @@ -76,7 +76,7 @@ public function testGetACollectionOfResourcesByGroupDummyFooWithoutOverriding(): ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -154,7 +154,7 @@ public function testGetACollectionOfResourcesByGroupDummyFooWithOverriding(): vo ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -223,7 +223,7 @@ public function testGetACollectionOfResourcesByGroupsDummyFooDummyQuxAndWithoutO ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -304,7 +304,7 @@ public function testGetACollectionOfResourcesByGroupsDummyFooDummyQuxAndWithOver ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -376,7 +376,7 @@ public function testGetACollectionOfResourcesByGroupsDummyFooDummyQuxWithoutOver ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -454,7 +454,7 @@ public function testGetACollectionOfResourcesByGroupsDummyFooDummyQuxWithOverrid ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -523,7 +523,7 @@ public function testGetACollectionOfResourcesByGroupEmptyAndWithoutOverriding(): ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -601,7 +601,7 @@ public function testGetACollectionOfResourcesByGroupEmptyAndWithOverriding(): vo ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -667,7 +667,7 @@ public function testGetAResourceByGroupDummyFooWithoutOverriding(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -697,7 +697,7 @@ public function testGetAResourceByGroupDummyFooWithOverriding(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -724,7 +724,7 @@ public function testGetAResourceByGroupsDummyFooDummyQuxAndWithoutOverriding(): ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -755,7 +755,7 @@ public function testGetAResourceByGroupsDummyFooDummyQuxAndWithOverriding(): voi ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -783,7 +783,7 @@ public function testGetAResourceByGroupsDummyFooDummyQuxAndWithoutOverridingAndW ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -813,7 +813,7 @@ public function testGetAResourceByGroupsDummyFooDummyQuxAndWithOverridingAndWith ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -840,7 +840,7 @@ public function testGetAResourceByGroupEmptyAndWithoutOverriding(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -870,7 +870,7 @@ public function testGetAResourceByGroupEmptyAndWithOverriding(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -903,7 +903,7 @@ public function testCreateAResourceByGroupDummyFooAndWithoutOverriding(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -935,7 +935,7 @@ public function testCreateAResourceByGroupDummyFooAndWithOverriding(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -964,7 +964,7 @@ public function testCreateAResourceByGroupsDummyFooDummyBazDummyQuxAndWithoutOve ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -997,7 +997,7 @@ public function testCreateAResourceByGroupsDummyFooDummyBazDummyQuxAndWithOverri ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1028,7 +1028,7 @@ public function testCreateAResourceByGroupsDummyDummyBazWithoutOverriding(): voi ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1061,7 +1061,7 @@ public function testCreateAResourceByGroupsDummyDummyBazAndWithOverriding(): voi ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1094,7 +1094,7 @@ public function testCreateAResourceByGroupEmptyAndWithoutOverriding(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1126,7 +1126,7 @@ public function testCreateAResourceByGroupEmptyAndWithOverriding(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1154,7 +1154,7 @@ public function testCreateAResourceByGroupsDummyDummyBazWithoutOverridingAndWith ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", @@ -1186,7 +1186,7 @@ public function testCreateAResourceByGroupsDummyDummyBazWithOverridingAndWithWhi ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyGroup", diff --git a/tests/Functional/Serializer/PropertyFilterTest.php b/tests/Functional/Serializer/PropertyFilterTest.php index 4c152293362..6f7305a1c3f 100644 --- a/tests/Functional/Serializer/PropertyFilterTest.php +++ b/tests/Functional/Serializer/PropertyFilterTest.php @@ -83,7 +83,7 @@ public function testGetACollectionOfResourcesByAttributesIdFooAndBar(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -133,7 +133,7 @@ public function testGetACollectionOfResourcesByAttributesFooBarGroupBazAndGroupQ ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -190,7 +190,7 @@ public function testGetACollectionOfResourcesByAttributesFooBar(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -237,7 +237,7 @@ public function testGetACollectionOfResourcesByWhitelistedNestedPropertiesFooBar ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -293,7 +293,7 @@ public function testGetACollectionOfResourcesByAttributesBarNotAllowed(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -338,7 +338,7 @@ public function testGetACollectionOfResourcesByAttributesEmpty(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -392,7 +392,7 @@ public function testGetAResourceByAttributesIdFooAndBar(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -421,7 +421,7 @@ public function testGetAResourceByAttributesFooBarGroupBazAndGroupQux(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -459,7 +459,7 @@ public function testGetAResourceByAttributesEmpty(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertMatchesJsonSchema(<<<'JSON' { "type": "object", @@ -499,7 +499,7 @@ public function testCreateAResourceByAttributesFooAndBar(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyProperty", @@ -532,7 +532,7 @@ public function testCreateAResourceByAttributesFooBarGroupFooGroupBazAndGroupQux ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/DummyProperty", diff --git a/tests/Functional/Serializer/ValueObjectRelationsTest.php b/tests/Functional/Serializer/ValueObjectRelationsTest.php index 00d4bfa6af2..908a97cb3bd 100644 --- a/tests/Functional/Serializer/ValueObjectRelationsTest.php +++ b/tests/Functional/Serializer/ValueObjectRelationsTest.php @@ -60,7 +60,7 @@ public function testPostHydratesValueObjectViaConstructor(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/VoDummyCar", @@ -182,7 +182,7 @@ public function testMissingRequiredConstructorParameterReturnsError(): void ); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertStringContainsString('; rel="http://www.w3.org/ns/json-ld#error"', self::getClient()->getResponse()->headers->get('link') ?? ''); $this->assertMatchesJsonSchema(<<<'JSON' { @@ -213,7 +213,7 @@ public function testDefaultConstructorParameterIsApplied(): void ); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals(<<<'JSON' { "@context": "/contexts/VoDummyCar", diff --git a/tests/Functional/SubResource/MultipleRelationTest.php b/tests/Functional/SubResource/MultipleRelationTest.php index f81b23074aa..6c536cad3e9 100644 --- a/tests/Functional/SubResource/MultipleRelationTest.php +++ b/tests/Functional/SubResource/MultipleRelationTest.php @@ -40,7 +40,7 @@ public function testGetMultipleRelationItem(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/RelationMultiple', '@id' => '/dummy/1/relations/2', @@ -62,7 +62,7 @@ public function testGetMultipleRelationCollection(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/RelationMultiple', '@id' => '/dummy/1/relations', diff --git a/tests/Functional/SubResource/SubResourceTest.php b/tests/Functional/SubResource/SubResourceTest.php index cfc7c2328cf..48278234573 100644 --- a/tests/Functional/SubResource/SubResourceTest.php +++ b/tests/Functional/SubResource/SubResourceTest.php @@ -162,7 +162,7 @@ public function testGetOneToOneSubResource(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/Answer', '@id' => '/questions/1/answer', @@ -186,7 +186,7 @@ public function testOneToOneSubresourceExposesInverseSideBackIri(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/OneToOneSubresourceAnswer', '@id' => '/one_to_one_subresource_questions/1/answer', @@ -237,7 +237,7 @@ public function testGetSubResourceCollection(): void $response = self::createClient()->request('GET', '/dummies/1/related_dummies'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/dummies/1/related_dummies', $data['@id']); $this->assertSame(2, $data['hydra:totalItems']); @@ -266,7 +266,7 @@ public function testGetSubResourceItem(): void self::createClient()->request('GET', '/dummies/1/related_dummies/2'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonContains([ '@context' => '/contexts/RelatedDummy', '@id' => '/dummies/1/related_dummies/2', @@ -286,7 +286,7 @@ public function testCreateDummyWithSubResourceRelation(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testGetEmbeddedRelationAtThirdLevel(): void @@ -315,7 +315,7 @@ public function testGetEmbeddedRelationAtFourthLevel(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/FourthLevel', '@id' => '/dummies/1/related_dummies/1/third_level/fourth_level', @@ -446,7 +446,7 @@ public function testPersonSentGreetings(): void self::createClient()->request('GET', '/people/1/sent_greetings'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/GreetingBySender', '@id' => '/people/1/sent_greetings', diff --git a/tests/Functional/TableInheritanceTest.php b/tests/Functional/TableInheritanceTest.php index 20e0189f116..e9bacdda918 100644 --- a/tests/Functional/TableInheritanceTest.php +++ b/tests/Functional/TableInheritanceTest.php @@ -84,7 +84,7 @@ public function testCreateChildResource(): void $data = $this->createChild(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertSame('DummyTableInheritanceChild', $data['@type']); $this->assertSame('/contexts/DummyTableInheritanceChild', $data['@context']); $this->assertSame('/dummy_table_inheritance_children/1', $data['@id']); @@ -99,7 +99,7 @@ public function testParentCollectionExposesChildren(): void $response = self::createClient()->request('GET', '/dummy_table_inheritances'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertCount(1, $data['hydra:member']); $this->assertSame('DummyTableInheritanceChild', $data['hydra:member'][0]['@type']); @@ -134,7 +134,7 @@ public function testCreateDifferentChildResource(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('DummyTableInheritanceDifferentChild', $data['@type']); $this->assertSame('/contexts/DummyTableInheritanceDifferentChild', $data['@context']); @@ -156,7 +156,7 @@ public function testRelatedEntityWithMixedInheritedChildren(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('DummyTableInheritanceRelated', $data['@type']); $this->assertSame('/dummy_table_inheritance_relateds/1', $data['@id']); @@ -197,7 +197,7 @@ public function testInterfaceCollection(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $members = $data['hydra:member']; $this->assertCount(2, $members); @@ -218,7 +218,7 @@ public function testInterfaceItem(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('/contexts/ResourceInterface', $data['@context']); $this->assertSame('/resource_interfaces/single%20item', $data['@id']); @@ -253,7 +253,7 @@ public function testSitesWithInternalOwnerUseParentIri(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertCount(3, $data['hydra:member']); foreach ($data['hydra:member'] as $i => $member) { diff --git a/tests/Functional/UnionIntersectTypesTest.php b/tests/Functional/UnionIntersectTypesTest.php index 3d04fe4ad47..9ac76f5df02 100644 --- a/tests/Functional/UnionIntersectTypesTest.php +++ b/tests/Functional/UnionIntersectTypesTest.php @@ -41,7 +41,7 @@ public function testCreateBookWithUnionTypeNumberAsString(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('Book', $data['@type']); $this->assertSame('/contexts/Book', $data['@context']); @@ -75,7 +75,7 @@ public function testCreateBookWithValidIntersectType(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $data = $response->toArray(); $this->assertSame('Book', $data['@type']); $this->assertSame(1, $data['number']); @@ -95,7 +95,7 @@ public function testCreateBookWithInvalidIntersectTypeReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'Could not denormalize object of type "ApiPlatform\\Tests\\Fixtures\\TestBundle\\ApiResource\\Issue5452\\ActivableInterface", no supporting normalizer found.', ]); diff --git a/tests/Functional/Uuid/UuidIdentifierTest.php b/tests/Functional/Uuid/UuidIdentifierTest.php index 943131ccf3c..3b7be4fc42d 100644 --- a/tests/Functional/Uuid/UuidIdentifierTest.php +++ b/tests/Functional/Uuid/UuidIdentifierTest.php @@ -56,7 +56,7 @@ public function testCreateUuidIdentifier(): void $this->createUuidDummy(); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); $this->assertResponseHeaderSame('Content-Location', '/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78.jsonld'); $this->assertResponseHeaderSame('Location', '/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78'); } @@ -160,7 +160,7 @@ public function testGetRamseyUuidDummy(): void self::createClient()->request('GET', '/ramsey_uuid_dummies/41B29566-144B-11E6-A148-3E1D05DEFE78'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testDeleteRamseyUuidDummy(): void @@ -189,7 +189,7 @@ public function testRetrieveBadRamseyUuidReturns404(): void self::createClient()->request('GET', '/ramsey_uuid_dummies/41B29566-144B-E1D05DEFE78'); $this->assertResponseStatusCodeSame(404); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testCreateRamseyUuidDummy(): void @@ -205,7 +205,7 @@ public function testCreateRamseyUuidDummy(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testCreateRamseyUuidDummyWithNonIdField(): void @@ -221,7 +221,7 @@ public function testCreateRamseyUuidDummyWithNonIdField(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testUpdateRamseyUuidNonIdField(): void @@ -242,7 +242,7 @@ public function testUpdateRamseyUuidNonIdField(): void ]); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testCreateBadRamseyUuidReturns400(): void @@ -258,7 +258,7 @@ public function testCreateBadRamseyUuidReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testUpdateBadRamseyUuidReturns400(): void @@ -279,7 +279,7 @@ public function testUpdateBadRamseyUuidReturns400(): void ]); $this->assertResponseStatusCodeSame(400); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); } public function testGetSymfonyUuidDummy(): void @@ -297,6 +297,6 @@ public function testGetSymfonyUuidDummy(): void self::createClient()->request('GET', '/symfony_uuid_dummies/cdf8f706-ebe3-4fb6-b0bd-ae7b48028f24'); $this->assertResponseStatusCodeSame(200); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } } diff --git a/tests/Functional/ValidationGroupsTest.php b/tests/Functional/ValidationGroupsTest.php index ee2bc3cb5a5..8054b3e78ca 100644 --- a/tests/Functional/ValidationGroupsTest.php +++ b/tests/Functional/ValidationGroupsTest.php @@ -45,7 +45,7 @@ public function testCreateMinimalResourceWithoutGroups(): void ]); $this->assertResponseStatusCodeSame(201); - $this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/ld+json'); } public function testValidationGroupsTriggerFailure(): void @@ -56,7 +56,7 @@ public function testValidationGroupsTriggerFailure(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/ConstraintViolation', '@type' => 'ConstraintViolation', @@ -77,7 +77,7 @@ public function testValidationGroupSequence(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonContains([ 'detail' => 'title: This value should not be null.', 'violations' => [[ @@ -96,7 +96,7 @@ public function testValidationUsesSerializedNameForPropertyPath(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $data = $response->toArray(false); $this->assertSame('test: This value should not be null.', $data['detail']); $this->assertSame('test', $data['violations'][0]['propertyPath']); @@ -115,7 +115,7 @@ public function testGetViolationConstraints(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('Content-Type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('Content-Type', 'application/problem+json'); $this->assertJsonEquals([ 'status' => 422, 'violations' => [[ diff --git a/tests/Functional/ValidationTest.php b/tests/Functional/ValidationTest.php index c82238d75d0..7ace4d5a100 100644 --- a/tests/Functional/ValidationTest.php +++ b/tests/Functional/ValidationTest.php @@ -59,7 +59,7 @@ public function testPostWithDenormalizationErrorsCollected(): void ]); $this->assertResponseStatusCodeSame(422); - $this->assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/problem+json'); $this->assertJsonContains([ '@context' => '/contexts/ConstraintViolation', diff --git a/tests/Symfony/Bundle/Test/ClientTest.php b/tests/Symfony/Bundle/Test/ClientTest.php index 9fb196f87ce..c12433bbcbb 100644 --- a/tests/Symfony/Bundle/Test/ClientTest.php +++ b/tests/Symfony/Bundle/Test/ClientTest.php @@ -122,7 +122,7 @@ public function testComplexScenario(): void $this->recreateSchema([SecuredDummy::class, RelatedDummy::class]); self::createClient()->request('GET', '/secured_dummies', ['auth_basic' => ['dunglas', 'kevin']]); $this->assertResponseIsSuccessful(); - $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); + $this->assertResponseHeaderSame('content-type', 'application/ld+json'); $this->assertJsonEquals([ '@context' => '/contexts/SecuredDummy',