55994f7cf4a4a60ce69944ed8ef5fd3465d87a4e
[yaffs-website] / vendor / symfony / http-kernel / Tests / Profiler / SqliteProfilerStorageTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\HttpKernel\Tests\Profiler;
13
14 use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
15
16 /**
17  * @group legacy
18  * @requires extension pdo_sqlite
19  */
20 class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
21 {
22     private $dbFile;
23     private $storage;
24
25     protected function setUp()
26     {
27         $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_storage');
28         if (file_exists($this->dbFile)) {
29             @unlink($this->dbFile);
30         }
31         $this->storage = new SqliteProfilerStorage('sqlite:'.$this->dbFile);
32
33         $this->storage->purge();
34     }
35
36     protected function tearDown()
37     {
38         @unlink($this->dbFile);
39     }
40
41     /**
42      * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
43      */
44     protected function getStorage()
45     {
46         return $this->storage;
47     }
48 }