Split factory tests

This commit is contained in:
Dennis Eichhorn 2018-10-06 16:00:13 +02:00
parent dc65cfdb02
commit c491d2a4ff

View File

@ -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,