msd Backup hinzugefügt
This commit is contained in:
52
msd/vendor/desarrolla2/cache/tests/PredisTest.php
vendored
Normal file
52
msd/vendor/desarrolla2/cache/tests/PredisTest.php
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
<?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;
|
||||
|
||||
use Desarrolla2\Cache\Predis as PredisCache;
|
||||
use Predis\Client;
|
||||
use Predis\Connection\ConnectionException;
|
||||
|
||||
/**
|
||||
* PredisTest
|
||||
*/
|
||||
class PredisTest extends AbstractCacheTest
|
||||
{
|
||||
/**
|
||||
* @var Client
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
public function createSimpleCache()
|
||||
{
|
||||
if (!class_exists('Predis\Client')) {
|
||||
$this->markTestSkipped('The predis library is not available');
|
||||
}
|
||||
|
||||
try {
|
||||
$this->client = new Client(CACHE_TESTS_PREDIS_DSN, ['exceptions' => false]);
|
||||
$this->client->connect();
|
||||
} catch (ConnectionException $e) {
|
||||
$this->markTestSkipped($e->getMessage());
|
||||
}
|
||||
|
||||
return new PredisCache($this->client);
|
||||
}
|
||||
|
||||
public function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
$this->client->disconnect();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user