public function testRemovePageCallsPageCacheRemoveRecursiveMethodCorrectly() { $helper = new Zend_Controller_Action_Helper_Cache(); $cache = new Mock_Zend_Cache_Page_1(); $backend = new Mock_Zend_Cache_Page_2(); $cache->setBackend($backend); $helper->setCache('page', $cache); $this->assertEquals('verified', $helper->removePage('/foo', true)); }
/** * @group ZF-11885 * @dataProvider dataprovider_testEncodedCacheIdsAreUsedConsistently */ public function testRemovePageAcceptsPreEncodedCacheIds($recursive) { $helper = new Zend_Controller_Action_Helper_Cache(); $cache = new Mock_Zend_Cache_Page_TestingEncodedCacheId(); $helper->setCache('page', $cache); $helper->direct(array('baz')); $helper->preDispatch(); $uriKey = bin2hex($this->request->getRequestUri()); // Ensure that remove method will accept pre-encoded key $helper->removePage($uriKey, $recursive); $this->assertFalse(isset($cache->items[$uriKey])); }