From 7cba76082ea7ca84102661a123e5de3db5978217 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 18 Jan 2015 02:32:02 +0100 Subject: [PATCH] Corrected test: metadata should be retrieved from a specific entity manager Metadata is subject to modification depending on the active database platform (generator strategies, usually), therefore it is not safe to pull it from an entity manager and sharing metadata across multiple entity managers. --- .../Tests/ORM/Functional/MergeProxiesTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php index deb186c59..daed36652 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php @@ -215,21 +215,23 @@ class MergeProxiesTest extends OrmFunctionalTestCase array(realpath(__DIR__ . '/../../Models/Cache')), true )); + $config->setSQLLogger($logger); // always runs on sqlite to prevent multi-connection race-conditions with the test suite // multi-connection is not relevant for the purpose of checking locking here, but merely // to stub out DB-level access and intercept it - $connection = DriverManager::getConnection(array( - 'driver' => 'pdo_sqlite', - 'memory' => true - )); + $connection = DriverManager::getConnection( + array( + 'driver' => 'pdo_sqlite', + 'memory' => true + ), + $config + ); - $connection->getConfiguration()->setSQLLogger($logger); $entityManager = EntityManager::create($connection, $config); - (new SchemaTool($entityManager)) - ->createSchema([$this->_em->getClassMetadata(DateTimeModel::CLASSNAME)]); + (new SchemaTool($entityManager))->createSchema([$entityManager->getClassMetadata(DateTimeModel::CLASSNAME)]); return $entityManager; }