public function testInvalidate() { $this->structure->hasTag('sulu.rlp')->willReturn(true); $this->structure->getPropertyValueByTagName('sulu.rlp')->willReturn('/path/to'); $this->structure->getLanguageCode()->willReturn($this->languageCode); $this->structure->getWebspaceKey()->willReturn($this->webspaceKey); $urls = ['/path/to/1', '/path/to/2']; $this->webspaceManager->findUrlsByResourceLocator('/path/to', $this->env, $this->languageCode, $this->webspaceKey)->willReturn($urls); $this->proxyClient->purge($urls[0])->shouldBeCalled(); $this->proxyClient->purge($urls[1])->shouldBeCalled(); $this->proxyClient->flush()->shouldBeCalled(); $this->webspaceManager->findUrlsByResourceLocator(Argument::any())->shouldNotBeCalled(); $this->handler->invalidateStructure($this->structure->reveal()); $this->handler->flush(); }
public function testTerminate() { $this->handler->flush()->shouldBeCalled(); $this->subscriber->onTerminate($this->postResponseEvent->reveal()); }