Skip to content

Commit 8effdf7

Browse files
authored
ci: lowest tests object_mapper framework bundle (#7604)
1 parent 01fd0b5 commit 8effdf7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
use Doctrine\Persistence\ManagerRegistry;
5151
use PHPStan\PhpDocParser\Parser\PhpDocParser;
5252
use Ramsey\Uuid\Uuid;
53+
use Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand;
5354
use Symfony\Bundle\FrameworkBundle\Controller\ControllerHelper;
5455
use Symfony\Component\Config\FileLocator;
5556
use Symfony\Component\Config\Resource\DirectoryResource;
@@ -177,7 +178,8 @@ public function load(array $configs, ContainerBuilder $container): void
177178
$this->registerLinkSecurityConfiguration($loader, $config);
178179
$this->registerJsonStreamerConfiguration($container, $loader, $formats, $config);
179180

180-
if (class_exists(ObjectMapper::class)) {
181+
// TranslationExtractCommand was introduced in framework-bundle/7.3 with the object mapper service
182+
if (class_exists(ObjectMapper::class) && class_exists(TranslationExtractCommand::class)) {
181183
$loader->load('state/object_mapper.php');
182184
}
183185
$container->registerForAutoconfiguration(FilterInterface::class)

tests/Functional/MappingTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ public function testGetSingleBookDto(): void
301301
$this->markTestSkipped('MongoDB not tested.');
302302
}
303303

304+
if (!$this->getContainer()->has('api_platform.object_mapper')) {
305+
$this->markTestSkipped('ObjectMapper not installed');
306+
}
307+
304308
$this->recreateSchema([Book::class]);
305309
$this->loadBookFixtures();
306310

@@ -320,6 +324,10 @@ public function testGetCollectionBookDtoPaginated(): void
320324
$this->markTestSkipped('MongoDB not tested.');
321325
}
322326

327+
if (!$this->getContainer()->has('api_platform.object_mapper')) {
328+
$this->markTestSkipped('ObjectMapper not installed');
329+
}
330+
323331
$this->recreateSchema([Book::class]);
324332
$this->loadBookFixtures();
325333

@@ -339,6 +347,10 @@ public function testGetCollectionBookDtoUnpaginated(): void
339347
$this->markTestSkipped('MongoDB not tested.');
340348
}
341349

350+
if (!$this->getContainer()->has('api_platform.object_mapper')) {
351+
$this->markTestSkipped('ObjectMapper not installed');
352+
}
353+
342354
$this->recreateSchema([Book::class]);
343355
$this->loadBookFixtures();
344356

0 commit comments

Comments
 (0)