Skip to content

Commit c1c23b8

Browse files
authored
Merge 4.x into 5.x
2 parents bc6b53b + 6590a47 commit c1c23b8

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"require-dev": {
4444
"dama/doctrine-test-bundle": "^8.0.1",
45-
"doctrine/doctrine-bundle": "^2.7",
45+
"doctrine/doctrine-bundle": "^2.17 || ^3.0",
4646
"doctrine/mongodb-odm": "^2.4",
4747
"doctrine/orm": "^2.14 || ^3.0",
4848
"friendsofphp/php-cs-fixer": "^3.4",

tests/App/AppKernel.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace Sonata\ClassificationBundle\Tests\App;
1515

1616
use DAMA\DoctrineTestBundle\DAMADoctrineTestBundle;
17+
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheCompatibilityPass;
1718
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
1819
use Knp\Bundle\MenuBundle\KnpMenuBundle;
1920
use Sonata\AdminBundle\SonataAdminBundle;
@@ -32,7 +33,6 @@
3233
use Symfony\Component\DependencyInjection\ContainerBuilder;
3334
use Symfony\Component\HttpKernel\Kernel;
3435
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
35-
use Symfony\Component\Security\Http\Attribute\IsGranted;
3636
use Symfony\UX\StimulusBundle\StimulusBundle;
3737

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

86-
if (!class_exists(IsGranted::class)) {
87-
$loader->load(__DIR__.'/config/config_symfony_v5.yaml');
86+
if (class_exists(CacheCompatibilityPass::class)) {
87+
// doctrine-bundle v2
88+
$container->loadFromExtension('doctrine', [
89+
'dbal' => [
90+
'use_savepoints' => true,
91+
],
92+
]);
8893
}
8994

9095
/*

tests/App/config/config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ doctrine:
3737
dbal:
3838
driver: pdo_sqlite
3939
path: "%app.base_dir%sonata_classification_test.db3"
40-
# "dama/doctrine-test-bundle" relies on savepoints.
41-
use_savepoints: true
4240
orm:
4341
entity_managers:
4442
default:

tests/App/config/config_symfony_v5.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/custom_bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@
3838
]);
3939
$application->run($input, new NullOutput());
4040

41+
$kernel->shutdown();
42+
4143
(new Filesystem())->remove([$kernel->getCacheDir()]);
44+
45+
restore_error_handler();

0 commit comments

Comments
 (0)