Merge branch '3.4' into 4.4
* 3.4: [HttpFoundation] skip tests when the IANA server is throttling the list of status codes [DoctrineBridge] fix DBAL v3 compat
This commit is contained in:
commit
cbb0b1d54b
@ -12,7 +12,8 @@
|
|||||||
namespace Symfony\Bridge\Doctrine\Security\RememberMe;
|
namespace Symfony\Bridge\Doctrine\Security\RememberMe;
|
||||||
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Doctrine\DBAL\Driver\Result;
|
use Doctrine\DBAL\Driver\Result as DriverResult;
|
||||||
|
use Doctrine\DBAL\Result;
|
||||||
use Doctrine\DBAL\Types\Type;
|
use Doctrine\DBAL\Types\Type;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
|
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
|
||||||
@ -64,7 +65,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
$paramValues = ['series' => $series];
|
$paramValues = ['series' => $series];
|
||||||
$paramTypes = ['series' => \PDO::PARAM_STR];
|
$paramTypes = ['series' => \PDO::PARAM_STR];
|
||||||
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
|
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
|
||||||
$row = $stmt instanceof Result ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
|
$row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($row) {
|
if ($row) {
|
||||||
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
|
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
|
||||||
|
@ -1023,7 +1023,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')) {
|
if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) {
|
||||||
self::fail('Invalid IANA\'s HTTP status code list.');
|
self::fail('Invalid IANA\'s HTTP status code list.');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user