Neos\Flow\Tests\Unit\Persistence\Doctrine\PersistenceManagerTest::persistAllAbortsIfConnectionIsClosed PHP Method

persistAllAbortsIfConnectionIsClosed() public method

    public function persistAllAbortsIfConnectionIsClosed()
    {
        $mockEntityManager = $this->getMockBuilder(\Doctrine\ORM\EntityManager::class)->disableOriginalConstructor()->getMock();
        $mockEntityManager->expects($this->atLeastOnce())->method('isOpen')->will($this->returnValue(false));
        $this->inject($this->persistenceManager, 'entityManager', $mockEntityManager);
        $mockEntityManager->expects($this->never())->method('flush');
        $this->persistenceManager->persistAll();
    }