fix compatibility with Doctrine DBAL 3.0
This commit is contained in:
parent
27290714b7
commit
b17df8cdd7
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;
|
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Driver\PDO\Exception;
|
||||||
use Doctrine\DBAL\Driver\PDOException;
|
use Doctrine\DBAL\Driver\PDOException;
|
||||||
use Doctrine\DBAL\Exception\DeadlockException;
|
use Doctrine\DBAL\Exception\DeadlockException;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -75,7 +76,7 @@ class DoctrineReceiverTest extends TestCase
|
|||||||
{
|
{
|
||||||
$serializer = $this->createSerializer();
|
$serializer = $this->createSerializer();
|
||||||
$connection = $this->createMock(Connection::class);
|
$connection = $this->createMock(Connection::class);
|
||||||
$driverException = new PDOException(new \PDOException('Deadlock', 40001));
|
$driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001));
|
||||||
$connection->method('get')->willThrowException(new DeadlockException('Deadlock', $driverException));
|
$connection->method('get')->willThrowException(new DeadlockException('Deadlock', $driverException));
|
||||||
$receiver = new DoctrineReceiver($connection, $serializer);
|
$receiver = new DoctrineReceiver($connection, $serializer);
|
||||||
$this->assertSame([], $receiver->get());
|
$this->assertSame([], $receiver->get());
|
||||||
|
Reference in New Issue
Block a user