WinCacheTest.php 614 Bytes
Newer Older
1 2
<?php
namespace yiiunit\framework\caching;
Alexander Makarov committed
3

Alexander Makarov committed
4
use yii\caching\WinCache;
5 6 7 8

/**
 * Class for testing wincache backend
 */
Alexander Makarov committed
9
class WinCacheTest extends CacheTestCase
10 11 12 13 14 15 16 17
{
	private $_cacheInstance = null;

	/**
	 * @return WinCache
	 */
	protected function getCacheInstance()
	{
resurtm committed
18
		if (!extension_loaded('wincache')) {
19 20 21
			$this->markTestSkipped("Wincache not installed. Skipping.");
		}

resurtm committed
22
		if (!ini_get('wincache.ucenabled')) {
23 24 25
			$this->markTestSkipped("Wincache user cache disabled. Skipping.");
		}

resurtm committed
26
		if ($this->_cacheInstance === null) {
27 28 29 30
			$this->_cacheInstance = new WinCache();
		}
		return $this->_cacheInstance;
	}
Zander Baldwin committed
31
}