|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport; |
| 13 | + |
| 14 | +use Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer; |
| 15 | +use PHPUnit\Framework\TestCase; |
| 16 | +use Symfony\Component\Messenger\Bridge\Doctr
1083C
ine\Transport\PostgreSqlConnection; |
| 17 | + |
| 18 | +/** |
| 19 | + * @author Kévin Dunglas <dunglas@gmail.com> |
| 20 | + */ |
| 21 | +class PostgreSqlConnectionTest extends TestCase |
| 22 | +{ |
| 23 | + public function testSerialize() |
| 24 | + { |
| 25 | + $this->expectException(\BadMethodCallException::class); |
| 26 | + $this->expectExceptionMessage('Cannot serialize '.PostgreSqlConnection::class); |
| 27 | + |
| 28 | + $schemaSynchronizer = $this->createMock(SchemaSynchronizer::class); |
| 29 | + $driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class); |
| 30 | + |
| 31 | + $connection = new PostgreSqlConnection([], $driverConnection, $schemaSynchronizer); |
| 32 | + serialize($connection); |
| 33 | + } |
| 34 | + |
| 35 | + public function testUnserialize() |
| 36 | + { |
| 37 | + $this->expectException(\BadMethodCallException::class); |
| 38 | + $this->expectExceptionMessage('Cannot unserialize '.PostgreSqlConnection::class); |
| 39 | + |
| 40 | + $schemaSynchronizer = $this->createMock(SchemaSynchronizer::class); |
| 41 | + $driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class); |
| 42 | + |
| 43 | + $connection = new PostgreSqlConnection([], $driverConnection, $schemaSynchronizer); |
| 44 | + $connection->__wakeup(); |
| 45 | + } |
| 46 | +} |
0 commit comments