From c016e2d434fd0c6ec108e227b85a092d6f807dc0 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 2 Sep 2017 13:55:07 +0200 Subject: [PATCH] Adding minimal test to verify `EntityManager` behavior against #5796 --- tests/Doctrine/Tests/ORM/EntityManagerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index 7f36bb285..0191ba158 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -232,6 +232,24 @@ class EntityManagerTest extends OrmTestCase EntityManager::create(1, $config); } + /** + * @group #5796 + */ + public function testTransactionalReThrowsThrowables() + { + try { + $this->_em->transactional(function () { + (function (array $value) { + // this only serves as an IIFE that throws a `TypeError` + })(null); + }); + + self::fail('TypeError expected to be thrown'); + } catch (\TypeError $ignored) { + self::assertFalse($this->_em->isOpen()); + } + } + /** * @group 6017 */