Files
yii2/tests/unit/framework/caching/WinCacheTest.php
Alexander Makarov 0596fa82fd code style fixes
2013-08-13 02:43:47 +04:00

32 lines
614 B
PHP

<?php
namespace yiiunit\framework\caching;
use yii\caching\WinCache;
/**
* Class for testing wincache backend
*/
class WinCacheTest extends CacheTestCase
{
private $_cacheInstance = null;
/**
* @return WinCache
*/
protected function getCacheInstance()
{
if (!extension_loaded('wincache')) {
$this->markTestSkipped("Wincache not installed. Skipping.");
}
if (!ini_get('wincache.ucenabled')) {
$this->markTestSkipped("Wincache user cache disabled. Skipping.");
}
if ($this->_cacheInstance === null) {
$this->_cacheInstance = new WinCache();
}
return $this->_cacheInstance;
}
}