mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
BaseTestCase: apply migrations to test db
This commit is contained in:
parent
b2311130ba
commit
f2233aeaff
@ -6,6 +6,7 @@ use Icinga\Application\Cli;
|
|||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
|
use Icinga\Module\Director\Db\Migrations;
|
||||||
use PHPUnit_Framework_TestCase;
|
use PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
class BaseTestCase extends PHPUnit_Framework_TestCase
|
class BaseTestCase extends PHPUnit_Framework_TestCase
|
||||||
@ -50,6 +51,8 @@ class BaseTestCase extends PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->db = Db::fromResourceName($resourceName);
|
$this->db = Db::fromResourceName($resourceName);
|
||||||
|
$migrations = new Migrations($this->db);
|
||||||
|
$migrations->applyPendingMigrations();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->db;
|
return $this->db;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user