* Run ztf update for gitlab.

This commit is contained in:
caoyanyi
2024-03-04 09:28:15 +08:00
parent 2d28b67664
commit 3d9b44fa14
74 changed files with 24 additions and 25 deletions
View File
View File
View File
View File
+1 -1
View File
@@ -31,4 +31,4 @@ $hook->merge_requests_events = true;
r($gitlab->apiCreateHook(0, 0, $emptyHook)) && p() && e('0'); //使用空的gitlabID,projectID,hook对象创建GitLabhook
r($gitlab->apiCreateHook(0, 0, $hook)) && p() && e('0'); //使用空的gitlabID、projectID,正确的hook对象创建GitLabhook
r($gitlab->apiCreateHook($gitlabID, 0, $hook)) && p('message') && e('404 Project Not Found'); //使用正确的gitlabID、hook信息,错误的projectID创建hook
r($gitlab->apiCreateHook($gitlabID, $projectID, $hook)) && p('url') && e('http://unittest.com/api.php/v1/gitlab/webhook?repoID=1'); //通过gitlabID,projectID,hook对象正确创建GitLabhook
r($gitlab->apiCreateHook($gitlabID, $projectID, $hook)) && p('url') && e('http://unittest.com/api.php/v1/gitlab/webhook?repoID=1'); // 通过gitlabID,projectID,hook对象正确创建GitLabhook
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -32,4 +32,4 @@ $response3->message->name = array('已经被使用');
r($gitlab->apiErrorHandlingTest($response1)) && p('0') && e('错误1'); //错误处理1
r($gitlab->apiErrorHandlingTest($response2)) && p('0') && e('保存失败,群组URL路径已经被使用。'); //错误处理2
r($gitlab->apiErrorHandlingTest($response3)) && p('name:0') && e('已经被使用'); //错误处理3
r($gitlab->apiErrorHandlingTest($response3)) && p('name:0') && e('已经被使用'); //错误处理3
+1 -1
View File
@@ -30,4 +30,4 @@ $api = '/user';
r($gitlab->apiGetTest($host, $api)) && p() && e('success'); //用host url 发送一个请求
r($gitlab->apiGetTest($hostID, $api)) && p() && e('success'); //用host ID 发送一个请求
r($gitlab->apiGetTest($host2, $api)) && p() && e('return null'); //用不合规范的host url 发送一个请求
r($gitlab->apiGetTest(0, $api)) && p() && e('return null'); //用不存在host ID 发送一个请求
r($gitlab->apiGetTest(0, $api)) && p() && e('return null'); //用不存在host ID 发送一个请求
@@ -12,7 +12,7 @@ cid=1
- 使用错误的host获取用户信息 @return null
- 使用正确的host,错误的token获取用户信息属性message @401 Unauthorized
- 通过host,token获取用户信息属性id @1
- 通过host,权限不足的token获取用户信息属性error @insufficient_scope
- 通过host,权限不足的token获取用户信息属性error @invalid_token
*/
@@ -38,4 +38,4 @@ r($result) && p('id') && e('1'); //通过host,token获取用户信息
$token = 'glpat-NqAvs1dRxHAvr2tskCZV';
$result = $gitlab->apiGetCurrentUser($host, $token);
r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息
r($result) && p('error') && e('invalid_token'); //通过host,权限不足的token获取用户信息
+1 -1
View File
@@ -35,4 +35,4 @@ r($gitlab->apiGetHooks($gitlabID, 0)) && p('message') && e('404 Project Not Foun
$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列表
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -40,4 +40,4 @@ $project6 = $gitlab->apiGetSingleProjectTest(1, 19, true);
$project7 = $gitlab->apiGetSingleProjectTest(1, 5, false);
r($project5) && p('id') && e('2'); // 用普通用户查询有权限正确的project信息
r($project6) && p('message') && e('404 Project Not Found'); // 用普通用户查询无权限正确的project信息
r($project7) && p('name') && e('privateTest'); // 第三个参数为fales普通用户查询无权限正确的project信息
r($project7) && p('name') && e('privateTest'); // 第三个参数为fales普通用户查询无权限正确的project信息
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -45,4 +45,4 @@ r($gitlabTest->apiUpdateHookTest($gitlabID, 0, $hookID, $hook)) && p('message
r($gitlabTest->apiUpdateHookTest($gitlabID, $projectID, 0, $hook)) && p('message') && e('404 Not found'); //使用空的hookID更新gitlab群组
r($gitlabTest->apiUpdateHookTest(0, $projectID, $hookID, $hook)) && p() && e('0'); //使用错误gitlabID更新群组
r($gitlabTest->apiUpdateHookTest($gitlabID, $projectID, $hookID, $hook)) && p('merge_requests_events,push_events') && e('~~,1'); //通过gitlabID,projectID,分支对象正确更新GitLab分支
r($gitlabTest->apiUpdateHookTest($gitlabID, $projectID, $hookID, $hook)) && p('merge_requests_events,push_events') && e('~~,1'); //通过gitlabID,projectID,分支对象正确更新GitLab分支
+1 -1
View File
@@ -47,4 +47,4 @@ r($gitlab->apiUpdateProject($gitlabID, $project)) && p() && e('0'); //使用空
r($gitlab->apiUpdateProject(0, $project)) && p() && e('0'); //使用错误gitlabID创建群组
$project->id = $projectID;
r($gitlab->apiUpdateProject($gitlabID, $project)) && p('description') && e('apiUpdatedProject'); //通过gitlabID,用户对象正确更新项目描述
r($gitlab->apiUpdateProject($gitlabID, $project)) && p('description') && e('apiUpdatedProject'); //通过gitlabID,用户对象正确更新项目描述
View File
View File
+1 -1
View File
@@ -50,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判断权限是否有维护者权限
View File
View File
+1 -1
View File
@@ -43,4 +43,4 @@ r($gitlab->createUserTest($gitlabID, $user)) && p('0') && e('二次密码不一
$user->password_repeat = '12345678';
$result = $gitlab->createUserTest($gitlabID, $user); //
if(!empty($result[0]) and $result[0] == 'Email has already been taken') $result = true;
r($result) && p() && e('1'); //通过gitlabID,projectID,分支对象正确创建GitLab用户
r($result) && p() && e('1'); //通过gitlabID,projectID,分支对象正确创建GitLab用户
View File
View File
View File
+3 -4
View File
@@ -10,9 +10,8 @@ title=测试 gitlabModel::editProject();
timeout=0
cid=1
- 使用空的projectID创建gitlab群组 @0
- 使用错误gitlabID创建群组 @0
- 通过gitlabID,用户对象正确更新项目描述属性description @apiUpdatedProject
- 使用空的projectID创建gitlab群组第name条的0属性 @项目名称不能为空
- 通过gitlabID,用户对象正确更新项目描述 @1
*/
@@ -50,4 +49,4 @@ r($gitlabTest->editProjectTest($gitlabID, $project)) && p('name:0') && e('项目
$project->name = 'unitTestProject17';
$project->id = $projectID;
r($gitlabTest->editProjectTest($gitlabID, $project)) && p() && e('1'); //通过gitlabID,用户对象正确更新项目描述
r($gitlabTest->editProjectTest($gitlabID, $project)) && p() && e('1'); //通过gitlabID,用户对象正确更新项目描述
+4 -4
View File
@@ -10,9 +10,9 @@ title=测试 gitlabModel::editUser();
timeout=0
cid=1
- 使用空的userID创建gitlab群组 @0
- 使用错误gitlabID创建群组 @0
- 通过gitlabID,用户对象正确更新用户名字属性name @apiUpdatedUser
- 使用空的account更新gitlab用户第account条的0属性 @禅道用户不能为空
- 设置了密码的情况下更新gitlab用户 @二次密码不一致!
- 通过gitlabID,用户对象正确更新用户名字 @1
*/
@@ -53,4 +53,4 @@ r($gitlabTest->editUserTest($gitlabID, $user)) && p('0') && e('二次密码不
unset($user->password);
$user->id = $userID;
r($gitlabTest->editUserTest($gitlabID, $user)) && p() && e('1'); //通过gitlabID,用户对象正确更新用户名字
r($gitlabTest->editUserTest($gitlabID, $user)) && p() && e('1'); //通过gitlabID,用户对象正确更新用户名字
View File
+1 -1
View File
@@ -45,4 +45,4 @@ $path = '/public';
r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('0fd3978da3be5969ef39ff2517cc69cb3a23811c'); // 带/的路径
$path = '/public/';
r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('0fd3978da3be5969ef39ff2517cc69cb3a23811c'); // 带/的路径
r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('0fd3978da3be5969ef39ff2517cc69cb3a23811c'); // 带/的路径
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -99,4 +99,4 @@ r($gitlabModel->isClickable($gitlab7, 'deleteUser')) && p() && e('1'); //计算
r($gitlabModel->isClickable($gitlab8, 'deleteUser')) && p() && e('0'); //计算isAdmin为false是否能进行删除用户操作
r($gitlabModel->isClickable($gitlab9, 'deleteTag')) && p() && e('0'); //计算protected为true是否能进行删除tag操作
r($gitlabModel->isClickable($gitlab10, 'deleteTag')) && p() && e('1'); //计算protected为false是否能进行删除tag操作
r($gitlabModel->isClickable($gitlab10, 'deleteTag')) && p() && e('1'); //计算protected为false是否能进行删除tag操作
+1 -1
View File
@@ -67,4 +67,4 @@ r($gitlab->isDisplay('manageProjectMembers')) && p() && e('1'); //用户2检查m
r($gitlab->isDisplay('createWebhook')) && p() && e('1'); //用户2检查createWebhook权限
r($gitlab->isDisplay('importIssue')) && p() && e('1'); //用户2检查importIssue权限
r($gitlab->isDisplay('editProject')) && p() && e('1'); //用户2检查editProject权限
r($gitlab->isDisplay('deleteProject')) && p() && e('1'); //用户2检查deleteProject权限
r($gitlab->isDisplay('deleteProject')) && p() && e('1'); //用户2检查deleteProject权限
View File
+1 -1
View File
@@ -32,4 +32,4 @@ r($gitlab->saveImportedIssueTest($gitlabID, $projectID, $objectType, $objectID,
$issueID = 3;
$objectType = 'bug';
$objectID = 9;
r($gitlab->saveImportedIssueTest($gitlabID, $projectID, $objectType, $objectID, $issueID)) && p('labels:0') && e('zentao_bug/9'); // 保存导入bug issue。
r($gitlab->saveImportedIssueTest($gitlabID, $projectID, $objectType, $objectID, $issueID)) && p('labels:0') && e('zentao_bug/9'); // 保存导入bug issue。
View File
View File
View File
@@ -45,4 +45,4 @@ $issue->objectID = 1;
r($gitlab->webhookAssignIssueTest($issue)) && p('assignedTo') && e('~~'); // 对象ID正确
$issue->object->assignedTo = 'user1';
r($gitlab->webhookAssignIssueTest($issue)) && p('assignedTo') && e('user1'); // 对象ID正确,更新指派给
r($gitlab->webhookAssignIssueTest($issue)) && p('assignedTo') && e('user1'); // 对象ID正确,更新指派给
View File
@@ -45,4 +45,4 @@ $issue->objectID = 1;
r($gitlab->webhookCloseIssueTest($issue)) && p('lastEditedBy') && e('~~'); // 对象ID正确
$issue->object->lastEditedBy = 'user1';
r($gitlab->webhookCloseIssueTest($issue)) && p('lastEditedBy') && e('user1'); // 对象ID正确,更新最后编辑人
r($gitlab->webhookCloseIssueTest($issue)) && p('lastEditedBy') && e('user1'); // 对象ID正确,更新最后编辑人