* [misc] Enhance unit tests for dataviewModel::replace4Workflow() method
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -211,4 +211,19 @@ class dataviewTest
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test replace4Workflow method.
|
||||
*
|
||||
* @param string $title
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function replace4WorkflowTest($title)
|
||||
{
|
||||
$result = $this->objectModel->replace4Workflow($title);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 dataviewModel::replace4Workflow();
|
||||
timeout=0
|
||||
cid=1
|
||||
cid=0
|
||||
|
||||
- 替换产品名称的产品为自定义语言项。 @产品名称
|
||||
- 执行dataviewTest模块的replace4WorkflowTest方法,参数是'产品名称' @产品名称
|
||||
- 执行dataviewTest模块的replace4WorkflowTest方法,参数是'这个产品很好' @这个产品很好
|
||||
- 执行dataviewTest模块的replace4WorkflowTest方法,参数是'用户管理系统' @用户管理系统
|
||||
- 执行dataviewTest模块的replace4WorkflowTest方法,参数是'' @0
|
||||
- 执行dataviewTest模块的replace4WorkflowTest方法,参数是'产品列表和产品设置' @产品列表和产品设置
|
||||
|
||||
*/
|
||||
global $tester;
|
||||
$tester->loadModel('dataview');
|
||||
|
||||
r($tester->dataview->replace4Workflow('产品名称')) && p() && e('产品名称'); //替换产品名称的产品为自定义语言项。
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/dataview.unittest.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$dataviewTest = new dataviewTest();
|
||||
|
||||
r($dataviewTest->replace4WorkflowTest('产品名称')) && p() && e('产品名称');
|
||||
r($dataviewTest->replace4WorkflowTest('这个产品很好')) && p() && e('这个产品很好');
|
||||
r($dataviewTest->replace4WorkflowTest('用户管理系统')) && p() && e('用户管理系统');
|
||||
r($dataviewTest->replace4WorkflowTest('')) && p() && e('0');
|
||||
r($dataviewTest->replace4WorkflowTest('产品列表和产品设置')) && p() && e('产品列表和产品设置');
|
||||
Reference in New Issue
Block a user