From 8ac2440c6ac63bb40fe89c99072abf6d64ac6663 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 11 Dec 2025 11:07:55 +0100 Subject: [PATCH 1/2] ci: lowest tests object_mapper framework bundle --- .../Bundle/DependencyInjection/ApiPlatformExtension.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php index 4596aa74b3..3e1d3fff03 100644 --- a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php +++ b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php @@ -50,6 +50,7 @@ use Doctrine\Persistence\ManagerRegistry; use PHPStan\PhpDocParser\Parser\PhpDocParser; use Ramsey\Uuid\Uuid; +use Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand; use Symfony\Bundle\FrameworkBundle\Controller\ControllerHelper; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Resource\DirectoryResource; @@ -177,7 +178,8 @@ public function load(array $configs, ContainerBuilder $container): void $this->registerLinkSecurityConfiguration($loader, $config); $this->registerJsonStreamerConfiguration($container, $loader, $formats, $config); - if (class_exists(ObjectMapper::class)) { + // TranslationExtractCommand was introduced in framework-bundle/7.3 with the object mapper service + if (class_exists(ObjectMapper::class) && class_exists(TranslationExtractCommand::class)) { $loader->load('state/object_mapper.php'); } $container->registerForAutoconfiguration(FilterInterface::class) From 74eba29f2e39a7c2dceaf0fab52efc95090edfc8 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 11 Dec 2025 11:35:46 +0100 Subject: [PATCH 2/2] ignore some tests --- tests/Functional/MappingTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Functional/MappingTest.php b/tests/Functional/MappingTest.php index d697ae202d..28f68418c6 100644 --- a/tests/Functional/MappingTest.php +++ b/tests/Functional/MappingTest.php @@ -301,6 +301,10 @@ public function testGetSingleBookDto(): void $this->markTestSkipped('MongoDB not tested.'); } + if (!$this->getContainer()->has('api_platform.object_mapper')) { + $this->markTestSkipped('ObjectMapper not installed'); + } + $this->recreateSchema([Book::class]); $this->loadBookFixtures(); @@ -320,6 +324,10 @@ public function testGetCollectionBookDtoPaginated(): void $this->markTestSkipped('MongoDB not tested.'); } + if (!$this->getContainer()->has('api_platform.object_mapper')) { + $this->markTestSkipped('ObjectMapper not installed'); + } + $this->recreateSchema([Book::class]); $this->loadBookFixtures(); @@ -339,6 +347,10 @@ public function testGetCollectionBookDtoUnpaginated(): void $this->markTestSkipped('MongoDB not tested.'); } + if (!$this->getContainer()->has('api_platform.object_mapper')) { + $this->markTestSkipped('ObjectMapper not installed'); + } + $this->recreateSchema([Book::class]); $this->loadBookFixtures();