Skip to content

Commit 442eeac

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Fix colors for 4.4 Stand with Ukraine [Runtime] Fix passing $debug parameter to `ErrorHandler` [FrameworkBundle] Ensure container is reset between tests [HttpKernel] fix using Target with controller args reflect Cache component version dependent default value in test Remove blocking test for adding support for placeholders in EmumNode in 6.1 [FrameworkBundle] Fix compiler passes processing a container twice when it's loaded from the debug dump [HttpKernel] Fix advertizing deprecations for *TestSessionListener
2 parents aa912ac + 12d5b3b commit 442eeac

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

Command/BuildDebugContainerTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilde
5353
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
5454
$locatorPass = new ServiceLocatorTagPass();
5555
$locatorPass->process($container);
56+
57+
$container->getCompilerPassConfig()->setBeforeOptimizationPasses([]);
58+
$container->getCompilerPassConfig()->setOptimizationPasses([]);
59+
$container->getCompilerPassConfig()->setBeforeRemovingPasses([]);
5660
}
5761

5862
return $this->containerBuilder = $container;

Command/ContainerLintCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ private function getContainerBuilder(): ContainerBuilder
112112
$skippedIds[$serviceId] = true;
113113
}
114114
}
115+
116+
$container->getCompilerPassConfig()->setBeforeOptimizationPasses([]);
117+
$container->getCompilerPassConfig()->setOptimizationPasses([]);
118+
$container->getCompilerPassConfig()->setBeforeRemovingPasses([]);
115119
}
116120

117121
$container->setParameter('container.build_hash', 'lint_container');

Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function all(string $namespace = null): array
145145
*/
146146
public function getLongVersion(): string
147147
{
148-
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>)', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
148+
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>) <bg=blue;fg=yellow>#StandWith</><bg=yellow;fg=blue>Ukraine</> <href=https://sf.to/ukraine>https://sf.to/ukraine</>', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
149149
}
150150

151151
public function add(Command $command): ?Command

Test/KernelTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
1616
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1717
use Symfony\Component\HttpKernel\KernelInterface;
18+
use Symfony\Contracts\Service\ResetInterface;
1819

1920
/**
2021
* KernelTestCase is the base class for tests needing a Kernel.
@@ -141,8 +142,13 @@ protected static function ensureKernelShutdown()
141142
{
142143
if (null !== static::$kernel) {
143144
static::$kernel->boot();
145+
$container = static::$kernel->getContainer();
144146
static::$kernel->shutdown();
145147
static::$booted = false;
148+
149+
if ($container instanceof ResetInterface) {
150+
$container->reset();
151+
}
146152
}
147153
}
148154
}

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHPUnit\Framework\TestCase;
1616
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration;
1717
use Symfony\Bundle\FullStack;
18+
use Symfony\Component\Cache\Adapter\DoctrineAdapter;
1819
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
1920
use Symfony\Component\Config\Definition\Processor;
2021
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -501,7 +502,7 @@ protected static function getBundleDefaultConfig()
501502
'default_redis_provider' => 'redis://localhost',
502503
'default_memcached_provider' => 'memcached://localhost',
503504
'default_doctrine_dbal_provider' => 'database_connection',
504-
'default_pdo_provider' => ContainerBuilder::willBeAvailable('doctrine/dbal', Connection::class, ['symfony/framework-bundle']) ? 'database_connection' : null,
505+
'default_pdo_provider' => ContainerBuilder::willBeAvailable('doctrine/dbal', Connection::class, ['symfony/framework-bundle']) && class_exists(DoctrineAdapter::class) ? 'database_connection' : null,
505506
'prefix_seed' => '_%kernel.project_dir%.%kernel.container_class%',
506507
],
507508
'workflows' => [

0 commit comments

Comments
 (0)