diff --git a/test/class/doc.class.php b/test/class/doc.class.php index d783a52374..db2d6326de 100644 --- a/test/class/doc.class.php +++ b/test/class/doc.class.php @@ -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); diff --git a/test/model/doc/getpreandnextdoc.php b/test/model/doc/getpreandnextdoc.php index 0e9019503d..4a635940d4 100644 --- a/test/model/doc/getpreandnextdoc.php +++ b/test/model/doc/getpreandnextdoc.php @@ -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(); \ No newline at end of file +$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不存在的数据 diff --git a/test/model/doc/getstatisticinfo.php b/test/model/doc/getstatisticinfo.php index 26ceba1733..c095600292 100644 --- a/test/model/doc/getstatisticinfo.php +++ b/test/model/doc/getstatisticinfo.php @@ -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(); \ No newline at end of file +r($doc->getStatisticInfoTest()) && p('totalDocs,todayEditedDocs,lastEditedDocs,lastAddedDocs,myCollection,myDocs,pastEditedDocs') && e('900,0,0,900,0,900,900'); //测试正常查询 diff --git a/test/ztest b/test/ztest index 188e7995af..d8da371a22 100755 --- a/test/ztest +++ b/test/ztest @@ -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;