Files
archived-stimulus-bundle/tests/StimulusIntegrationTestKernel.php
2024-06-25 11:04:53 +02:00

64 lines
1.6 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\UX\StimulusBundle\Tests;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\UX\StimulusBundle\StimulusBundle;
final class StimulusIntegrationTestKernel extends Kernel
{
use MicroKernelTrait;
public function __construct()
{
parent::__construct('test', true);
}
public function registerBundles(): array
{
return [
new FrameworkBundle(),
new TwigBundle(),
new StimulusBundle(),
];
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$frameworkConfig = [
'secret' => 'foo',
'test' => true,
];
if (self::VERSION_ID >= 60100) {
$frameworkConfig['http_method_override'] = true;
}
$container->loadFromExtension('framework', $frameworkConfig);
$container->loadFromExtension('twig');
}
public function getCacheDir(): string
{
return sys_get_temp_dir().'/cache'.spl_object_hash($this);
}
public function getLogDir(): string
{
return sys_get_temp_dir().'/logs'.spl_object_hash($this);
}
}