diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f1bcd141..970ad3cd 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -30,6 +30,8 @@ jobs: - "stable" symfony-require: - "" + remove-orm: + - false include: # Tests the lowest set of dependencies - dependencies: "lowest" @@ -46,6 +48,12 @@ jobs: dependencies: "highest" php-version: "8.2" + # DBAL only without ORM + - php-version: "8.2" + dependencies: "highest" + stability: "stable" + remove-orm: true + # Bleeding edge - php-version: "8.2" dependencies: "highest" @@ -76,6 +84,10 @@ jobs: run: "composer config minimum-stability stable" if: "${{ matrix.stability == 'stable' }}" + - name: "Remove doctrine/orm" + run: "composer remove doctrine/orm --dev --no-update" + if: "${{ matrix.remove-orm }}" + - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" with: diff --git a/Tests/DataCollector/DoctrineDataCollectorTest.php b/Tests/DataCollector/DoctrineDataCollectorTest.php index f4f2aa00..4828ea24 100644 --- a/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -15,9 +15,9 @@ use Symfony\Bridge\Doctrine\Middleware\Debug\DebugDataHolder; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Kernel; use function interface_exists; +use function method_exists; class DoctrineDataCollectorTest extends TestCase { @@ -133,7 +133,7 @@ public function testGetGroupedQueries(): void /** @group legacy */ public function testGetGroupedQueriesWithDeprecatedDebugStackLogger(): void { - if (Kernel::VERSION_ID >= 70000) { + if (! method_exists(DoctrineDataCollector::class, 'addLogger')) { $this->markTestSkipped('This test requires symfony < 7.0'); } diff --git a/Tests/DependencyInjection/DoctrineExtensionTest.php b/Tests/DependencyInjection/DoctrineExtensionTest.php index 973b00cb..9b64c5b9 100644 --- a/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -850,6 +850,10 @@ public function testAnnotationsBundleMappingDetection(): void /** @requires PHP 8 */ public function testAttributesBundleMappingDetection(): void { + if (! interface_exists(EntityManagerInterface::class)) { + self::markTestSkipped('This test requires ORM'); + } + $container = $this->getContainer(['AttributesBundle']); $extension = new DoctrineExtension(); @@ -1204,6 +1208,10 @@ public static function cacheConfigurationProvider(): array /** @requires PHP 8 */ public function testAsEntityListenerAttribute() { + if (! interface_exists(EntityManagerInterface::class)) { + self::markTestSkipped('This test requires ORM'); + } + $container = $this->getContainer(); $extension = new DoctrineExtension(); @@ -1238,6 +1246,10 @@ public function testAsEntityListenerAttribute() /** @requires PHP 8 */ public function testAsDoctrineListenerAttribute() { + if (! interface_exists(EntityManagerInterface::class)) { + self::markTestSkipped('This test requires ORM'); + } + $container = $this->getContainer(); $extension = new DoctrineExtension(); @@ -1271,7 +1283,7 @@ public function testRegistrationsWithMiddlewaresAndSfDebugMiddleware(): void $container = $this->getContainer(); $extension = new DoctrineExtension(); - $config = BundleConfigurationBuilder::createBuilderWithBaseValues() + $config = BundleConfigurationBuilder::createBuilder() ->addConnection([ 'connections' => [ 'conn1' => [ @@ -1293,7 +1305,6 @@ public function testRegistrationsWithMiddlewaresAndSfDebugMiddleware(): void ], ], ]) - ->addBaseEntityManager() ->build(); $extension->load([$config], $container); @@ -1341,7 +1352,7 @@ public function testDefinitionsToLogAndProfile(): void $container = $this->getContainer(); $extension = new DoctrineExtension(); - $config = BundleConfigurationBuilder::createBuilderWithBaseValues() + $config = BundleConfigurationBuilder::createBuilder() ->addConnection([ 'connections' => [ 'conn1' => [ @@ -1356,7 +1367,6 @@ public function testDefinitionsToLogAndProfile(): void ], ], ]) - ->addBaseEntityManager() ->build(); $extension->load([$config], $container); @@ -1395,7 +1405,7 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void $container = $this->getContainer(); $extension = new DoctrineExtension(); - $config = BundleConfigurationBuilder::createBuilderWithBaseValues() + $config = BundleConfigurationBuilder::createBuilder() ->addConnection([ 'connections' => [ 'conn' => [ @@ -1404,7 +1414,6 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void ], ], ]) - ->addBaseEntityManager() ->build(); $extension->load([$config], $container); @@ -1421,6 +1430,10 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void */ public function testControllerResolver(bool $simpleEntityManagerConfig): void { + if (! interface_exists(EntityManagerInterface::class)) { + self::markTestSkipped('This test requires ORM'); + } + $container = $this->getContainer(); $extension = new DoctrineExtension(); $config = BundleConfigurationBuilder::createBuilderWithBaseValues()->build(); diff --git a/Tests/DependencyInjection/Fixtures/TestKernel.php b/Tests/DependencyInjection/Fixtures/TestKernel.php index 5ef053cc..7bcf1999 100644 --- a/Tests/DependencyInjection/Fixtures/TestKernel.php +++ b/Tests/DependencyInjection/Fixtures/TestKernel.php @@ -42,7 +42,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void $container->loadFromExtension('framework', [ 'secret' => 'F00', 'http_method_override' => false, - 'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 60400, + 'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID < 60400, 'php_errors' => ['log' => true], ] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : [])); $container->loadFromExtension('doctrine', [ diff --git a/Tests/ProfilerTest.php b/Tests/ProfilerTest.php index 91d99f87..1f53d840 100644 --- a/Tests/ProfilerTest.php +++ b/Tests/ProfilerTest.php @@ -102,6 +102,7 @@ public function testRender(): void 'collector' => $this->collector, 'queries' => $this->debugDataHolder->getData(), 'profiler_markup_version' => 3, + 'profile_type' => 'request', ]); $expectedEscapedSql = 'SELECT * FROM foo WHERE bar IN (?, ?) AND "" >= ""';