Esempio n. 1
0
 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'));
     }
 }
Esempio n. 3
0
 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'));
 }