🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
65 lines
1.6 KiB
PHP
65 lines
1.6 KiB
PHP
<?php
|
|
declare(strict_types = 1);
|
|
class hostTest
|
|
{
|
|
public function __construct()
|
|
{
|
|
global $tester;
|
|
$this->objectModel = $tester->loadModel('host');
|
|
}
|
|
|
|
/**
|
|
* Test getPairs method.
|
|
*
|
|
* @param string $moduleIdList
|
|
* @param string $status
|
|
* @access public
|
|
* @return array
|
|
*/
|
|
public function getPairsTest($moduleIdList = '', $status = '')
|
|
{
|
|
$result = $this->objectModel->getPairs($moduleIdList, $status);
|
|
if(dao::isError()) return dao::getError();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* Test processTreemap method.
|
|
*
|
|
* @param array $datas
|
|
* @access public
|
|
* @return array
|
|
*/
|
|
public function processTreemapTest($datas = array())
|
|
{
|
|
$reflection = new ReflectionClass($this->objectModel);
|
|
$method = $reflection->getMethod('processTreemap');
|
|
$method->setAccessible(true);
|
|
|
|
$result = $method->invoke($this->objectModel, $datas);
|
|
if(dao::isError()) return dao::getError();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* Test getTreeModules method.
|
|
*
|
|
* @param int $rootID
|
|
* @param array $hosts
|
|
* @access public
|
|
* @return array
|
|
*/
|
|
public function getTreeModulesTest($rootID = 0, $hosts = array())
|
|
{
|
|
$reflection = new ReflectionClass($this->objectModel);
|
|
$method = $reflection->getMethod('getTreeModules');
|
|
$method->setAccessible(true);
|
|
|
|
$result = $method->invoke($this->objectModel, $rootID, $hosts);
|
|
if(dao::isError()) return dao::getError();
|
|
|
|
return $result;
|
|
}
|
|
} |