mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
Change parent class of BaseTestCase to \Icinga\Test\BaseTestCase
This commit is contained in:
parent
0ff6c8ee62
commit
58e2a8fca6
@ -10,20 +10,15 @@ use Icinga\Module\Director\Db;
|
||||
use Icinga\Module\Director\Db\Migrations;
|
||||
use Icinga\Module\Director\Objects\IcingaObject;
|
||||
use Icinga\Module\Director\Objects\IcingaZone;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Icinga\Test\BaseTestCase as IcingaBaseTestCase;
|
||||
|
||||
abstract class BaseTestCase extends TestCase
|
||||
abstract class BaseTestCase extends IcingaBaseTestCase
|
||||
{
|
||||
private static $app;
|
||||
|
||||
/** @var Db */
|
||||
private static $db;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->app();
|
||||
}
|
||||
|
||||
protected function skipForMissingDb()
|
||||
{
|
||||
if ($this->hasDb()) {
|
||||
|
@ -88,5 +88,7 @@ abstract class IcingaObjectTestCase extends BaseTestCase
|
||||
$this->subject->delete();
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ abstract class SyncTest extends BaseTestCase
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->source = ImportSource::create(array(
|
||||
'source_name' => 'testimport',
|
||||
'provider_class' => 'Icinga\\Module\\Director\\Test\\ImportSourceDummy',
|
||||
@ -75,6 +76,7 @@ abstract class SyncTest extends BaseTestCase
|
||||
// make sure cache is clean for other tests
|
||||
PrefetchCache::forget();
|
||||
DbObject::clearAllPrefetchCaches();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,6 +30,7 @@ class IcingaObjectFieldFormTest extends BaseTestCase
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
if ($this->hasDb()) {
|
||||
$db = $this->getDb();
|
||||
$this->testDatafield = DirectorDatafield::create([
|
||||
|
@ -167,5 +167,7 @@ class StateFilterSetTest extends BaseTestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ class HostGroupMembershipResolverTest extends BaseTestCase
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
IcingaTemplateRepository::clear();
|
||||
}
|
||||
|
||||
|
@ -212,5 +212,7 @@ class IcingaCommandTest extends BaseTestCase
|
||||
if (IcingaCommand::exists($this->testCommandName, $db)) {
|
||||
IcingaCommand::load($this->testCommandName, $db)->delete();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -756,6 +756,8 @@ class IcingaHostTest extends BaseTestCase
|
||||
|
||||
$this->deleteDatafields();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
protected function deleteDatafields()
|
||||
|
@ -244,5 +244,7 @@ class IcingaNotificationTest extends BaseTestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class IcingaServiceSetTest extends IcingaObjectTestCase
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->assertNull($this->subject, 'subject must have been taken down before!');
|
||||
|
||||
if ($this->hasDb()) {
|
||||
|
@ -44,6 +44,7 @@ class IcingaServiceTest extends BaseTestCase
|
||||
|
||||
public function testAcceptsAssignRules()
|
||||
{
|
||||
$this->expectNotToPerformAssertions();
|
||||
$service = $this->service();
|
||||
$service->object_type = 'apply';
|
||||
$service->assign_filter = 'host.address="127.*"';
|
||||
@ -287,5 +288,7 @@ class IcingaServiceTest extends BaseTestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -154,5 +154,7 @@ class IcingaTemplateResolverTest extends BaseTestCase
|
||||
IcingaHost::load($name, $db)->delete();
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -180,5 +180,7 @@ class IcingaTimePeriodTest extends BaseTestCase
|
||||
IcingaTimePeriod::load($name, $db)->delete();
|
||||
}
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
@ -255,5 +255,7 @@ class TemplateTreeTest extends BaseTestCase
|
||||
$this->removeHosts($db);
|
||||
$this->removeServices($db);
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user