From 68246f883068fa78d1bfc9eaa53dcada6f2362a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Fri, 30 Oct 2015 09:27:25 +0100 Subject: [PATCH] Avoid creating 2 connections when applying fixtures --- .../Setup/Version/PreSchemaUpgrade/Upgrade39UsersTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Alchemy/Tests/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39UsersTest.php b/tests/Alchemy/Tests/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39UsersTest.php index ae5dd7c44c..ea3b465989 100644 --- a/tests/Alchemy/Tests/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39UsersTest.php +++ b/tests/Alchemy/Tests/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39UsersTest.php @@ -24,9 +24,7 @@ class Upgrade39UsersTest extends \PhraseanetTestCase */ public function testApply($fixture) { - $this->loadFixture($fixture); - - $em = $this->createEntityManager(); + $em = $this->loadFixture($fixture); $upgrader = new Upgrade39Users(); $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 = $this->createEntityManager(); $em->getConnection()->executeQuery(file_get_contents(self::$DI['cli']['root.path'].'/'.$fixture)); + return $em; } private function createEntityManager($dbname = self::DB_NAME)