* Add case for dev module.

This commit is contained in:
tianshujie
2023-02-28 15:59:06 +08:00
parent eef2c1c356
commit 7c8a122266
2 changed files with 44 additions and 0 deletions
+18
View File
@@ -182,4 +182,22 @@ class devTest
$customedLang = $this->objectModel->getCustomedLang($type, $module, $method, $language);
return empty($customedLang) ? 'null' : implode('|', $customedLang);
}
/**
* Sort menus.
*
* @param object|array $menus
* @access public
* @return string
*/
public function sortMenusTest($menus)
{
$result = '';
$menus = $this->objectModel->sortMenus($menus);
foreach($menus as $key => $value)
{
$result .= $key . ',';
}
return $result;
}
}
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/dev.class.php';
$ztLang = zdTable('lang');
$ztLang->id->range('1');
$ztLang->gen(0);
/**
title=测试 devModel::sortMenus();
cid=1
pid=1
检查传入空值时的情况 >> 0
检查传入地盘导航顺序 >> index,calendar,work,audit,project,execution,contribute,dynamic,score,contacts,
*/
global $tester;
$menuList[0] = array();
$menuList[1] = $tester->lang->my->menu;
$devTester = new devTest();
r($devTester->sortMenusTest($menuList[0])) && p() && e('0'); // 检查传入空值时的情况
r($devTester->sortMenusTest($menuList[1])) && p() && e('index,calendar,work,audit,project,execution,contribute,dynamic,score,contacts,'); // 检查传入地盘导航顺序