[icinga-checkins] icinga.org: icingaweb2-module-director/master: BaseTestCase: apply migrations to test db

git at icinga.org git at icinga.org
Mon Feb 29 20:39:04 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: f2233aeaffa35c0560e24a0d6c0322fb023bee9e
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=f2233aeaffa35c0560e24a0d6c0322fb023bee9e

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Feb 29 17:34:48 2016 +0100

BaseTestCase: apply migrations to test db

---

 library/Director/Test/BaseTestCase.php |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/library/Director/Test/BaseTestCase.php b/library/Director/Test/BaseTestCase.php
index 3aaa402..0eb8f45 100644
--- a/library/Director/Test/BaseTestCase.php
+++ b/library/Director/Test/BaseTestCase.php
@@ -6,6 +6,7 @@ use Icinga\Application\Cli;
 use Icinga\Application\Config;
 use Icinga\Exception\ConfigurationError;
 use Icinga\Module\Director\Db;
+use Icinga\Module\Director\Db\Migrations;
 use PHPUnit_Framework_TestCase;
 
 class BaseTestCase extends PHPUnit_Framework_TestCase
@@ -50,6 +51,8 @@ class BaseTestCase extends PHPUnit_Framework_TestCase
                 );
             }
             $this->db = Db::fromResourceName($resourceName);
+            $migrations = new Migrations($this->db);
+            $migrations->applyPendingMigrations();
         }
 
         return $this->db;



More information about the icinga-checkins mailing list