From 20f386500f802da2e485e2b424d20b2bddcafc17 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 2 Jan 2024 09:25:35 +0800 Subject: [PATCH] * Modify unit test results of myModel::getStoriesBySearch. --- module/my/test/model/getstoriesbysearch.php | 36 +++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/module/my/test/model/getstoriesbysearch.php b/module/my/test/model/getstoriesbysearch.php index beae65d8c6..1c09ea17ff 100755 --- a/module/my/test/model/getstoriesbysearch.php +++ b/module/my/test/model/getstoriesbysearch.php @@ -1,6 +1,30 @@ #!/usr/bin/env php getStoriesBySearch(); +cid=1 + +- 测试获取 queryID 0 类型 contribute 排序 id_desc 的需求。 @17,13,8,7,6,3,2,1 + +- 测试获取 queryID 0 类型 contribute 排序 id_asc 的需求。 @1,2,3,6,7,8,13,17 + +- 测试获取 queryID 0 类型 other 排序 id_desc 的需求。 @16,13,7,1 + +- 测试获取 queryID 0 类型 other 排序 id_asc 的需求。 @1,7,13,16 + +- 测试获取 queryID 1 类型 contribute 排序 id_desc 的需求。 @17,13,1 + +- 测试获取 queryID 1 类型 contribute 排序 id_asc 的需求。 @1,13,17 + +- 测试获取 queryID 1 类型 other 排序 id_desc 的需求。 @16,13,1 + +- 测试获取 queryID 1 类型 other 排序 id_asc 的需求。 @1,13,16 + +*/ + include dirname(__FILE__, 5) . '/test/lib/init.php'; include dirname(__FILE__, 2) . '/my.class.php'; @@ -13,14 +37,6 @@ zdTable('user')->gen('1'); su('admin'); -/** - -title=测试 myModel->getStoriesBySearch(); -cid=1 -pid=1 - -*/ - $my = new myTest(); $queryID = array(0, 2); $typeList = array('contribute', 'other'); @@ -28,8 +44,8 @@ $orderBy = array('id_desc', 'id_asc'); r($my->getStoriesBySearchTest($queryID[0], $typeList[0], $orderBy[0])) && p() && e('17,13,8,7,6,3,2,1'); // 测试获取 queryID 0 类型 contribute 排序 id_desc 的需求。 r($my->getStoriesBySearchTest($queryID[0], $typeList[0], $orderBy[1])) && p() && e('1,2,3,6,7,8,13,17'); // 测试获取 queryID 0 类型 contribute 排序 id_asc 的需求。 -r($my->getStoriesBySearchTest($queryID[0], $typeList[1], $orderBy[0])) && p() && e('16,13,8,7,1'); // 测试获取 queryID 0 类型 other 排序 id_desc 的需求。 -r($my->getStoriesBySearchTest($queryID[0], $typeList[1], $orderBy[1])) && p() && e('1,7,8,13,16'); // 测试获取 queryID 0 类型 other 排序 id_asc 的需求。 +r($my->getStoriesBySearchTest($queryID[0], $typeList[1], $orderBy[0])) && p() && e('16,13,7,1'); // 测试获取 queryID 0 类型 other 排序 id_desc 的需求。 +r($my->getStoriesBySearchTest($queryID[0], $typeList[1], $orderBy[1])) && p() && e('1,7,13,16'); // 测试获取 queryID 0 类型 other 排序 id_asc 的需求。 r($my->getStoriesBySearchTest($queryID[1], $typeList[0], $orderBy[0])) && p() && e('17,13,1'); // 测试获取 queryID 1 类型 contribute 排序 id_desc 的需求。 r($my->getStoriesBySearchTest($queryID[1], $typeList[0], $orderBy[1])) && p() && e('1,13,17'); // 测试获取 queryID 1 类型 contribute 排序 id_asc 的需求。 r($my->getStoriesBySearchTest($queryID[1], $typeList[1], $orderBy[0])) && p() && e('16,13,1'); // 测试获取 queryID 1 类型 other 排序 id_desc 的需求。