public function testNodeDelete() { $this->deleteEvent->getStructures()->willReturn([$this->structure]); $this->handler->invalidateStructure($this->structure->reveal())->shouldBeCalled(); $this->subscriber->onContentNodePreDelete($this->deleteEvent->reveal()); $this->subscriber->onContentNodePostDelete($this->deleteEvent->reveal()); }
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 testInvalidateStructure() { $this->handler1->invalidateStructure($this->structure->reveal())->shouldBeCalled(); $this->handler2->invalidateStructure($this->structure->reveal())->shouldBeCalled(); $this->handler->invalidateStructure($this->structure->reveal()); }