HostGroupMembershipResolverTest: replace new dummy
This commit is contained in:
parent
66de47b10b
commit
6678a9a8f9
|
@ -44,7 +44,7 @@ class DbObjectTypeRegistry
|
|||
return 'Icinga\\Module\\Director\\Objects\\' . $prefix . ucfirst($type);
|
||||
}
|
||||
|
||||
public static function makeObject($type, $properties = [], Db $db = null)
|
||||
public static function newObject($type, $properties = [], Db $db = null)
|
||||
{
|
||||
/** @var DbObject $class fake hint for the IDE, it's a string */
|
||||
$class = self::classByType($type);
|
||||
|
|
|
@ -83,11 +83,7 @@ class HostGroupMembershipResolverTest extends BaseTestCase
|
|||
|
||||
protected function objects($type)
|
||||
{
|
||||
/** @var IcingaObject $class */
|
||||
$class = DbObjectTypeRegistry::classByType($type);
|
||||
|
||||
/** @var IcingaObject $dummy */
|
||||
$dummy = $class::create();
|
||||
$dummy = DbObjectTypeRegistry::newObject($type);
|
||||
|
||||
$table = $dummy->getTableName();
|
||||
$query = $this->getDb()->getDbAdapter()->select()
|
||||
|
@ -97,7 +93,7 @@ class HostGroupMembershipResolverTest extends BaseTestCase
|
|||
$objects = [];
|
||||
$l = strlen(self::PREFIX);
|
||||
|
||||
foreach ($class::loadAll($this->getDb(), $query) as $object) {
|
||||
foreach ($dummy::loadAll($this->getDb(), $query) as $object) {
|
||||
$key = substr($object->getObjectName(), $l);
|
||||
$objects[$key] = $object;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue