|
9 | 9 | use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; |
10 | 10 | use Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Fixtures\InvokableEntityListener; |
11 | 11 | use Doctrine\DBAL\Configuration; |
| 12 | +use Doctrine\DBAL\Connection; |
12 | 13 | use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection; |
13 | 14 | use Doctrine\DBAL\Platforms\PostgreSQLPlatform; |
| 15 | +use Doctrine\Deprecations\PHPUnit\VerifyDeprecations; |
14 | 16 | use Doctrine\ORM\EntityManager; |
15 | 17 | use Doctrine\ORM\EntityManagerInterface; |
16 | 18 | use Doctrine\ORM\Mapping\ClassMetadata; |
|
41 | 43 | use function end; |
42 | 44 | use function interface_exists; |
43 | 45 | use function is_dir; |
| 46 | +use function method_exists; |
44 | 47 | use function sprintf; |
45 | 48 | use function sys_get_temp_dir; |
46 | 49 | use function uniqid; |
|
49 | 52 |
|
50 | 53 | abstract class AbstractDoctrineExtensionTestCase extends TestCase |
51 | 54 | { |
| 55 | + use VerifyDeprecations; |
| 56 | + |
52 | 57 | abstract protected function loadFromFile(ContainerBuilder $container, string $file): void; |
53 | 58 |
|
54 | 59 | public function testDbalLoadFromXmlMultipleConnections(): void |
@@ -795,6 +800,27 @@ public function testAddFilter(): void |
795 | 800 | $this->assertCount(2, $entityManager->getFilters()->getEnabledFilters()); |
796 | 801 | } |
797 | 802 |
|
| 803 | + #[IgnoreDeprecations] |
| 804 | + public function testSettingDisableTypeCommentsWithDbal4IsDeprecated(): void |
| 805 | + { |
| 806 | + if (method_exists(Connection::class, 'getEventManager')) { |
| 807 | + self::markTestSkipped('This test requires DBAL 4.'); |
| 808 | + } |
| 809 | + |
| 810 | + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/DoctrineBundle/pull/2048'); |
| 811 | + $this->loadContainer('dbal_disable_type_comments'); |
| 812 | + } |
| 813 | + |
| 814 | + public function testSettingDisableTypeCommentsWithDbal3IsFine(): void |
| 815 | + { |
| 816 | + if (! method_exists(Connection::class, 'getEventManager')) { |
| 817 | + self::markTestSkipped('This test requires DBAL 3.'); |
| 818 | + } |
| 819 | + |
| 820 | + $this->expectNoDeprecationWithIdentifier('https://github.com/doctrine/DoctrineBundle/pull/2048'); |
| 821 | + $this->loadContainer('dbal_disable_type_comments'); |
| 822 | + } |
| 823 | + |
798 | 824 | public function testResolveTargetEntity(): void |
799 | 825 | { |
800 | 826 | if (! interface_exists(EntityManagerInterface::class)) { |
|
0 commit comments