1ddc2debda9cfad8dedbe72775d3f4e9a3cef416
[yaffs-website] / vendor / symfony / http-kernel / Tests / Profiler / RedisProfilerStorageTest.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\RedisProfilerStorage;
15 use Symfony\Component\HttpKernel\Tests\Profiler\Mock\RedisMock;
16
17 /**
18  * @group legacy
19  */
20 class RedisProfilerStorageTest extends AbstractProfilerStorageTest
21 {
22     protected static $storage;
23
24     protected function setUp()
25     {
26         $redisMock = new RedisMock();
27         $redisMock->connect('127.0.0.1', 6379);
28
29         self::$storage = new RedisProfilerStorage('redis://127.0.0.1:6379', '', '', 86400);
30         self::$storage->setRedis($redisMock);
31
32         if (self::$storage) {
33             self::$storage->purge();
34         }
35     }
36
37     protected function tearDown()
38     {
39         if (self::$storage) {
40             self::$storage->purge();
41             self::$storage = false;
42         }
43     }
44
45     /**
46      * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
47      */
48     protected function getStorage()
49     {
50         return self::$storage;
51     }
52 }