function it_deleteSearchIndex(ZendSearchManager $zendsearch) { $zendsearch_ptr = function () use($zendsearch) { $str = Argument::type('string'); $zendsearch->delete($str)->shouldBeCalled()->willReturn(null); return $zendsearch->getWrappedObject(); }; DICService::update('zend_search', $zendsearch_ptr); $this->deleteSearchIndex(1); DICService::delete('zend_search'); }
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'); }