Files
EasySoft-ZenTaoPMS/module/common/test/model/buildmorebutton.php
T
2025-11-14 13:05:25 +08:00

47 lines
1.5 KiB
PHP
Executable File
Raw 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=测试 commonModel::buildMoreButton();
timeout=0
cid=15647
- 步骤1:不存在的executionID @
- 步骤2:无效ID为0 @
- 步骤3:负数ID @
- 步骤4Tutorial模式或正常模式 @
- 步骤5:执行记录但同项目无其他执行 @
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/common.unittest.class.php';
zenData('user')->gen(5);
// 准备项目和执行数据
$project = zenData('project');
$project->id->range('1-10');
$project->name->range('项目{1-5},执行{6-10}');
$project->type->range('project{5},sprint{5}');
$project->parent->range('0{5},0{5}');
$project->project->range('0{5},1-5'); // 执行的project字段指向父项目
$project->grade->range('1{5},2{5}');
$project->deleted->range('0{10}');
$project->gen(10);
su('admin');
// 创建测试实例
$commonTest = new commonTest();
// 模拟Tutorial模式进行一个测试
$_SESSION['tutorialMode'] = true;
// 测试用例(5个测试步骤)
r($commonTest->buildMoreButtonTest(999, false)) && p() && e(''); // 步骤1:不存在的executionID
r($commonTest->buildMoreButtonTest(0, false)) && p() && e(''); // 步骤2:无效ID为0
r($commonTest->buildMoreButtonTest(-1, false)) && p() && e(''); // 步骤3:负数ID
r($commonTest->buildMoreButtonTest(1, false)) && p() && e(''); // 步骤4Tutorial模式或正常模式
r($commonTest->buildMoreButtonTest(6, false)) && p() && e(''); // 步骤5:执行记录但同项目无其他执行