* Test getPairs function.
This commit is contained in:
Executable
+29
@@ -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,~~'); //查询宿主机的键值对
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user