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

42 lines
2 KiB
PHP
Raw Permalink Normal View History

#!/usr/bin/env php
<?php
/**
title=测试 convertTao::buildWorkflowSchemeData();
timeout=0
cid=15829
- 步骤1完整有效数据
- 属性id @1
- 属性name @Test Workflow
- 属性description @This is a test workflow scheme
- 步骤2只包含必需字段属性description @~~
- 步骤3空description属性description @~~
- 步骤4特殊字符
- 属性id @4
- 属性name @SpecialWorkflow
- 属性description @Contains special chars
- 步骤5中文字符
- 属性id @5
- 属性name @中文工作流
- 属性description @这是一个中文描述的工作流方案
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tao.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$convertTest = new convertTaoTest();
// 4. 🔴 强制要求必须包含至少5个测试步骤
r($convertTest->buildWorkflowSchemeDataTest(array('id' => 1, 'name' => 'Test Workflow', 'description' => 'This is a test workflow scheme'))) && p('id,name,description') && e('1,Test Workflow,This is a test workflow scheme'); // 步骤1完整有效数据
r($convertTest->buildWorkflowSchemeDataTest(array('id' => 2, 'name' => 'Basic Workflow'))) && p('description') && e('~~'); // 步骤2只包含必需字段
r($convertTest->buildWorkflowSchemeDataTest(array('id' => 3, 'name' => 'Empty Description Workflow', 'description' => ''))) && p('description') && e('~~'); // 步骤3空description
r($convertTest->buildWorkflowSchemeDataTest(array('id' => 4, 'name' => 'SpecialWorkflow', 'description' => 'Contains special chars'))) && p('id,name,description') && e('4,SpecialWorkflow,Contains special chars'); // 步骤4特殊字符
r($convertTest->buildWorkflowSchemeDataTest(array('id' => 5, 'name' => '中文工作流', 'description' => '这是一个中文描述的工作流方案'))) && p('id,name,description') && e('5,中文工作流,这是一个中文描述的工作流方案'); // 步骤5中文字符