Files
EasySoft-ZenTaoPMS/module/host/test/lib/host.unittest.class.php
T
2025-09-15 15:06:16 +08:00

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;
}
}