Skip to content

Commit

Permalink
Stop passing event manager to constructor (doctrine#9938)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander M. Turek <[email protected]>
  • Loading branch information
greg0ire and derrabus authored Jul 28, 2022
1 parent 2ebe18a commit 38a9a1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions tests/Doctrine/Tests/Mocks/EntityManagerMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ public static function create($conn, ?Configuration $config = null, ?EventManage
$config->setMetadataDriverImpl(ORMSetup::createDefaultAnnotationDriver());
}

if ($eventManager === null) {
$eventManager = $conn->getEventManager();
}

return new EntityManagerMock($conn, $config, $eventManager);
return new EntityManagerMock($conn, $config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ protected function createEntityManager(MappingDriver $metadataDriver, $conn = nu

$config->setMetadataDriverImpl($metadataDriver);

return EntityManagerMock::create($conn, $config, $eventManager);
return EntityManagerMock::create($conn, $config);
}

protected function createTestFactory(): ClassMetadataFactoryTestSubject
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/ORM/UnitOfWorkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ public function testCommitThrowOptimisticLockExceptionWhenConnectionCommitReturn
$this->_connectionMock = $this->getMockBuilderWithOnlyMethods(ConnectionMock::class, ['commit'])
->setConstructorArgs([[], $driver])
->getMock();
$this->_emMock = EntityManagerMock::create($this->_connectionMock, null, $this->eventManager);
$this->_emMock = EntityManagerMock::create($this->_connectionMock);
$this->_unitOfWork = new UnitOfWorkMock($this->_emMock);
$this->_emMock->setUnitOfWork($this->_unitOfWork);

Expand Down

0 comments on commit 38a9a1c

Please sign in to comment.