From f2d9f75ddc1513a21d983db9daecf23a730b6c9e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 9 Mar 2026 16:27:19 +0100 Subject: [PATCH 1/2] Allow running the test-suite when mongo extension is not loaded --- .../ODM/DocumentManagerTypeInferenceTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php b/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php index a5ff018d..4c47ef25 100644 --- a/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php +++ b/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php @@ -3,6 +3,7 @@ namespace PHPStan\DoctrineIntegration\ODM; use PHPStan\Testing\TypeInferenceTestCase; +use function extension_loaded; use const PHP_VERSION_ID; final class DocumentManagerTypeInferenceTest extends TypeInferenceTestCase @@ -10,6 +11,10 @@ final class DocumentManagerTypeInferenceTest extends TypeInferenceTestCase public function dataFileAsserts(): iterable { + if (!extension_loaded('mongo')) { + self::markTestSkipped('MongoDB extension is not installed.'); + } + yield from $this->gatherAssertTypes(__DIR__ . '/data/documentManagerDynamicReturn.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/documentRepositoryDynamicReturn.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/documentManagerMergeReturn.php'); From 5d194c674885e141936efbfa54def51520679b93 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 9 Mar 2026 16:34:23 +0100 Subject: [PATCH 2/2] Update DocumentManagerTypeInferenceTest.php --- .../ODM/DocumentManagerTypeInferenceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php b/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php index 4c47ef25..50f7e04f 100644 --- a/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php +++ b/tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.php @@ -11,7 +11,7 @@ final class DocumentManagerTypeInferenceTest extends TypeInferenceTestCase public function dataFileAsserts(): iterable { - if (!extension_loaded('mongo')) { + if (!extension_loaded('mongodb')) { self::markTestSkipped('MongoDB extension is not installed.'); }