diff --git a/module/convert/test/lib/convert.unittest.class.php b/module/convert/test/lib/convert.unittest.class.php
index 5993c01a93..a5b48fbcb5 100644
--- a/module/convert/test/lib/convert.unittest.class.php
+++ b/module/convert/test/lib/convert.unittest.class.php
@@ -4009,4 +4009,30 @@ class convertTest
return $result;
}
+ /**
+ * Test processJiraContent method.
+ *
+ * @param string $content
+ * @param array $fileList
+ * @access public
+ * @return mixed
+ */
+ public function processJiraContentTest($content = '', $fileList = array())
+ {
+ try {
+ $reflection = new ReflectionClass($this->objectTao);
+ $method = $reflection->getMethod('processJiraContent');
+ $method->setAccessible(true);
+
+ $result = $method->invoke($this->objectTao, $content, $fileList);
+ if(dao::isError()) return dao::getError();
+
+ return $result;
+ } catch (Exception $e) {
+ return 'exception: ' . $e->getMessage();
+ } catch (Error $e) {
+ return 'error: ' . $e->getMessage();
+ }
+ }
+
}
diff --git a/module/convert/test/tao/processjiracontent.php b/module/convert/test/tao/processjiracontent.php
new file mode 100755
index 0000000000..5b7dab7897
--- /dev/null
+++ b/module/convert/test/tao/processjiracontent.php
@@ -0,0 +1,42 @@
+#!/usr/bin/env php
+ 的图片
+- 执行convertTest模块的processJiraContentTest方法,参数是'多个图片 !image.png|thumb! 和 !document.pdf|preview! 在同一内容中', array @多个图片
和
在同一内容中
+- 执行convertTest模块的processJiraContentTest方法,参数是'混合文件 !screenshot.png|preview! 和不存在的 !missing.jpg|thumb! 文件', array @混合文件
和不存在的 !missing.jpg|thumb! 文件
+- 执行convertTest模块的processJiraContentTest方法,参数是'', array @0
+- 执行convertTest模块的processJiraContentTest方法,参数是'没有图片标记的普通文本内容', array @0
+
+*/
+
+include dirname(__FILE__, 5) . '/test/lib/init.php';
+include dirname(__FILE__, 2) . '/lib/convert.unittest.class.php';
+
+$table = zenData('file');
+$table->id->range('1-5');
+$table->title->range('image.png,document.pdf,avatar.jpg,screenshot.png,data.txt');
+$table->extension->range('png,pdf,jpg,png,txt');
+$table->size->range('1024-102400');
+$table->objectType->range('story,bug,task,ticket,story');
+$table->objectID->range('1-5');
+$table->gen(5);
+
+su('admin');
+
+$convertTest = new convertTest();
+
+r($convertTest->processJiraContentTest('内容包含分隔符 !avatar.jpg|width=100! 的图片', array('avatar.jpg' => (object)array('id' => 3, 'extension' => 'jpg')))) && p() && e('内容包含分隔符
的图片');
+
+r($convertTest->processJiraContentTest('多个图片 !image.png|thumb! 和 !document.pdf|preview! 在同一内容中', array('image.png' => (object)array('id' => 1, 'extension' => 'png'), 'document.pdf' => (object)array('id' => 2, 'extension' => 'pdf')))) && p() && e('多个图片
和
在同一内容中');
+
+r($convertTest->processJiraContentTest('混合文件 !screenshot.png|preview! 和不存在的 !missing.jpg|thumb! 文件', array('screenshot.png' => (object)array('id' => 4, 'extension' => 'png')))) && p() && e('混合文件
和不存在的 !missing.jpg|thumb! 文件');
+
+r($convertTest->processJiraContentTest('', array())) && p() && e('0');
+
+r($convertTest->processJiraContentTest('没有图片标记的普通文本内容', array())) && p() && e('0');
\ No newline at end of file
diff --git a/module/convert/test/tao/yaml/file_processjiraontent.yaml b/module/convert/test/tao/yaml/file_processjiraontent.yaml
new file mode 100644
index 0000000000..a15f629d70
--- /dev/null
+++ b/module/convert/test/tao/yaml/file_processjiraontent.yaml
@@ -0,0 +1,39 @@
+---
+title: processJiraContent测试数据
+desc: 用于测试processJiraContent方法的文件数据
+author: Claude
+version: 1.0
+
+fields:
+- field: id
+ note: 文件ID
+ range: 1-10
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+- field: title
+ note: 文件名称
+ range: image.png,document.pdf,avatar.jpg,screenshot.png,data.txt
+ prefix: ""
+ postfix: ""
+- field: extension
+ note: 文件扩展名
+ range: png,pdf,jpg,png,txt
+ prefix: ""
+ postfix: ""
+- field: size
+ note: 文件大小
+ range: 1024-102400
+ prefix: ""
+ postfix: ""
+- field: objectType
+ note: 对象类型
+ range: story,bug,task,ticket
+ prefix: ""
+ postfix: ""
+- field: objectID
+ note: 对象ID
+ range: 1-5
+ prefix: ""
+ postfix: ""
\ No newline at end of file