mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Avoid creating 2 connections when applying fixtures
This commit is contained in:
@@ -24,9 +24,7 @@ class Upgrade39UsersTest extends \PhraseanetTestCase
|
|||||||
*/
|
*/
|
||||||
public function testApply($fixture)
|
public function testApply($fixture)
|
||||||
{
|
{
|
||||||
$this->loadFixture($fixture);
|
$em = $this->loadFixture($fixture);
|
||||||
|
|
||||||
$em = $this->createEntityManager();
|
|
||||||
|
|
||||||
$upgrader = new Upgrade39Users();
|
$upgrader = new Upgrade39Users();
|
||||||
$configuration = new YamlConfiguration($em->getConnection());
|
$configuration = new YamlConfiguration($em->getConnection());
|
||||||
@@ -131,6 +129,7 @@ class Upgrade39UsersTest extends \PhraseanetTestCase
|
|||||||
$em->getConnection()->executeQuery('CREATE DATABASE '.self::DB_NAME.' CHARACTER SET utf8 COLLATE utf8_general_ci');
|
$em->getConnection()->executeQuery('CREATE DATABASE '.self::DB_NAME.' CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||||
$em = $this->createEntityManager();
|
$em = $this->createEntityManager();
|
||||||
$em->getConnection()->executeQuery(file_get_contents(self::$DI['cli']['root.path'].'/'.$fixture));
|
$em->getConnection()->executeQuery(file_get_contents(self::$DI['cli']['root.path'].'/'.$fixture));
|
||||||
|
return $em;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createEntityManager($dbname = self::DB_NAME)
|
private function createEntityManager($dbname = self::DB_NAME)
|
||||||
|
Reference in New Issue
Block a user