/** * It should not register documents on the HYDRATE event when there is already a document. */ public function testHandleRegisterHydrateAlreadyExisting() { $this->hydrateEvent->getDocument()->willReturn($this->document); $this->hydrateEvent->getNode()->willReturn($this->node->reveal()); $this->hydrateEvent->getLocale()->willReturn('fr'); $this->registry->hasDocument($this->document)->willReturn(true); $this->registry->registerDocument($this->document, $this->node->reveal(), 'fr')->shouldNotBeCalled(); $this->registry->updateLocale($this->document, 'fr')->shouldBeCalled(); $this->subscriber->handleHydrate($this->hydrateEvent->reveal()); }