mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Split factory tests
This commit is contained in:
parent
dc65cfdb02
commit
c491d2a4ff
|
|
@ -18,17 +18,35 @@ use phpOMS\DataStorage\Cache\CacheType;
|
|||
|
||||
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCreate()
|
||||
public function testCreateFileCache()
|
||||
{
|
||||
self::assertInstanceOf(
|
||||
\phpOMS\DataStorage\Cache\Connection\FileCache::class,
|
||||
ConnectionFactory::create(['type' => CacheType::FILE, 'path' => 'Cache'])
|
||||
);
|
||||
}
|
||||
|
||||
public function testCreateMemCached()
|
||||
{
|
||||
if (!extension_loaded('memcached')) {
|
||||
$this->markTestSkipped(
|
||||
'The Memcached extension is not available.'
|
||||
);
|
||||
}
|
||||
|
||||
self::assertInstanceOf(
|
||||
\phpOMS\DataStorage\Cache\Connection\MemCached::class,
|
||||
ConnectionFactory::create(['type' => CacheType::MEMCACHED, 'data' => $GLOBALS['CONFIG']['cache']['memcached']])
|
||||
);
|
||||
}
|
||||
|
||||
public function testCreateRedisCache()
|
||||
{
|
||||
if (!extension_loaded('redis')) {
|
||||
$this->markTestSkipped(
|
||||
'The Redis extension is not available.'
|
||||
);
|
||||
}
|
||||
|
||||
self::assertInstanceOf(
|
||||
\phpOMS\DataStorage\Cache\Connection\RedisCache::class,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user