From 4eb7e373413b3d1c3934c83b756b63ef5841ec1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 13 Nov 2024 19:12:57 +0100 Subject: [PATCH] Allow data-fixtures v2 The interfaces introduced in 1.5.0 allow to test without mocking a final class. --- composer.json | 4 ++-- tests/IntegrationTest.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 2fe882e..371829d 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "doctrine/data-fixtures": "^1.3", + "doctrine/data-fixtures": "^1.5|^2.0", "doctrine/doctrine-bundle": "^2.2", "doctrine/orm": "^2.14.0 || ^3.0", "doctrine/persistence": "^2.4|^3.0", @@ -29,7 +29,7 @@ "symfony/console": "^5.4|^6.0|^7.0", "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/doctrine-bridge": "^5.4|^6.0|^7.0", + "symfony/doctrine-bridge": "^5.4.48|^6.4.16|^7.1.9", "symfony/http-kernel": "^5.4|^6.0|^7.0" }, "require-dev": { diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 19e67fc..2df01c8 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -14,7 +14,7 @@ use Doctrine\Bundle\FixturesBundle\Tests\Fixtures\FooBundle\DataFixtures\RequiredConstructorArgsFixtures; use Doctrine\Bundle\FixturesBundle\Tests\Fixtures\FooBundle\DataFixtures\WithDeepDependenciesFixtures; use Doctrine\Bundle\FixturesBundle\Tests\Fixtures\FooBundle\DataFixtures\WithDependenciesFixtures; -use Doctrine\Common\DataFixtures\Purger\ORMPurger; +use Doctrine\Common\DataFixtures\Purger\ORMPurgerInterface; use Doctrine\Common\EventManager; use Doctrine\DBAL\Connection; use Doctrine\ORM\EntityManagerInterface; @@ -304,7 +304,7 @@ public function testRunCommandWithDefaultPurger(): void $container->set('doctrine', $registry); $purgerFactory = $this->createMock(PurgerFactory::class); - $purger = $this->createMock(ORMPurger::class); + $purger = $this->createMock(ORMPurgerInterface::class); $purgerFactory ->expects(self::once()) ->method('createForEntityManager') @@ -351,7 +351,7 @@ public function testRunCommandWithPurgeExclusions(): void $container->set('doctrine', $registry); $purgerFactory = $this->createMock(PurgerFactory::class); - $purger = $this->createMock(ORMPurger::class); + $purger = $this->createMock(ORMPurgerInterface::class); $purgerFactory ->expects(self::once()) ->method('createForEntityManager') @@ -401,7 +401,7 @@ public function testRunCommandWithCustomPurgerAndCustomEntityManager(): void $container->set('doctrine', $registry); $purgerFactory = $this->createMock(PurgerFactory::class); - $purger = $this->createMock(ORMPurger::class); + $purger = $this->createMock(ORMPurgerInterface::class); $purgerFactory ->expects(self::once()) ->method('createForEntityManager') @@ -448,7 +448,7 @@ public function testRunCommandWithPurgeMode(): void $container->set('doctrine', $registry); $purgerFactory = $this->createMock(PurgerFactory::class); - $purger = $this->createMock(ORMPurger::class); + $purger = $this->createMock(ORMPurgerInterface::class); $purgerFactory ->expects(self::once()) ->method('createForEntityManager')