* Test getPairs function.

This commit is contained in:
daitingting
2023-12-27 05:49:30 +00:00
parent d647d002da
commit 0bf0d5035b
2 changed files with 41 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
/**
title=测试 zahostModel->getPairs();
timeout=0
cid=1
- 查询宿主机的键值对
- 属性1 @宿主机1
- 属性2 @宿主机2
- 属性3 @~~
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/zahost.class.php';
su('admin');
$host = zdTable('host');
$host->id->range('1-3');
$host->type->range('zahost');
$host->name->range('宿主机1,宿主机2,宿主机3');
$host->deleted->range('0{2},1');
$host->gen(3);
$zahost = new zahostTest();
r($zahost->getPairsTest()) && p('1,2,3') && e('宿主机1,宿主机2,~~'); //查询宿主机的键值对
+12
View File
@@ -22,4 +22,16 @@ class zahostTest
if(dao::isError()) return dao::getError();
return $zahost;
}
/**
* 测试获取主机键值对。
* Get host pairs test.
*
* @access public
* @return array
*/
public function getPairsTest(): array
{
return $this->objectModel->getPairs();
}
}