minor #16009 [HttpKernel] change a class in tests to avoid depending on SQLite (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

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

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

d6a7517 [HttpKernel] change a class in tests to avoid depending on SQLite
This commit is contained in:
Fabien Potencier 2015-09-30 09:50:05 +02:00
commit 5e46485b83
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();
}