Пример #1
0
 public function testPreDispatchDoesNotCallCachesStartMethodWithBadAction()
 {
     $helper = new Zend_Controller_Action_Helper_Cache();
     $cache = new Mock_Zend_Cache_Page_4();
     $helper->setCache('page', $cache);
     $helper->preDispatch();
     $this->assertNotEquals('verified', $cache->res);
 }
Пример #2
0
 /**
  * @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]));
 }