1 | <?php |
||
9 | abstract class BaseCacheTest extends TestCase |
||
10 | { |
||
11 | /** |
||
12 | * @var \ByJG\Cache\Psr16\BaseCacheEngine |
||
13 | */ |
||
14 | protected $cacheEngine = null; |
||
15 | |||
16 | protected function setUp() |
||
17 | { |
||
18 | |||
19 | } |
||
20 | |||
21 | protected function tearDown() |
||
22 | { |
||
23 | $this->cacheEngine->clear(); |
||
24 | $this->cacheEngine = null; |
||
25 | } |
||
26 | |||
27 | public function CachePoolProvider() |
||
28 | { |
||
29 | $memcachedServer = ['memcached-container:11211']; |
||
30 | $redisCacheServer = 'redis-container:6379'; |
||
31 | $redisPassword = ''; |
||
32 | |||
33 | return [ |
||
34 | 'Array' => [ |
||
35 | new \ByJG\Cache\Psr16\ArrayCacheEngine() |
||
36 | ], |
||
37 | 'FileSystem' => [ |
||
38 | new \ByJG\Cache\Psr16\FileSystemCacheEngine() |
||
39 | ], |
||
40 | 'ShmopCache' => [ |
||
41 | new \ByJG\Cache\Psr16\ShmopCacheEngine() |
||
42 | ], |
||
43 | 'SessionCache' => [ |
||
44 | new \ByJG\Cache\Psr16\SessionCacheEngine() |
||
45 | ], |
||
46 | 'NoCacheEngine' => [ |
||
47 | new \ByJG\Cache\Psr16\NoCacheEngine() |
||
48 | ], |
||
49 | 'Memcached' => [ |
||
50 | new \ByJG\Cache\Psr16\MemcachedEngine($memcachedServer) |
||
51 | ], |
||
52 | 'Redis' => [ |
||
53 | new \ByJG\Cache\Psr16\RedisCacheEngine($redisCacheServer, $redisPassword) |
||
54 | ] |
||
55 | ]; |
||
56 | } |
||
57 | } |
||
58 |