+ Add the test file of storeModel::getAppMapByNames.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
|
||||
title=测试 storeModel->getAppMapByNames().
|
||||
cid=1
|
||||
|
||||
- 测试传入查询名称为空 @0
|
||||
- 测试查询名称为adminer和zentao
|
||||
- 第adminer条的name属性 @adminer
|
||||
- 第zentao条的name属性 @zentao
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/store.class.php';
|
||||
|
||||
zdTable('user')->gen(5);
|
||||
su('admin');
|
||||
|
||||
$nameList = array(array(), array('adminer', 'zentao'));
|
||||
|
||||
$store = new storeTest();
|
||||
r($store->getAppMapByNamesTest($nameList[0])) && p() && e('0'); //测试传入查询名称为空
|
||||
r($store->getAppMapByNamesTest($nameList[1])) && p('adminer:name;zentao:name') && e('adminer;zentao'); //测试查询名称为adminer和zentao
|
||||
@@ -79,4 +79,19 @@ class storeTest
|
||||
{
|
||||
return $this->getAppInfo($appID, $analysis, $name, $version, $channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试根据名称查询多个应用信息。
|
||||
* Test get app infos map by name array from cloud market.
|
||||
*
|
||||
* @param array $nameList
|
||||
* @param string $channel
|
||||
* @access public
|
||||
* @return object|null
|
||||
*/
|
||||
public function getAppMapByNamesTest(array $nameList = array()): object|null
|
||||
{
|
||||
$result = $this->getAppMapByNames($nameList);
|
||||
return empty((array)$result) ? null : $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user