public function setUp()
{
$this->persistenceManager = $this->getMockBuilder(\Neos\Flow\Persistence\Doctrine\PersistenceManager::class)->setMethods(['emitAllObjectsPersisted'])->getMock();
$this->mockEntityManager = $this->getMockBuilder(\Doctrine\ORM\EntityManager::class)->disableOriginalConstructor()->getMock();
$this->mockEntityManager->expects($this->any())->method('isOpen')->will($this->returnValue(true));
$this->inject($this->persistenceManager, 'entityManager', $this->mockEntityManager);
$this->mockUnitOfWork = $this->getMockBuilder(\Doctrine\ORM\UnitOfWork::class)->disableOriginalConstructor()->getMock();
$this->mockEntityManager->expects($this->any())->method('getUnitOfWork')->will($this->returnValue($this->mockUnitOfWork));
$this->mockConnection = $this->getMockBuilder(\Doctrine\DBAL\Connection::class)->disableOriginalConstructor()->getMock();
$this->mockEntityManager->expects($this->any())->method('getConnection')->will($this->returnValue($this->mockConnection));
$this->mockSystemLogger = $this->createMock(\Neos\Flow\Log\SystemLoggerInterface::class);
$this->inject($this->persistenceManager, 'systemLogger', $this->mockSystemLogger);
}