N°8910 - Upgrade Symfony packages (#811)

This commit is contained in:
Benjamin Dalsass
2026-02-23 06:54:26 +01:00
committed by GitHub
parent b91e6c384a
commit 4853ca444e
224 changed files with 4758 additions and 1778 deletions

View File

@@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Contracts\Service\ResetInterface;
@@ -82,6 +83,18 @@ abstract class KernelTestCase extends TestCase
static::$kernel = $kernel;
static::$booted = true;
// If the cache warmer is registered, it means that the cache has been
// warmed up, so the current container is not fresh anymore. Let's
// reboot a fresh one.
if (self::getContainer()->initialized('cache_warmer')) {
static::ensureKernelShutdown();
$kernel = static::createKernel($options);
$kernel->boot();
static::$kernel = $kernel;
static::$booted = true;
}
return static::$kernel;
}
@@ -135,6 +148,11 @@ abstract class KernelTestCase extends TestCase
static::$kernel->boot();
$container = static::$kernel->getContainer();
$httpCacheDir = null;
if ($container->has('http_cache')) {
$httpCacheDir = static::$kernel->getCacheDir().'/http_cache';
}
if ($container->has('services_resetter')) {
// Instantiate the service because Container::reset() only resets services that have been used
$container->get('services_resetter');
@@ -146,6 +164,10 @@ abstract class KernelTestCase extends TestCase
if ($container instanceof ResetInterface) {
$container->reset();
}
if (null !== $httpCacheDir && is_dir($httpCacheDir)) {
(new Filesystem())->remove($httpCacheDir);
}
}
}
}