fixed functional tests so that the cache/logs are specific to one version of Symfony (to avoid weird side effects)

This commit is contained in:
Fabien Potencier 2011-12-17 11:02:17 +01:00
parent 8579c6314b
commit f03692a507
4 changed files with 8 additions and 6 deletions

View File

@ -13,6 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Component\HttpKernel\Util\Filesystem;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\HttpKernel\Kernel;
class WebTestCase extends BaseWebTestCase
{
@ -33,7 +34,7 @@ class WebTestCase extends BaseWebTestCase
protected function deleteTmpDir($testCase)
{
if (!file_exists($dir = sys_get_temp_dir().'/'.$testCase)) {
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) {
return;
}

View File

@ -80,12 +80,12 @@ class AppKernel extends Kernel
public function getCacheDir()
{
return sys_get_temp_dir().'/'.$this->testCase.'/cache/'.$this->environment;
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment;
}
public function getLogDir()
{
return sys_get_temp_dir().'/'.$this->testCase.'/logs';
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)

View File

@ -13,6 +13,7 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use Symfony\Component\HttpKernel\Util\Filesystem;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\HttpKernel\Kernel;
class WebTestCase extends BaseWebTestCase
{
@ -33,7 +34,7 @@ class WebTestCase extends BaseWebTestCase
protected function deleteTmpDir($testCase)
{
if (!file_exists($dir = sys_get_temp_dir().'/'.$testCase)) {
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) {
return;
}

View File

@ -80,12 +80,12 @@ class AppKernel extends Kernel
public function getCacheDir()
{
return sys_get_temp_dir().'/'.$this->testCase.'/cache/'.$this->environment;
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment;
}
public function getLogDir()
{
return sys_get_temp_dir().'/'.$this->testCase.'/logs';
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)