diff --git a/module/convert/test/lib/tao.class.php b/module/convert/test/lib/tao.class.php index bbfe0d0434..9f18c0e80e 100644 --- a/module/convert/test/lib/tao.class.php +++ b/module/convert/test/lib/tao.class.php @@ -21,4 +21,19 @@ class convertTaoTest extends baseTest if(dao::isError()) return dao::getError(); return $result; } + + /** + * Test processJiraContent method. + * + * @param string $content + * @param array $fileList + * @access public + * @return string + */ + public function processJiraContentTest($content = '', $fileList = array()) + { + $result = $this->invokeArgs('processJiraContent', array($content, $fileList)); + if(dao::isError()) return dao::getError(); + return $result; + } } diff --git a/module/convert/test/tao/processjiracontent.php b/module/convert/test/tao/processjiracontent.php new file mode 100755 index 0000000000..261420f46c --- /dev/null +++ b/module/convert/test/tao/processjiracontent.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php + image +- 执行convertTest模块的processJiraContentTest方法,参数是'!image1.jpg|width=100! and !image2.png|height=200!', array @file-read-jpg-1.html and file-read-png-2.html + +*/ + +include dirname(__FILE__, 5) . '/test/lib/init.php'; +include dirname(__FILE__, 2) . '/lib/tao.class.php'; + +su('admin'); + +$convertTest = new convertTaoTest(); + +r($convertTest->processJiraContentTest('', array())) && p() && e('0'); +r($convertTest->processJiraContentTest('This is plain text without image markers.', array())) && p() && e('0'); +r($convertTest->processJiraContentTest('This has !image.png|width=100! marker but no files', array())) && p() && e('This has !image.png|width=100! marker but no files'); +r($convertTest->processJiraContentTest('Check this !test.png|width=100! image', array('test.png' => (object)array('id' => 1, 'extension' => 'png')))) && p() && e('Check this file-read-png-1.html image'); +r($convertTest->processJiraContentTest('!image1.jpg|width=100! and !image2.png|height=200!', array('image1.jpg' => (object)array('id' => 1, 'extension' => 'jpg'), 'image2.png' => (object)array('id' => 2, 'extension' => 'png')))) && p() && e('file-read-jpg-1.html and file-read-png-2.html'); \ No newline at end of file