markTestSkipped('Memcached is not installed, skipping test'); return; } $serverValid = array( 'host' => TESTS_ZEND_CACHE_LIBMEMCACHED_HOST, 'port' => TESTS_ZEND_CACHE_LIBMEMCACHED_PORT, 'weight' => TESTS_ZEND_CACHE_LIBMEMCACHED_WEIGHT ); $options = array( 'servers' => array($serverValid), 'client' => array( 'no_block' => false, // set Memcached client option by name Memcached::OPT_TCP_NODELAY => false, // set Memcached client option by value ), ); $this->_instance = new Zend_Cache_Backend_Libmemcached($options); parent::setUp($notag); } public function tearDown() { parent::tearDown(); $this->_instance = null; // We have to wait after a memcached flush sleep(1); } public function testConstructorCorrectCall() { $test = new Zend_Cache_Backend_Libmemcached(); } public function testCleanModeOld() { $this->_instance->setDirectives(array('logging' => false)); $this->_instance->clean('old'); // do nothing, just to see if an error occured $this->_instance->setDirectives(array('logging' => true)); } public function testCleanModeMatchingTags() { $this->_instance->setDirectives(array('logging' => false)); $this->_instance->clean('matchingTag', array('tag1')); // do nothing, just to see if an error occured $this->_instance->setDirectives(array('logging' => true)); } public function testCleanModeNotMatchingTags() { $this->_instance->setDirectives(array('logging' => false)); $this->_instance->clean('notMatchingTag', array('tag1')); // do nothing, just to see if an error occured $this->_instance->setDirectives(array('logging' => true)); } public function testGetWithCompression() { $this->_instance->setOption('compression', true); $this->testGetWithAnExistingCacheIdAndUTFCharacters(); } public function testConstructorWithAnAlternativeSyntax() { $server = array( 'host' => TESTS_ZEND_CACHE_LIBMEMCACHED_HOST, 'port' => TESTS_ZEND_CACHE_LIBMEMCACHED_PORT, 'weight' => TESTS_ZEND_CACHE_LIBMEMCACHED_WEIGHT ); $options = array( 'servers' => $server ); $this->_instance = new Zend_Cache_Backend_Libmemcached($options); $this->testGetWithAnExistingCacheIdAndUTFCharacters(); } // Because of limitations of this backend... public function testGetWithAnExpiredCacheId() {} public function testCleanModeMatchingTags2() {} public function testCleanModeNotMatchingTags2() {} public function testCleanModeNotMatchingTags3() {} public function testSaveCorrectCall() { $this->_instance->setDirectives(array('logging' => false)); parent::testSaveCorrectCall(); $this->_instance->setDirectives(array('logging' => true)); } public function testSaveWithNullLifeTime() { $this->_instance->setDirectives(array('logging' => false)); parent::testSaveWithNullLifeTime(); $this->_instance->setDirectives(array('logging' => true)); } public function testSaveWithSpecificLifeTime() { $this->_instance->setDirectives(array('logging' => false)); parent::testSaveWithSpecificLifeTime(); $this->_instance->setDirectives(array('logging' => true)); } public function testGetMetadatas($notag = false) { parent::testGetMetadatas(true); } public function testGetFillingPercentage() { $this->_instance->setDirectives(array('logging' => false)); parent::testGetFillingPercentage(); } public function testGetFillingPercentageOnEmptyBackend() { $this->_instance->setDirectives(array('logging' => false)); parent::testGetFillingPercentageOnEmptyBackend(); } }