From 4f1cdfb637d146427c58c49513245add87566da5 Mon Sep 17 00:00:00 2001 From: Valentin Dassonville Date: Tue, 29 Oct 2024 15:44:52 +0100 Subject: [PATCH] fix(hydra): context url in https --- features/hydra/docs.feature | 2 +- src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php | 6 +++--- src/JsonLd/ContextBuilderInterface.php | 2 +- tests/JsonLd/ContextBuilderTest.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/hydra/docs.feature b/features/hydra/docs.feature index 6e3501d3bc..576c516997 100644 --- a/features/hydra/docs.feature +++ b/features/hydra/docs.feature @@ -13,7 +13,7 @@ Feature: Documentation support And the response should be in JSON And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" # Context - And the JSON node "@context[0]" should be equal to "http://www.w3.org/ns/hydra/context.jsonld" + And the JSON node "@context[0]" should be equal to "https://www.w3.org/ns/hydra/context.jsonld" And the JSON node "@context[1].@vocab" should be equal to "http://example.com/docs.jsonld#" And the JSON node "@context[1].hydra" should be equal to "http://www.w3.org/ns/hydra/core#" And the JSON node "@context[1].rdf" should be equal to "http://www.w3.org/1999/02/22-rdf-syntax-ns#" diff --git a/src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php b/src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php index f54c56a0bb..8a3cbe42a2 100644 --- a/src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php +++ b/src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php @@ -106,7 +106,7 @@ private function doTestNormalize($resourceMetadataFactory = null): void $expected = [ '@context' => [ - 'http://www.w3.org/ns/hydra/context.jsonld', + 'https://www.w3.org/ns/hydra/context.jsonld', [ '@vocab' => '/doc#', 'hydra' => 'http://www.w3.org/ns/hydra/core#', @@ -406,7 +406,7 @@ public function testNormalizeInputOutputClass(): void $expected = [ '@context' => [ - 'http://www.w3.org/ns/hydra/context.jsonld', + 'https://www.w3.org/ns/hydra/context.jsonld', [ '@vocab' => '/doc#', 'hydra' => 'http://www.w3.org/ns/hydra/core#', @@ -766,7 +766,7 @@ public function testNormalizeWithoutPrefix(): void $expected = [ '@context' => [ - 'http://www.w3.org/ns/hydra/context.jsonld', + 'https://www.w3.org/ns/hydra/context.jsonld', [ '@vocab' => '/doc#', 'hydra' => 'http://www.w3.org/ns/hydra/core#', diff --git a/src/JsonLd/ContextBuilderInterface.php b/src/JsonLd/ContextBuilderInterface.php index c90152c1f8..63e3f769e5 100644 --- a/src/JsonLd/ContextBuilderInterface.php +++ b/src/JsonLd/ContextBuilderInterface.php @@ -23,7 +23,7 @@ */ interface ContextBuilderInterface { - public const HYDRA_CONTEXT = 'http://www.w3.org/ns/hydra/context.jsonld'; + public const HYDRA_CONTEXT = 'https://www.w3.org/ns/hydra/context.jsonld'; public const HYDRA_NS = 'http://www.w3.org/ns/hydra/core#'; public const JSONLD_NS = 'http://www.w3.org/ns/json-ld#'; public const RDF_NS = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; diff --git a/tests/JsonLd/ContextBuilderTest.php b/tests/JsonLd/ContextBuilderTest.php index 34fe89535f..e37e6ef754 100644 --- a/tests/JsonLd/ContextBuilderTest.php +++ b/tests/JsonLd/ContextBuilderTest.php @@ -291,7 +291,7 @@ public function testResourceContextWithoutHydraPrefix(): void $contextBuilder = new ContextBuilder($this->resourceNameCollectionFactoryProphecy->reveal(), $this->resourceMetadataCollectionFactoryProphecy->reveal(), $this->propertyNameCollectionFactoryProphecy->reveal(), $this->propertyMetadataFactoryProphecy->reveal(), $this->urlGeneratorProphecy->reveal(), null, null, [ContextBuilder::HYDRA_CONTEXT_HAS_PREFIX => false]); $expected = [ - 'http://www.w3.org/ns/hydra/context.jsonld', + 'https://www.w3.org/ns/hydra/context.jsonld', [ '@vocab' => '#', 'hydra' => 'http://www.w3.org/ns/hydra/core#',