diff --git a/module/gitlab/test/model/apigethooks.php b/module/gitlab/test/model/apigethooks.php index 9366713a07..b6c34b75bb 100644 --- a/module/gitlab/test/model/apigethooks.php +++ b/module/gitlab/test/model/apigethooks.php @@ -11,7 +11,6 @@ cid=1 - 通过gitlabID,projectID,获取GitLab hook列表 @1 - 通过gitlabID,projectID,获取GitLab hook数量 @1 - 通过指定hookID获取hook信息 @1 -- 当前项目没有hook时,获取GitLab hook列表 @0 - 当gitlabID存在,projectID不存在时,获取GitLab hook列表属性message @404 Project Not Found - 当gitlabID,projectID都为0时,获取GitLabi hook列表 @return empty @@ -30,14 +29,10 @@ r(isset($hook->url)) && p() && e('1'); //通过gitlabID,projectID,获取Git r(count($result) > 0) && p() && e('1'); //通过gitlabID,projectID,获取GitLab hook数量 r(isset($hookResult->id)) && p() && e('1'); //通过指定hookID获取hook信息 -$gitlabID = 1; -$projectID = 1; -r(count($gitlab->apiGetHooks($gitlabID, $projectID))) && p() && e('0'); //当前项目没有hook时,获取GitLab hook列表 - -$gitlabID = 1; -$result = $gitlab->apiGetHooks($gitlabID, 0); +$gitlabID = 1; +$result = $gitlab->apiGetHooks($gitlabID, 0); r($gitlab->apiGetHooks($gitlabID, 0)) && p('message') && e('404 Project Not Found'); //当gitlabID存在,projectID不存在时,获取GitLab hook列表 $result = $gitlab->apiGetHooks(0, 0); if(empty($result)) $result = 'return empty'; -r($result) && p() && e('return empty'); //当gitlabID,projectID都为0时,获取GitLabi hook列表 \ No newline at end of file +r($result) && p() && e('return empty'); //当gitlabID,projectID都为0时,获取GitLabi hook列表 diff --git a/module/gitlab/test/model/apigetusers.php b/module/gitlab/test/model/apigetusers.php index cf0310c4d7..49660c642c 100644 --- a/module/gitlab/test/model/apigetusers.php +++ b/module/gitlab/test/model/apigetusers.php @@ -17,7 +17,7 @@ cid=1 */ zdTable('pipeline')->gen(5); -zdTable('oauth')->gen(4); +zdTable('oauth')->config('oauth')->gen(4); $gitlab = $tester->loadModel('gitlab'); diff --git a/module/gitlab/test/model/checkuseraccess.php b/module/gitlab/test/model/checkuseraccess.php index 85e31195a3..4287002eaf 100755 --- a/module/gitlab/test/model/checkuseraccess.php +++ b/module/gitlab/test/model/checkuseraccess.php @@ -22,6 +22,7 @@ cid=1 zdTable('pipeline')->gen(5); zdTable('user')->gen(10); zdTable('company')->gen(1); +zdTable('oauth')->config('oauth')->gen(4); $gitlab = $tester->loadModel('gitlab'); @@ -49,4 +50,4 @@ r($gitlab->checkUserAccess($gitlabID, $projectID, $project)) && p() && e('1'); / $projectID = 9; r($gitlab->checkUserAccess($gitlabID, $projectID, null, array(), 'maintainer')) && p() && e('0'); //切换普通用户,使用当前用户是开发者的项目ID判断权限是否有维护者权限 -r($gitlab->checkUserAccess($gitlabID, $projectID, $project, array(), 'maintainer')) && p() && e('1'); //切换普通用户,使用当前用户是拥有者的项目ID判断权限是否有维护者权限 \ No newline at end of file +r($gitlab->checkUserAccess($gitlabID, $projectID, $project, array(), 'maintainer')) && p() && e('1'); //切换普通用户,使用当前用户是拥有者的项目ID判断权限是否有维护者权限 diff --git a/module/gitlab/test/model/getmatchedusers.php b/module/gitlab/test/model/getmatchedusers.php index 9bea3ab6d7..8d1cad0bd6 100644 --- a/module/gitlab/test/model/getmatchedusers.php +++ b/module/gitlab/test/model/getmatchedusers.php @@ -22,7 +22,7 @@ cid=1 */ zdTable('pipeline')->gen(5); -zdTable('oauth')->gen(5); +zdTable('oauth')->config('oauth')->gen(5); zdTable('user')->gen(10); $gitlab = new gitlabTest();