From 7fc3b6d4e964f81b0ae7ec527562db4b13515e63 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 14 Feb 2022 15:19:07 +0800 Subject: [PATCH] * Modify test case. --- module/gitlab/model.php | 2 +- test/model/gitlab/apigetgroups.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/gitlab/model.php b/module/gitlab/model.php index f7699c0219..fa7ac1df24 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -610,7 +610,7 @@ class gitlabModel extends model { $url .= '&owned=true'; } - elseif(!empty($minRole)) + elseif(!empty($minRole) and isset($this->config->gitlab->accessLevel[$minRole])) { $url .= '&min_access_level=' . $this->config->gitlab->accessLevel[$minRole]; } diff --git a/test/model/gitlab/apigetgroups.php b/test/model/gitlab/apigetgroups.php index eb2205a25c..bac0cf63c9 100644 --- a/test/model/gitlab/apigetgroups.php +++ b/test/model/gitlab/apigetgroups.php @@ -21,22 +21,22 @@ if(!$result) $result = 'return null'; r($result) && p() && e('return null'); //使用空的数据查询群组 $gitlabID = 1; -$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); +$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); if($result) $result = 'return true'; r($result) && p() && e('return true'); //使用正确的gitlabID查询群组 $orderBy = 'abc'; -$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); +$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); if(is_array($result)) $result = 'return true'; r($result) && p() && e('return true'); //使用错误的orderBy查询群组 $orderBy = 'name_asc'; $minRole = 'owner'; -$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); +$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); if(is_array($result)) $result = 'return true'; r($result) && p() && e('return true'); //通过gitlabID,orderBy查询群组 $minRole = 'abc'; -$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); -if(is_array($result) && empty($result)) $result = 'return true'; +$result = $gitlab->apiGetGroups($gitlabID, $orderBy, $minRole); +if(is_array($result)) $result = 'return true'; r($result) && p() && e('return true'); //通过错误的minRole查询群组