znt/module/editor/test/model/printtree.php

49 lines
2 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=测试 editorModel::printTree();
timeout=0
cid=16242
- 测试步骤1正常文件结构转换
- 属性isArray @1
- 属性hasStructure @1
- 属性hasValidItems @1
- 测试步骤2空数组输入处理
- 属性isArray @0
- 属性isEmpty @1
- 测试步骤3非数组输入处理
- 属性hasError @1
- 属性errorType @TypeError
- 测试步骤4嵌套结构递归处理
- 属性isArray @1
- 属性itemCount @1
- 属性hasStructure @1
- 测试步骤5isRoot参数影响测试
- 属性isArray @1
- 属性hasStructure @1
- 属性hasValidItems @1
- 测试步骤6返回结构完整性验证
- 属性hasText @1
- 属性hasId @1
- 属性hasActions @1
- 测试步骤7模块文本本地化处理第0条的text属性 @待办
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$editor = new editorModelTest();
r($editor->printTreeAdvancedTest()) && p('isArray,hasStructure,hasValidItems') && e('1,1,1'); // 测试步骤1正常文件结构转换
r($editor->printTreeEmptyTest()) && p('isArray,isEmpty') && e('0,1'); // 测试步骤2空数组输入处理
r($editor->printTreeInvalidInputTest()) && p('hasError,errorType') && e('1,TypeError'); // 测试步骤3非数组输入处理
r($editor->printTreeNestedTest()) && p('isArray,itemCount,hasStructure') && e('1,1,1'); // 测试步骤4嵌套结构递归处理
r($editor->printTreeNonRootTest()) && p('isArray,hasStructure,hasValidItems') && e('1,1,1'); // 测试步骤5isRoot参数影响测试
r($editor->printTreeAdvancedTest()) && p('hasText,hasId,hasActions') && e('1,1,1'); // 测试步骤6返回结构完整性验证
r($editor->printTreeTest()) && p('0:text') && e('待办'); // 测试步骤7模块文本本地化处理