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.
This commit is contained in:
parent
39766e645c
commit
7cba76082e
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user