From 306670e7dc80910bd3eecbd3e6c00d17bbcd93f0 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 20 Aug 2025 00:55:29 +0000 Subject: [PATCH] * [unittest] modify unittest. --- module/webhook/test/model/builddata.php | 10 +++++++--- module/webhook/test/model/getbindaccount.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/webhook/test/model/builddata.php b/module/webhook/test/model/builddata.php index 57a3008108..786f6af412 100755 --- a/module/webhook/test/model/builddata.php +++ b/module/webhook/test/model/builddata.php @@ -14,6 +14,7 @@ timeout=0 cid=1 - 正常传入的情况 @12 +- 不传objectType第markdown条的title属性 @admin创建了发布 - 不传objectType @0 - 不传actionType @0 - 不传actionID @0 @@ -45,6 +46,9 @@ $result3 = $webhook->buildDataTest($objectType[0], $objectID[0], $actionType[1], $result4 = $webhook->buildDataTest($objectType[0], $objectID[0], $actionType[0], $actionID[1]); r(strpos($result1, 'markdown')) && p() && e('12'); //正常传入的情况 -r($result2) && p() && e('0'); //不传objectType -r($result3) && p() && e('0'); //不传actionType -r($result4) && p() && e('0'); //不传actionID \ No newline at end of file + +$result1 = json_decode($result1, true); +r($result1) && p('markdown:title') && e('admin创建了发布'); //不传objectType +r($result2) && p() && e('0'); //不传objectType +r($result3) && p() && e('0'); //不传actionType +r($result4) && p() && e('0'); //不传actionID \ No newline at end of file diff --git a/module/webhook/test/model/getbindaccount.php b/module/webhook/test/model/getbindaccount.php index 326fb256b2..85239b7e24 100755 --- a/module/webhook/test/model/getbindaccount.php +++ b/module/webhook/test/model/getbindaccount.php @@ -42,7 +42,7 @@ $result4 = $webhook->getBindAccountTest(1, 'webhook', 10); $result5 = $webhook->getBindAccountTest(1, 'gitea', 3); r($result1) && p() && e('user3'); //按条件查出openID=1的关联用户 -r($result2) && p() && e('0'); //按条件查出openID=空时,关联的用户 +r($result2) && p() && e('0'); //按条件查出openID=空时,关联的用户 r($result3) && p() && e('user10'); //按条件查出openID=8的关联用户 r($result4) && p() && e('user12'); //按条件查出openID=10的关联用户 r($result5) && p() && e('user5'); //按条件查出openID=3的关联用户 \ No newline at end of file