Skip to content

Commit feaa9a6

Browse files
[HttpFoundation] skip tests when the IANA server is throttling the list of status codes
1 parent 4b1612b commit feaa9a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,11 @@ public function ianaCodesReasonPhrasesProvider()
955955
],
956956
]);
957957

958-
$ianaHttpStatusCodes->loadXML(file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context));
958+
if (!$rawStatusCodes = file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context)) {
959+
$this->markTestSkipped('The IANA server is throttling the list of status codes');
960+
}
961+
962+
$ianaHttpStatusCodes->loadXML($rawStatusCodes);
959963
if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) {
960964
self::fail('Invalid IANA\'s HTTP status code list.');
961965
}

0 commit comments

Comments
 (0)