Exemplo n.º 1
0
 public function setUp($notag = true)
 {
     if (!constant('TESTS_ZEND_CACHE_APC_ENABLED')) {
         $this->markTestSkipped('Zend_Cache APC tests not enabled');
     }
     $this->_instance = new Cache\Backend\Apc(array());
     parent::setUp($notag);
 }
Exemplo n.º 2
0
 public function setUp($notag = false)
 {
     $this->mkdir();
     $this->_cache_dir = $this->getTmpDir() . DIRECTORY_SEPARATOR;
     $this->_instance = new Cache\Backend\File(array('cache_dir' => $this->_cache_dir));
     $logger = new \Zend\Log\Logger(new \Zend\Log\Writer\Null());
     $this->_instance->setDirectives(array('logger' => $logger));
     parent::setUp($notag);
 }
Exemplo n.º 3
0
 public function testRemoveCorrectCallWithVacuum()
 {
     $this->_instance = new Cache\Backend\Sqlite(array('cache_db_complete_path' => $this->_cache_dir . 'cache.db', 'automatic_vacuum_factor' => 1));
     parent::setUp();
     $this->assertTrue($this->_instance->remove('bar'));
     $this->assertFalse($this->_instance->test('bar'));
     $this->assertFalse($this->_instance->remove('barbar'));
     $this->assertFalse($this->_instance->test('barbar'));
 }
Exemplo n.º 4
0
 public function setUp($notag = true)
 {
     if (!constant('TESTS_ZEND_CACHE_MEMCACHED_ENABLED')) {
         $this->markTestSkipped('Zend_Cache memcache adapter tests are not enabled');
     }
     $serverValid = array('host' => TESTS_ZEND_CACHE_MEMCACHED_HOST, 'port' => TESTS_ZEND_CACHE_MEMCACHED_PORT, 'persistent' => TESTS_ZEND_CACHE_MEMCACHED_PERSISTENT);
     $serverFail = array('host' => 'not.exist', 'port' => TESTS_ZEND_CACHE_MEMCACHED_PORT, 'persistent' => TESTS_ZEND_CACHE_MEMCACHED_PERSISTENT);
     $options = array('servers' => array($serverValid, $serverFail));
     $this->_instance = new Cache\Backend\Memcached($options);
     parent::setUp($notag);
 }
Exemplo n.º 5
0
 public function setUp($notag = false)
 {
     if (!constant('TESTS_ZEND_CACHE_APC_ENABLED')) {
         $this->markTestSkipped('Zend_Cache APC tests not enabled');
     }
     @mkdir($this->getTmpDir());
     $this->_cache_dir = $this->getTmpDir() . DIRECTORY_SEPARATOR;
     $slowBackend = 'File';
     $fastBackend = 'Apc';
     $slowBackendOptions = array('cache_dir' => $this->_cache_dir);
     $fastBackendOptions = array();
     $this->_instance = new Cache\Backend\TwoLevels(array('fast_backend' => $fastBackend, 'slow_backend' => $slowBackend, 'fast_backend_options' => $fastBackendOptions, 'slow_backend_options' => $slowBackendOptions));
     parent::setUp($notag);
 }