* Adjust gitlab unit test.

This commit is contained in:
zenggang
2023-12-29 01:46:16 +00:00
parent 38615e3697
commit 0c2e97bb84
4 changed files with 7 additions and 11 deletions
+3 -8
View File
@@ -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列表
r($result) && p() && e('return empty'); //当gitlabID,projectID都为0时,获取GitLabi hook列表
+1 -1
View File
@@ -17,7 +17,7 @@ cid=1
*/
zdTable('pipeline')->gen(5);
zdTable('oauth')->gen(4);
zdTable('oauth')->config('oauth')->gen(4);
$gitlab = $tester->loadModel('gitlab');
+2 -1
View File
@@ -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判断权限是否有维护者权限
r($gitlab->checkUserAccess($gitlabID, $projectID, $project, array(), 'maintainer')) && p() && e('1'); //切换普通用户,使用当前用户是拥有者的项目ID判断权限是否有维护者权限
+1 -1
View File
@@ -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();