8000 Merge branch '5.0' · symfony/symfony@20811ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 20811ce

Browse files
Merge branch '5.0'
* 5.0: [Messenger] Fix deprecation
2 parents a8b6ba3 + 5b06e01 commit 20811ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Symfony/Component/Messenger/Tests/Transport/Doctrine/DoctrineTransportFactoryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;
1313

14-
use Doctrine\Common\Persistence\ConnectionRegistry;
14+
use Doctrine\Common\Persistence\ConnectionRegistry as LegacyConnectionRegistry;
1515
use Doctrine\DBAL\Schema\AbstractSchemaManager;
1616
use Doctrine\DBAL\Schema\SchemaConfig;
17+
use Doctrine\Persistence\ConnectionRegistry;
1718
use PHPUnit\Framework\TestCase;
1819
use Symfony\Component\Messenger\Transport\Doctrine\Connection;
1920
use Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport;
@@ -25,7 +26,7 @@ class DoctrineTransportFactoryTest extends TestCase
2526
public function testSupports()
2627
{
2728
$factory = new DoctrineTransportFactory(
28-
$this->createMock(ConnectionRegistry::class)
29+
$this->createMock(interface_exists(ConnectionRegistry::class) ? ConnectionRegistry::class : LegacyConnectionRegistry::class)
2930
);
3031

3132
$this->assertTrue($factory->supports('doctrine://default', []));
@@ -39,7 +40,7 @@ public function testCreateTransport()
3940
$schemaConfig = $this->createMock(SchemaConfig::class);
4041
$schemaManager->method('createSchemaConfig')->willReturn($schemaConfig);
4142
$driverConnection->method('getSchemaManager')->willReturn($schemaManager);
42-
$registry = $this->createMock(ConnectionRegistry::class);
43+
$registry = $this->createMock(interface_exists(ConnectionRegistry::class) ? ConnectionRegistry::class : LegacyConnectionRegistry::class);
4344

4445
$registry->expects($this->once())
4546
->method('getConnection')
@@ -58,7 +59,7 @@ public function testCreateTransportMustThrowAnExceptionIfManagerIsNotFound()
5859
{
5960
$this->expectException('Symfony\Component\Messenger\Exception\TransportException');
6061
$this->expectExceptionMessage('Could not find Doctrine connection from Messenger DSN "doctrine://default".');
61-
$registry = $this->createMock(ConnectionRegistry::class);
62+
$registry = $this->createMock(interface_exists(ConnectionRegistry::class) ? ConnectionRegistry::class : LegacyConnectionRegistry::class);
6263
$registry->expects($this->once())
6364
->method('getConnection')
6465
->willReturnCallback(function () {

0 commit comments

Comments
 (0)
0