public function setUp() { if (defined('SKIPPING')) { $this->markTestSkipped(); } $_SERVER['PHP_AUTH_USER'] = '******'; $_SERVER['PHP_AUTH_PW'] = '5f4dcc3b5aa765d61d8327deb882cf99'; $this->cache = new fCache(CACHE_TYPE, cache_data_store()); }
public static function setUpBeforeClass() { if (defined('SKIPPING')) { return; } if (defined('CACHE_TYPE') && function_exists('cache_data_store')) { self::$cache = new fCache(CACHE_TYPE, cache_data_store(), array('serializer' => 'string', 'unserializer' => 'string')); } }
public function testSerializerJSON() { $config = function_exists('cache_config') ? cache_config() : array(); $cache = new fCache(CACHE_TYPE, cache_data_store(), array_merge(array('serializer' => array('fJSON', 'encode'), 'unserializer' => array('fJSON', 'decode')), $config)); $cache->set('testkey', TRUE); $this->assertEquals(TRUE, $cache->get('testkey')); $cache->set('testkey', FALSE); $this->assertEquals(FALSE, $cache->get('testkey')); }