znt/module/custom/test/model/disablefeaturesbymode.php

47 lines
1.5 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=测试 customModel::disableFeaturesByMode();
timeout=0
cid=15894
- 测试步骤1全生命周期管理模式 @0
- 测试步骤2轻量级管理模式 @1
- 测试步骤3无效模式参数 @0
- 测试步骤4空字符串模式参数 @0
- 测试步骤5验证URAndSR和enableER配置 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
// 准备测试数据
ob_start();
zenData('project')->gen(10);
zenData('product')->gen(10);
zenData('story')->gen(5);
zenData('user')->gen(8);
zenData('assetlib')->gen(0);
zenData('issue')->gen(0);
zenData('risk')->gen(0);
zenData('opportunity')->gen(0);
zenData('meeting')->gen(0);
zenData('auditplan')->gen(0);
zenData('process')->gen(0);
zenData('measrecord')->gen(0);
ob_end_clean();
su('admin');
$customTester = new customModelTest();
r($customTester->disableFeaturesByModeTest('ALM')) && p() && e('0'); // 测试步骤1全生命周期管理模式
$light = $customTester->disableFeaturesByModeTest('light');
r(strpos($light, 'productTrack') !== false) && p() && e('1'); // 测试步骤2轻量级管理模式
r($customTester->disableFeaturesByModeTest('invalid')) && p() && e('0'); // 测试步骤3无效模式参数
r($customTester->disableFeaturesByModeTest('')) && p() && e('0'); // 测试步骤4空字符串模式参数
$light = $customTester->disableFeaturesByModeTestWithURAndSR('light');
r(strpos($light, 'agileplusMeasrecord') !== false) && p() && e('0'); // 测试步骤5验证URAndSR和enableER配置