znt/module/admin/test/model/setswitcher.php

30 lines
1,018 B
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=测试 adminModel::setSwitcher();
timeout=0
cid=14984
- 步骤1:正常情况,system菜单 @success
- 步骤2:正常情况,company菜单 @success
- 步骤3:正常情况,feature菜单 @success
- 步骤4:空参数情况 @0
- 步骤5:不存在菜单键测试异常处理 @success
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$adminTest = new adminModelTest();
r($adminTest->setSwitcherTest('system')) && p() && e('success'); // 步骤1:正常情况,system菜单
r($adminTest->setSwitcherTest('company')) && p() && e('success'); // 步骤2:正常情况,company菜单
r($adminTest->setSwitcherTest('feature')) && p() && e('success'); // 步骤3:正常情况,feature菜单
r($adminTest->setSwitcherTest('')) && p() && e('0'); // 步骤4:空参数情况
r($adminTest->setSwitcherTest('nonexistent')) && p() && e('success'); // 步骤5:不存在菜单键测试异常处理