for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sil\RouteSecurityBundle\Tests;
use Sil\RouteSecurityBundle\Tests\Fixtures\AppKernel;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
abstract class WebTestCase extends BaseWebTestCase
{
protected function deleteTmpDir()
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION)) {
return;
}
$fs = new Filesystem();
$fs->remove($dir);
protected static function getContainer(): ContainerInterface
if (!static::$kernel) {
static::$kernel = static::createKernel();
static::$kernel->boot();
return static::$kernel->getContainer();
protected static function getKernelClass()
return AppKernel::class;
protected static function createKernel(array $options = array())
$class = self::getKernelClass();
return new $class(
'default',
isset($options['debug']) ? $options['debug'] : true
);
public function setUp(): void
parent::setUp();
$this->deleteTmpDir();