znt/module/tree/test/model/createepiclink.php

43 lines
1.8 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=测试 treeModel::createEpicLink();
timeout=0
cid=19350
- 步骤1正常情况
- 属性id @1
- 属性parent @0
- 属性name @测试模块
- 步骤2项目史诗链接属性url @projectstory-story-10-5--byModule-1-epic.html
- 步骤3执行史诗链接属性url @execution-story-20-epic-order_desc-byModule-1.html
- 步骤4产品史诗链接属性url @product-browse-1-all-byModule-1-epic.html
- 步骤5子级链接属性parent @5
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$treeTest = new treeModelTest();
// 4. 创建测试模块对象
$module = new stdclass();
$module->id = 1;
$module->parent = 0;
$module->name = '测试模块';
$module->root = 1;
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($treeTest->createEpicLinkTest('story', $module)) && p('id,parent,name') && e('1,0,测试模块'); // 步骤1正常情况
r($treeTest->createEpicLinkTest('story', $module, '0', array('projectID' => 10, 'productID' => 5))) && p('url') && e('projectstory-story-10-5--byModule-1-epic.html'); // 步骤2项目史诗链接
r($treeTest->createEpicLinkTest('story', $module, '0', array('executionID' => 20))) && p('url') && e('execution-story-20-epic-order_desc-byModule-1.html'); // 步骤3执行史诗链接
r($treeTest->createEpicLinkTest('story', $module, '0', array('branchID' => 'all'))) && p('url') && e('product-browse-1-all-byModule-1-epic.html'); // 步骤4产品史诗链接
r($treeTest->createEpicLinkTest('story', $module, '5')) && p('parent') && e('5'); // 步骤5子级链接