59 lines
1.2 KiB
PHP
Executable File
59 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
/*
|
|
* This file is part of the Cache package.
|
|
*
|
|
* Copyright (c) Daniel González
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*
|
|
* @author Daniel González <daniel@desarrolla2.com>
|
|
*/
|
|
|
|
namespace Desarrolla2\Test\Cache\Adapter;
|
|
|
|
use Desarrolla2\Cache\Cache;
|
|
use Desarrolla2\Cache\Adapter\Predis;
|
|
|
|
/**
|
|
* PredisTest
|
|
*/
|
|
class PredisTest extends AbstractCacheTest
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setup();
|
|
if (!class_exists('\Predis\Client')) {
|
|
$this->markTestSkipped(
|
|
'The predis library is not available.'
|
|
);
|
|
}
|
|
$this->cache = new Cache(
|
|
new Predis()
|
|
);
|
|
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function dataProviderForOptions()
|
|
{
|
|
return [
|
|
['ttl', 100],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function dataProviderForOptionsException()
|
|
{
|
|
return [
|
|
['ttl', 0, '\Desarrolla2\Cache\Exception\CacheException'],
|
|
['file', 100, '\Desarrolla2\Cache\Exception\CacheException'],
|
|
];
|
|
}
|
|
}
|