diff --git a/Tests/Reference/W3CReferenceTest.php b/Tests/Reference/W3CReferenceTest.php index 9749b85..6cb67c2 100644 --- a/Tests/Reference/W3CReferenceTest.php +++ b/Tests/Reference/W3CReferenceTest.php @@ -36,7 +36,7 @@ public function testElements() sort($referenceElements); $this->assertSame( - json_decode(file_get_contents(self::STANDARD_RESOURCES['elements']), true, 512, \JSON_THROW_ON_ERROR), + $this->getResourceData(self::STANDARD_RESOURCES['elements']), $referenceElements ); } @@ -48,8 +48,18 @@ public function testAttributes() } $this->assertSame( - json_decode(file_get_contents(self::STANDARD_RESOURCES['attributes']), true, 512, \JSON_THROW_ON_ERROR), + $this->getResourceData(self::STANDARD_RESOURCES['attributes']), array_keys(W3CReference::ATTRIBUTES) ); } + + private function getResourceData(string $resource): array + { + return json_decode( + file_get_contents($resource, false, stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]])), + true, + 512, + \JSON_THROW_ON_ERROR + ); + } }