* Add test case for doc.

This commit is contained in:
tianshujie
2022-05-07 15:07:56 +08:00
parent 5a0d28b484
commit 7784f07677
4 changed files with 54 additions and 5 deletions
+14
View File
@@ -448,6 +448,12 @@ class docTest
return $objects;
}
/**
* Get statistic information.
*
* @access public
* @return object
*/
public function getStatisticInfoTest()
{
$objects = $this->objectModel->getStatisticInfo();
@@ -457,6 +463,14 @@ class docTest
return $objects;
}
/**
* Get the previous and next doc.
*
* @param int $docID
* @param int $libID
* @access public
* @return object
*/
public function getPreAndNextDocTest($docID, $libID)
{
$objects = $this->objectModel->getPreAndNextDoc($docID, $libID);
+35 -2
View File
@@ -10,10 +10,43 @@ title=测试 docModel->getPreAndNextDoc();
cid=1
pid=1
查询空数据 >> ,
查询文档ID为空的数据 >> ,
查询文档ID为空的数据 >> ,
查询文档ID为空的数据 >> ,
查询文档库ID为空的数据 >> ,
查询文档库ID为空的数据 >> ,
查询文档库ID为空的数据 >> ,
查询文档ID为1并且文档库ID为1的数据 >> ,
查询文档ID为2并且文档库ID为1的数据 >> ,
查询文档ID不存在并且文档库ID为1的数据 >> ,
查询文档ID为1并且文档库ID为2的数据 >> ,
查询文档ID为2并且文档库ID为2的数据 >> ,
查询文档ID不存在并且文档库ID为2的数据 >> ,
查询文档ID为1并且文档库ID不存在的数据 >> ,
查询文档ID为2并且文档库ID不存在的数据 >> ,
查询文档ID不存在并且文档库ID不存在的数据 >> ,
*/
$doc = new docTest();
r($doc->getPreAndNextDocTest()) && p() && e();
$docIDList = array(0, 1, 2, 1000);
$libIDList = array(0, 1, 2, 1000);
r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[0])) && p('pre,next') && e(','); // 查询空数据
r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID为1的数据
r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID为1的数据
r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID为1的数据
r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID为2的数据
r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID为2的数据
r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID为2的数据
r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID不存在的数据
r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID不存在的数据
r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID不存在的数据
+2 -3
View File
@@ -10,10 +10,9 @@ title=测试 docModel->getStatisticInfo();
cid=1
pid=1
测试正常查询 >> 900,0,0,900,0,900,900
*/
$doc = new docTest();
r($doc->getStatisticInfoTest()) && p() && e();
r($doc->getStatisticInfoTest()) && p('totalDocs,todayEditedDocs,lastEditedDocs,lastAddedDocs,myCollection,myDocs,pastEditedDocs') && e('900,0,0,900,0,900,900'); //测试正常查询
+3
View File
@@ -49,6 +49,9 @@ switch($argv[1])
case 'design':
ztfRun('model/design');
break;
case 'doc':
ztfRun('model/doc');
break;
case 'file':
ztfRun('model/file');
break;