From 8381c9baf77c398bbf3ce57d2e3e3065c4759803 Mon Sep 17 00:00:00 2001 From: Soliman Date: Mon, 6 Jan 2020 10:40:50 +0100 Subject: [PATCH] Update unit tests --- .../Tests/Mocks/ConnectionCommitFailMock.php | 22 ------------------- tests/Doctrine/Tests/ORM/UnitOfWorkTest.php | 11 +++++----- 2 files changed, 6 insertions(+), 27 deletions(-) delete mode 100644 tests/Doctrine/Tests/Mocks/ConnectionCommitFailMock.php diff --git a/tests/Doctrine/Tests/Mocks/ConnectionCommitFailMock.php b/tests/Doctrine/Tests/Mocks/ConnectionCommitFailMock.php deleted file mode 100644 index c31b50bf4f..0000000000 --- a/tests/Doctrine/Tests/Mocks/ConnectionCommitFailMock.php +++ /dev/null @@ -1,22 +0,0 @@ -_connectionMock = new ConnectionCommitFailMock([], new DriverMock()); - $this->eventManager = $this->getMockBuilder(EventManager::class)->getMock(); - $this->_emMock = EntityManagerMock::create($this->_connectionMock, null, $this->eventManager); - $this->_unitOfWork = new UnitOfWorkMock($this->_emMock); - $this->_emMock->setUnitOfWork($this->_unitOfWork); + $this->_connectionMock = $this->getMockBuilder(ConnectionMock::class) + ->setConstructorArgs([[], new DriverMock()]) + ->setMethods(['commit']) + ->getMock(); + + $this->_connectionMock->method('commit')->willReturn(false); // Setup fake persister and id generator $userPersister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata(ForumUser::class));