znt/module/store/test/model/getappmapbynames.php

29 lines
1.1 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 storeModel::getAppMapByNames();
cid=18453
- 测试步骤1传入空数组参数 >> 期望返回0无数据
- 测试步骤2传入单个应用名称adminer >> 期望返回adminer应用信息
- 测试步骤3传入多个应用名称 >> 期望返回多个应用信息
- 测试步骤4使用stable渠道参数 >> 期望返回应用信息
- 测试步骤5使用dev渠道参数 >> 期望返回0模拟未找到
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('user')->gen(5);
su('admin');
$store = new storeModelTest();
r($store->getAppMapByNamesTest(array())) && p() && e('0');
r($store->getAppMapByNamesTest(array('adminer'))) && p('adminer:name') && e('adminer');
r($store->getAppMapByNamesTest(array('adminer', 'zentao'))) && p('adminer:name;zentao:name') && e('adminer;zentao');
r($store->getAppMapByNamesTest(array('adminer'), 'stable')) && p('adminer:name') && e('adminer');
r($store->getAppMapByNamesTest(array('nonexistent'), 'dev')) && p() && e('0');