assertEquals('Zend_Cache_Core', get_class($generated_frontend)); } public function testFactoryCorrectCallWithCustomBackend() { $generated_frontend = Zend_Cache::factory('Core', 'FooBarTest', array(), array(), false, false, true); $this->assertEquals('Zend_Cache_Core', get_class($generated_frontend)); } public function testFactoryCorrectCallWithCustomBackend2() { $generated_frontend = Zend_Cache::factory('Core', 'FooBarTestBackend', array(), array(), false, true, true); $this->assertEquals('Zend_Cache_Core', get_class($generated_frontend)); } public function testFactoryCorrectCallWithCustomFrontend() { $generated_frontend = Zend_Cache::factory('FooBarTest', 'File', array(), array(), false, false, true); $this->assertEquals('Zend_Cache_Frontend_FooBarTest', get_class($generated_frontend)); } public function testFactoryCorrectCallWithCustomFrontend2() { $generated_frontend = Zend_Cache::factory('FooBarTestFrontend', 'File', array(), array(), true, false, true); $this->assertEquals('FooBarTestFrontend', get_class($generated_frontend)); } public function testFactoryLoadsPlatformBackend() { try { $cache = Zend_Cache::factory('Core', 'Zend-Platform'); } catch (Zend_Cache_Exception $e) { $message = $e->getMessage(); if (strstr($message, 'Incorrect backend')) { $this->fail('Zend Platform is a valid backend'); } } } public function testBadFrontend() { try { Zend_Cache::factory('badFrontend', 'File'); } catch (Zend_Exception $e) { return; } $this->fail('Zend_Exception was expected but not thrown'); } public function testBadBackend() { try { Zend_Cache::factory('Output', 'badBackend'); } catch (Zend_Exception $e) { return; } $this->fail('Zend_Exception was expected but not thrown'); } }