mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 14:08:40 +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
|
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreateFileCache()
|
||||||
{
|
{
|
||||||
self::assertInstanceOf(
|
self::assertInstanceOf(
|
||||||
\phpOMS\DataStorage\Cache\Connection\FileCache::class,
|
\phpOMS\DataStorage\Cache\Connection\FileCache::class,
|
||||||
ConnectionFactory::create(['type' => CacheType::FILE, 'path' => 'Cache'])
|
ConnectionFactory::create(['type' => CacheType::FILE, 'path' => 'Cache'])
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCreateMemCached()
|
||||||
|
{
|
||||||
|
if (!extension_loaded('memcached')) {
|
||||||
|
$this->markTestSkipped(
|
||||||
|
'The Memcached extension is not available.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
self::assertInstanceOf(
|
self::assertInstanceOf(
|
||||||
\phpOMS\DataStorage\Cache\Connection\MemCached::class,
|
\phpOMS\DataStorage\Cache\Connection\MemCached::class,
|
||||||
ConnectionFactory::create(['type' => CacheType::MEMCACHED, 'data' => $GLOBALS['CONFIG']['cache']['memcached']])
|
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(
|
self::assertInstanceOf(
|
||||||
\phpOMS\DataStorage\Cache\Connection\RedisCache::class,
|
\phpOMS\DataStorage\Cache\Connection\RedisCache::class,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user