Example #1
0
 function it_clearCache(CacheManager $cache)
 {
     $cache_ptr = function () use($cache) {
         $cache->clearByTags('test')->shouldBeCalled()->willReturn(null);
         return $cache->getWrappedObject();
     };
     DICService::update('cache', $cache_ptr);
     $this->clearCache();
     DICService::delete('cache');
 }
Example #2
0
 function it_validateAndAfter(EventManager $event, ZendSearchManager $zendsearch, CacheManager $cache)
 {
     $zendsearch->delete(Argument::any())->shouldBeCalled();
     $event->fire('OnBeforeTestDelete', Argument::any(), true)->shouldBeCalled()->willReturn(true);
     $event->fire('OnAfterTestDelete', Argument::any(), true)->shouldBeCalled()->willReturn(true);
     $cache->clearByTags('test')->shouldBeCalled()->willReturn(null);
     DICService::update('cache', function () use($cache) {
         return $cache->getWrappedObject();
     });
     DICService::update('zend_search', function () use($zendsearch) {
         return $zendsearch->getWrappedObject();
     });
     DICService::update('event', function () use($event) {
         return $event->getWrappedObject();
     });
     $this->validate();
     $this->onAfterCommit();
     DICService::delete('event');
     DICService::delete('zend_search');
     DICService::delete('cache');
 }