mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Update unit tests
This commit is contained in:
39
tests/Alchemy/Tests/Phrasea/Cache/FactoryTest.php
Normal file
39
tests/Alchemy/Tests/Phrasea/Cache/FactoryTest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Cache;
|
||||
|
||||
use Alchemy\Phrasea\Cache\Factory;
|
||||
|
||||
class FactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideCacheTypes
|
||||
*/
|
||||
public function testFactoryCreate($name, $extension, $expected)
|
||||
{
|
||||
if (null !== $extension && !extension_loaded($extension)) {
|
||||
$this->markTestSkipped(sprintf('Extension %s is not loaded', $extension));
|
||||
}
|
||||
|
||||
$factory = new Factory();
|
||||
$this->assertInstanceOf($expected, $factory->create($name, array()));
|
||||
}
|
||||
|
||||
public function provideCacheTypes()
|
||||
{
|
||||
return array(
|
||||
array('apc', 'apc', 'Alchemy\Phrasea\Cache\ApcCache'),
|
||||
array('apccache', 'apc', 'Alchemy\Phrasea\Cache\ApcCache'),
|
||||
array('array', null, 'Alchemy\Phrasea\Cache\ArrayCache'),
|
||||
array('arraycache', null, 'Alchemy\Phrasea\Cache\ArrayCache'),
|
||||
array('memcache', 'memcache', 'Alchemy\Phrasea\Cache\MemcacheCache'),
|
||||
array('memcachecache', 'memcache', 'Alchemy\Phrasea\Cache\MemcacheCache'),
|
||||
array('redis', 'redis', 'Alchemy\Phrasea\Cache\RedisCache'),
|
||||
array('rediscache', 'redis', 'Alchemy\Phrasea\Cache\RedisCache'),
|
||||
array('wincache', 'wincache', 'Alchemy\Phrasea\Cache\WincacheCache'),
|
||||
array('wincachecache', 'wincache', 'Alchemy\Phrasea\Cache\WincacheCache'),
|
||||
array('xcache', 'xcache', 'Alchemy\Phrasea\Cache\XcacheCache'),
|
||||
array('xcachecache', 'xcache', 'Alchemy\Phrasea\Cache\XcacheCache'),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user