Skip to content

Commit

Permalink
Fix fetching data in W3CReferenceTest on AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed Feb 13, 2024
1 parent 116335a commit 83e1dc8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Tests/Reference/W3CReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand All @@ -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
);
}
}

0 comments on commit 83e1dc8

Please sign in to comment.