znt/module/convert/test/tao/updaterelatesobject.php

62 lines
2.9 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=测试 convertTao::updateRelatesObject();
timeout=0
cid=15874
- 步骤1任务关联需求正常情况 @1
- 步骤2需求关联任务正常情况 @1
- 步骤3需求关联缺陷正常情况 @1
- 步骤4缺陷关联需求正常情况 @1
- 步骤5需求之间关联和缺陷之间关联 @1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tao.class.php';
// 2. zendata数据准备根据需要配置
$task = zenData('task');
$task->id->range('1-5');
$task->name->range('任务{1-5}');
$task->story->range('0{5}');
$task->execution->range('1{5}');
$task->status->range('wait{5}');
$task->deleted->range('0{5}');
$task->gen(5);
$story = zenData('story');
$story->id->range('1-5');
$story->title->range('需求{1-5}');
$story->linkStories->range('');
$story->status->range('active{5}');
$story->stage->range('wait{5}');
$story->deleted->range('0{5}');
$story->gen(5);
$bug = zenData('bug');
$bug->id->range('1-5');
$bug->title->range('缺陷{1-5}');
$bug->story->range('0{5}');
$bug->storyVersion->range('1{5}');
$bug->relatedBug->range('');
$bug->status->range('active{5}');
$bug->deleted->range('0{5}');
$bug->gen(5);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$convertTest = new convertTaoTest();
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($convertTest->updateRelatesObjectTest(array('jira_task_1' => 'jira_story_1'), array('jira_task_1' => array('BType' => 'ztask', 'BID' => '1'), 'jira_story_1' => array('BType' => 'zstory', 'BID' => '2')))) && p() && e('1'); // 步骤1任务关联需求正常情况
r($convertTest->updateRelatesObjectTest(array('jira_story_2' => 'jira_task_2'), array('jira_story_2' => array('BType' => 'zstory', 'BID' => '3'), 'jira_task_2' => array('BType' => 'ztask', 'BID' => '4')))) && p() && e('1'); // 步骤2需求关联任务正常情况
r($convertTest->updateRelatesObjectTest(array('jira_story_3' => 'jira_bug_1'), array('jira_story_3' => array('BType' => 'zstory', 'BID' => '1'), 'jira_bug_1' => array('BType' => 'zbug', 'BID' => '1')))) && p() && e('1'); // 步骤3需求关联缺陷正常情况
r($convertTest->updateRelatesObjectTest(array('jira_bug_2' => 'jira_story_4'), array('jira_bug_2' => array('BType' => 'zbug', 'BID' => '2'), 'jira_story_4' => array('BType' => 'zstory', 'BID' => '2')))) && p() && e('1'); // 步骤4缺陷关联需求正常情况
r($convertTest->updateRelatesObjectTest(array('jira_story_5' => 'jira_story_6', 'jira_bug_3' => 'jira_bug_4'), array('jira_story_5' => array('BType' => 'zstory', 'BID' => '3'), 'jira_story_6' => array('BType' => 'zstory', 'BID' => '4'), 'jira_bug_3' => array('BType' => 'zbug', 'BID' => '3'), 'jira_bug_4' => array('BType' => 'zbug', 'BID' => '4')))) && p() && e('1'); // 步骤5需求之间关联和缺陷之间关联