for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of php-cache\cache-bundle package.
*
* (c) 2015-2015 Aaron Scherer <[email protected]>, Tobias Nyholm <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\CacheBundle\Tests\Functional\app;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
private $config;
public function __construct($config)
parent::__construct('test', true);
$fs = new Filesystem();
if (!$fs->isAbsolutePath($config)) {
$config = __DIR__.'/config/'.$config;
}
if (!file_exists($config)) {
throw new \RuntimeException(sprintf('The config file "%s" does not exist', $config));
$this->config = $config;
public function registerBundles()
return [
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Cache\CacheBundle\CacheBundle(),
];
public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load($this->config);
public function getCacheDir()
return sys_get_temp_dir().'/TestBundle';
public function serialize()
return $this->config;
public function unserialize($config)
$this->__construct($config);