mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Fix zone creation and deletion for tests
This commit is contained in:
parent
58e2a8fca6
commit
0ea0a8fd83
@ -76,11 +76,14 @@ abstract class BaseTestCase extends IcingaBaseTestCase
|
|||||||
self::$db = new Db($dbConfig);
|
self::$db = new Db($dbConfig);
|
||||||
$migrations = new Migrations(self::$db);
|
$migrations = new Migrations(self::$db);
|
||||||
$migrations->applyPendingMigrations();
|
$migrations->applyPendingMigrations();
|
||||||
IcingaZone::create([
|
$zone = IcingaZone::create([
|
||||||
'object_name' => 'director-global',
|
'object_name' => 'director-global',
|
||||||
'object_type' => 'external_object',
|
'object_type' => 'external_object',
|
||||||
'is_global' => 'y'
|
'is_global' => 'y'
|
||||||
])->store(self::$db);
|
]);
|
||||||
|
if (! IcingaZone::exists($zone->getId(), self::$db)) {
|
||||||
|
$zone->store(self::$db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$db;
|
return self::$db;
|
||||||
|
@ -747,7 +747,7 @@ class IcingaHostTest extends BaseTestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$kill = array('___TEST___zone');
|
$kill = ['___TEST___zone', '___TEST___zone2'];
|
||||||
foreach ($kill as $name) {
|
foreach ($kill as $name) {
|
||||||
if (IcingaZone::exists($name, $db)) {
|
if (IcingaZone::exists($name, $db)) {
|
||||||
IcingaZone::load($name, $db)->delete();
|
IcingaZone::load($name, $db)->delete();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user