znt/module/dev/test/model/getsecondmenus.php

30 lines
1.2 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=测试 devModel::getSecondMenus();
timeout=0
cid=16010
- 测试步骤1空菜单参数情况 @0
- 测试步骤2非project菜单情况 @0
- 测试步骤3project菜单基本情况第0条的title属性 @项目通用
- 测试步骤4project菜单匹配模块情况第0条的active属性 @1
- 测试步骤5project菜单返回数组长度验证 @4
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$moduleList = array('', 'my', 'project');
global $tester;
$tester->loadModel('dev');
r($tester->dev->getSecondMenus($moduleList[0])) && p() && e('0'); // 测试步骤1空菜单参数情况
r($tester->dev->getSecondMenus($moduleList[1])) && p() && e('0'); // 测试步骤2非project菜单情况
r($tester->dev->getSecondMenus($moduleList[2])) && p('0:title') && e('项目通用'); // 测试步骤3project菜单基本情况
r($tester->dev->getSecondMenus($moduleList[2], 'project', '')) && p('0:active') && e('1'); // 测试步骤4project菜单匹配模块情况
r(count($tester->dev->getSecondMenus($moduleList[2]))) && p() && e('4'); // 测试步骤5project菜单返回数组长度验证