From 884868ee231231d28379aa85bd7dbb43314bd198 Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Sat, 13 Apr 2024 16:50:14 +0200 Subject: [PATCH] fixup! fix: Database Migration does set current version in DB #98 --- tests/DoctrineTest/Doctrine_UnitTestCase.php | 13 +++++++------ tests/MigrationTestCase.php | 12 +++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/DoctrineTest/Doctrine_UnitTestCase.php b/tests/DoctrineTest/Doctrine_UnitTestCase.php index 5715cceb..c24abf97 100644 --- a/tests/DoctrineTest/Doctrine_UnitTestCase.php +++ b/tests/DoctrineTest/Doctrine_UnitTestCase.php @@ -229,12 +229,7 @@ public function prepareTables() { } } - foreach ($this->tables as $table) { - try { - $this->conn->export->exportClasses(array($table)); - } catch (Doctrine_Export_Exception $e) { - } - } + $this->conn->export->exportClasses($this->tables); $this->objTable = $this->connection->getTable('User'); } @@ -320,6 +315,12 @@ protected function openAndBindMysqlConnection() $this->dbh = new PDO(getenv('MYSQL_DSN')); $this->conn = $this->connection = $this->openAdditionalConnection($this->dbh); + + $this->exc = new Doctrine_Connection_Mysql_Exception(); + + $this->unitOfWork = $this->connection->unitOfWork; + $this->connection->setListener(new Doctrine_EventListener()); + $this->query = new Doctrine_Query($this->connection); } protected function openAdditionalConnection($adapter = null, $name = null) diff --git a/tests/MigrationTestCase.php b/tests/MigrationTestCase.php index d5d28646..68948708 100644 --- a/tests/MigrationTestCase.php +++ b/tests/MigrationTestCase.php @@ -32,13 +32,11 @@ */ class Doctrine_Migration_TestCase extends Doctrine_UnitTestCase { - public function prepareTables() - { - $this->tables[] = 'MigrationPhonenumber'; - $this->tables[] = 'MigrationUser'; - $this->tables[] = 'MigrationProfile'; - parent::prepareTables(); - } + protected $tables = array( + 'MigrationPhonenumber', + 'MigrationUser', + 'MigrationProfile', + ); public function testMigration() {