[HttpKernel] change a class in tests to avoid depending on SQLite

This commit is contained in:
Fabien Potencier 2015-09-30 08:34:42 +02:00
parent d8dc8f27fd
commit d6a7517923
1 changed files with 2 additions and 6 deletions

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\HttpKernel\Tests\Profiler;
use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector;
use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
use Symfony\Component\HttpKernel\Profiler\FileProfilerStorage;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@ -60,16 +60,12 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
$this->markTestSkipped('This test requires SQLite support in your environment');
}
$this->tmp = tempnam(sys_get_temp_dir(), 'sf2_profiler');
if (file_exists($this->tmp)) {
@unlink($this->tmp);
}
$this->storage = new SqliteProfilerStorage('sqlite:'.$this->tmp);
$this->storage = new FileProfilerStorage('file:'.$this->tmp);
$this->storage->purge();
}