diff --git a/module/upgrade/test/lib/upgrade.unittest.class.php b/module/upgrade/test/lib/upgrade.unittest.class.php index 8f3b7f1905..87a4678fbd 100755 --- a/module/upgrade/test/lib/upgrade.unittest.class.php +++ b/module/upgrade/test/lib/upgrade.unittest.class.php @@ -846,4 +846,18 @@ class upgradeTest $this->objectModel->upgradeWikiTemplates(array($wikiTemplateID)); return $this->objectModel->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($wikiTemplateID)->orderBy('id_desc')->fetch(); } + + /** + * 将wiki下的章节和文章合并为一个html。 + * Merge chapters and articles from the wiki into HTML. + * + * @param int $bookID + * @param int $nodeID + * @return string + */ + public function convertWiki2HtmlTest(int $bookID = 0, int $nodeID = 0): string + { + $html = $this->objectModel->convertWiki2Html($bookID, $nodeID); + return $html; + } } diff --git a/module/upgrade/test/model/convertwiki2html.php b/module/upgrade/test/model/convertwiki2html.php new file mode 100644 index 0000000000..2811392970 --- /dev/null +++ b/module/upgrade/test/model/convertwiki2html.php @@ -0,0 +1,51 @@ +#!/usr/bin/env php +convertWiki2Html(); +timeout=0 +cid=1 + +- 转换文档模板6 @

文档模板6

+- 转换文档模板7 @

文档模板7

+- 转换文档模板8 @

文档模板8

+- 转换文档模板9 @

文档模板9

+- 转换文档模板10 @

文档模板10

+ +*/ + +include dirname(__FILE__, 5) . '/test/lib/init.php'; +include dirname(__FILE__, 2) . '/lib/upgrade.unittest.class.php'; + +zenData('user')->loadYaml('user')->gen(5); +su('admin'); + +$doc = zenData('doc'); +$doc->id->range('1-10'); +$doc->title->range('文档模板1,文档模板2,文档模板3,文档模板4,文档模板5,文档模板6,文档模板7,文档模板8,文档模板9,文档模板10'); +$doc->module->range(''); +$doc->lib->range(''); +$doc->version->range('1'); +$doc->type->range('book{5},html{5}'); +$doc->templateType->range('1{5},``{5}'); +$doc->chapterType->range('``{5},input{5}'); +$doc->template->range('``{5},1,2,3,4,5'); +$doc->parent->range('``{5},1{5}'); +$doc->gen(10); + +$docContent = zenData('doccontent'); +$docContent->id->range('1-10'); +$docContent->doc->range('1-10'); +$docContent->type->range('html'); +$docContent->title->range('文档模板1,文档模板2,文档模板3,文档模板4,文档模板5,文档模板6,文档模板7,文档模板8,文档模板9,文档模板10'); +$docContent->version->range('1'); +$docContent->gen(10); + +$upgrade = new upgradeTest(); +r($upgrade->convertWiki2HtmlTest(1, 6)) && p() && e('

文档模板6

'); // 转换文档模板6 +r($upgrade->convertWiki2HtmlTest(1, 7)) && p() && e('

文档模板7

'); // 转换文档模板7 +r($upgrade->convertWiki2HtmlTest(1, 8)) && p() && e('

文档模板8

'); // 转换文档模板8 +r($upgrade->convertWiki2HtmlTest(1, 9)) && p() && e('

文档模板9

'); // 转换文档模板9 +r($upgrade->convertWiki2HtmlTest(1, 10)) && p() && e('

文档模板10

'); // 转换文档模板10 diff --git a/module/upgrade/test/model/upgradewikitemplates.php b/module/upgrade/test/model/upgradewikitemplates.php index 2b7921d906..72b593ce96 100644 --- a/module/upgrade/test/model/upgradewikitemplates.php +++ b/module/upgrade/test/model/upgradewikitemplates.php @@ -8,6 +8,22 @@ title=测试 upgradeModel->upgradeWikiTemplates(); timeout=0 cid=1 +- 更新文档模板1 + - 属性version @2 + - 属性type @doc +- 更新文档模板2 + - 属性version @2 + - 属性type @doc +- 更新文档模板3 + - 属性version @2 + - 属性type @doc +- 更新文档模板4 + - 属性version @2 + - 属性type @doc +- 更新文档模板5 + - 属性version @2 + - 属性type @doc + */ include dirname(__FILE__, 5) . '/test/lib/init.php';