private function assertThatItsClear($reference = 'phpcr') { if ('phpcr' === $reference) { $this->documentManager->expects($this->once())->method('clear'); } elseif ('dbal-orm' === $reference) { $this->objectManager->expects($this->once())->method('clear'); } $this->UoW->clear(); $this->assertCount(0, $this->UoW->getScheduledReferencesForUpdate()); $this->assertCount(0, $this->UoW->getScheduledReferencesForRemove()); $this->assertCount(0, $this->UoW->getScheduledReferencesForInsert()); $this->assertCount(0, $this->UoW->getScheduledReferencesByManager()); }
/** * When the UoW does not have cleared anymore it will do it now. */ public function clear() { if (!$this->getUnitOfWork()->hasCleared()) { $this->unitOfWork->clear(); } }