Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions tests/Functional/MappingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand Down
Loading