Skip to content

Commit

Permalink
[HttpFoundation] skip tests when the IANA server is throttling the li…
Browse files Browse the repository at this point in the history
…st of status codes
  • Loading branch information
nicolas-grekas committed Sep 27, 2020
1 parent 2264e38 commit 946db27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,11 @@ public function ianaCodesReasonPhrasesProvider()
],
]);

$ianaHttpStatusCodes->loadXML(file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context));
if (!$rawStatusCodes = file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context)) {
$this->markTestSkipped('The IANA server is throttling the list of status codes');
}

$ianaHttpStatusCodes->loadXML($rawStatusCodes);
if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) {
self::fail('Invalid IANA\'s HTTP status code list.');
}
Expand Down

0 comments on commit 946db27

Please sign in to comment.