Use ConnectionRegistry instead of RegistryInterface.

This commit is contained in:
Alexander M. Turek 2019-07-04 02:03:26 +02:00
parent b79a1bf229
commit ce6a5ad235
3 changed files with 6 additions and 7 deletions

View File

@ -11,8 +11,8 @@
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;
use Doctrine\Common\Persistence\ConnectionRegistry;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\Messenger\Transport\Doctrine\Connection;
use Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport;
use Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransportFactory;
@ -23,7 +23,7 @@ class DoctrineTransportFactoryTest extends TestCase
public function testSupports()
{
$factory = new DoctrineTransportFactory(
$this->getMockBuilder(RegistryInterface::class)->getMock()
$this->getMockBuilder(ConnectionRegistry::class)->getMock()
);
$this->assertTrue($factory->supports('doctrine://default', []));
@ -35,7 +35,7 @@ class DoctrineTransportFactoryTest extends TestCase
$connection = $this->getMockBuilder(\Doctrine\DBAL\Connection::class)
->disableOriginalConstructor()
->getMock();
$registry = $this->getMockBuilder(RegistryInterface::class)->getMock();
$registry = $this->getMockBuilder(ConnectionRegistry::class)->getMock();
$registry->expects($this->once())
->method('getConnection')
->willReturn($connection);
@ -55,7 +55,7 @@ class DoctrineTransportFactoryTest extends TestCase
*/
public function testCreateTransportMustThrowAnExceptionIfManagerIsNotFound()
{
$registry = $this->getMockBuilder(RegistryInterface::class)->getMock();
$registry = $this->getMockBuilder(ConnectionRegistry::class)->getMock();
$registry->expects($this->once())
->method('getConnection')
->willReturnCallback(function () {

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Messenger\Transport\Doctrine;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Doctrine\Common\Persistence\ConnectionRegistry;
use Symfony\Component\Messenger\Exception\TransportException;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
@ -24,7 +24,7 @@ class DoctrineTransportFactory implements TransportFactoryInterface
{
private $registry;
public function __construct(RegistryInterface $registry)
public function __construct(ConnectionRegistry $registry)
{
$this->registry = $registry;
}

View File

@ -25,7 +25,6 @@
"symfony/console": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4.19|^4.1.8|^5.0",
"symfony/error-catcher": "^4.4|^5.0",
"symfony/doctrine-bridge": "^3.4|^4.0|^5.0",
"symfony/event-dispatcher": "^4.3|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/process": "^3.4|^4.0|^5.0",