Skip to content

Commit 6349a1b

Browse files
Merge branch '5.1'
* 5.1: [HttpFoundation] skip tests when the IANA server is throttling the list of status codes [DoctrineBridge] fix DBAL v3 compat
2 parents cde8ffe + 66758ad commit 6349a1b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
namespace Symfony\Bridge\Doctrine\Security\RememberMe;
1313

1414
use Doctrine\DBAL\Connection;
15-
use Doctrine\DBAL\Driver\Result;
15+
use Doctrine\DBAL\Driver\Result as DriverResult;
16+
use Doctrine\DBAL\Result;
1617
use Doctrine\DBAL\Types\Types;
1718
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
1819
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface;
@@ -57,7 +58,7 @@ public function loadTokenBySeries(string $series)
5758
$paramValues = ['series' => $series];
5859
$paramTypes = ['series' => \PDO::PARAM_STR];
5960
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
60-
$row = $stmt instanceof Result ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
61+
$row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
6162

6263
if ($row) {
6364
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,11 @@ public function ianaCodesReasonPhrasesProvider()
10261026
],
10271027
]);
10281028

1029-
$ianaHttpStatusCodes->loadXML(file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context));
1029+
if (!$rawStatusCodes = file_get_contents('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml', false, $context)) {
1030+
$this->markTestSkipped('The IANA server is throttling the list of status codes');
1031+
}
1032+
1033+
$ianaHttpStatusCodes->loadXML($rawStatusCodes);
10301034
if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) {
10311035
self::fail('Invalid IANA\'s HTTP status code list.');
10321036
}

0 commit comments

Comments
 (0)