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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"require-dev": {
"dama/doctrine-test-bundle": "^8.0.1",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-bundle": "^2.17 || ^3.0",
"doctrine/mongodb-odm": "^2.4",
"doctrine/orm": "^2.14 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.4",
Expand Down
11 changes: 8 additions & 3 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Sonata\ClassificationBundle\Tests\App;

use DAMA\DoctrineTestBundle\DAMADoctrineTestBundle;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheCompatibilityPass;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Knp\Bundle\MenuBundle\KnpMenuBundle;
use Sonata\AdminBundle\SonataAdminBundle;
Expand All @@ -32,7 +33,6 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\UX\StimulusBundle\StimulusBundle;

final class AppKernel extends Kernel
Expand Down Expand Up @@ -83,8 +83,13 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
{
$loader->load(__DIR__.'/config/config.yaml');

if (!class_exists(IsGranted::class)) {
$loader->load(__DIR__.'/config/config_symfony_v5.yaml');
if (class_exists(CacheCompatibilityPass::class)) {
// doctrine-bundle v2
$container->loadFromExtension('doctrine', [
'dbal' => [
'use_savepoints' => true,
],
]);
}

/*
Expand Down
2 changes: 0 additions & 2 deletions tests/App/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ doctrine:
dbal:
driver: pdo_sqlite
path: "%app.base_dir%sonata_classification_test.db3"
# "dama/doctrine-test-bundle" relies on savepoints.
use_savepoints: true
orm:
entity_managers:
default:
Expand Down
2 changes: 0 additions & 2 deletions tests/App/config/config_symfony_v5.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions tests/custom_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@
]);
$application->run($input, new NullOutput());

$kernel->shutdown();

(new Filesystem())->remove([$kernel->getCacheDir()]);

restore_error_handler();