From feaa9a6b2a2e72204609b126f2616755433cc521 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 27 Sep 2020 16:13:16 +0200 Subject: [PATCH] [HttpFoundation] skip tests when the IANA server is throttling the list of status codes --- src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 3b1c86133f..a8297da5b8 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -955,7 +955,11 @@ class ResponseTest extends ResponseTestCase ], ]); - $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.'); }