Skip to content

Commit 83e1dc8

Browse files
committed
Fix fetching data in W3CReferenceTest on AppVeyor
1 parent 116335a commit 83e1dc8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Tests/Reference/W3CReferenceTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testElements()
3636
sort($referenceElements);
3737

3838
$this->assertSame(
39-
json_decode(file_get_contents(self::STANDARD_RESOURCES['elements']), true, 512, \JSON_THROW_ON_ERROR),
39+
$this->getResourceData(self::STANDARD_RESOURCES['elements']),
4040
$referenceElements
4141
);
4242
}
@@ -48,8 +48,18 @@ public function testAttributes()
4848
}
4949

5050
$this->assertSame(
51-
json_decode(file_get_contents(self::STANDARD_RESOURCES['attributes']), true, 512, \JSON_THROW_ON_ERROR),
51+
$this->getResourceData(self::STANDARD_RESOURCES['attributes']),
5252
array_keys(W3CReference::ATTRIBUTES)
5353
);
5454
}
55+
56+
private function getResourceData(string $resource): array
57+
{
58+
return json_decode(
59+
file_get_contents($resource, false, stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]])),
60+
true,
61+
512,
62+
\JSON_THROW_ON_ERROR
63+
);
64+
}
5565
}

0 commit comments

Comments
 (0)