diff --git a/test/class/user.class.php b/test/class/user.class.php index 74d15feb0c..2b640c2de3 100755 --- a/test/class/user.class.php +++ b/test/class/user.class.php @@ -587,7 +587,8 @@ class userTest $contacts = $this->objectModel->getContactLists($account, $params); if(dao::isError()) return dao::getError(); - return $contacts; + + return $contacts ? $contacts : 0; } /** diff --git a/test/model/user/getcontactlists.php b/test/model/user/getcontactlists.php index ba55fad705..0050230723 100755 --- a/test/model/user/getcontactlists.php +++ b/test/model/user/getcontactlists.php @@ -4,19 +4,32 @@ include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php'; su('admin'); +$userContactList = zdTable('usercontact'); +$userContactList->gen(100); + /** title=测试 userModel::getContactLists(); cid=1 pid=1 +获取user1的联系人列表,取出空对应的值 >> 联系人 +获取dev2的联系人列表,判断空对应的值是否为空 >> 1 +获取test3的联系人列表的总数 >> 3 获取admin的联系人列表 >> 0 +获取空用户的联系人列表 >> 0 */ -$user = new userTest(); -$adminContactList1 = $user->getContactListsTest('admin', 'withempty|withnote'); -$adminContactList2 = $user->getContactListsTest('admin', ''); -$test2ContactList = $user->getContactListsTest('test2'); -$emptyContactList = $user->getContactListsTest('', ''); -r($adminContactList) && p() && e('0'); // 获取admin的联系人列表 \ No newline at end of file +$user = new userTest(); +$user1ContactList = $user->getContactListsTest('user1', 'withempty|withnote'); +$dev2ContactList = $user->getContactListsTest('dev2', 'withempty'); +$test3ContactList = $user->getContactListsTest('test3'); +$adminContactList = $user->getContactListsTest('admin'); +$emptyContactList = $user->getContactListsTest(''); + +r($user1ContactList['']) && p() && e('联系人'); // 获取user1的联系人列表,取出空对应的值 +r($dev2ContactList[''] === '') && p() && e('1'); // 获取dev2的联系人列表,判断空对应的值是否为空 +r(count($test3ContactList)) && p() && e('3'); // 获取test3的联系人列表的总数 +r($adminContactList) && p() && e('0'); // 获取admin的联系人列表 +r($emptyContactList) && p() && e('0'); // 获取空用户的联系人列表