* [unittest] adjust gitlab unit test case.

This commit is contained in:
caoyanyi
2025-06-05 16:03:42 +08:00
parent e5830c5ee1
commit 8e5b35b306
6 changed files with 52 additions and 18 deletions
+10 -4
View File
@@ -10,15 +10,17 @@ title=测试gitlabModel->updateCodePath();
timeout=0
cid=1
- 更新版本库的代码地址属性path @http://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml
- 更新版本库的代码地址属性path @https://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml
- 使用不存在的gitlabID更新代码库的代码地址 @0
- 使用不存在的projectID更新代码库的代码地址 @0
- 更新版本库的代码地址 @http://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml
- 更新版本库的代码地址 @http://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml
*/
$repo = zenData('repo')->loadYaml('repo');
$repo->path->range('');
$repo->gen(4);
$repo->gen(5);
$gitlab = new gitlabTest();
@@ -29,7 +31,11 @@ $repoID = 1;
$result1 = $gitlab->updateCodePathTest($gitlabID, $projectID, $repoID);
$result2 = $gitlab->updateCodePathTest(0, $projectID, $repoID);
$result3 = $gitlab->updateCodePathTest($gitlabID, 0, $repoID);
$result4 = $gitlab->updateCodePathTest($gitlabID, $projectID, $repoID);
$result5 = $gitlab->updateCodePathTest($gitlabID, $projectID, $repoID);
r($result1) && p('path') && e('http://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml'); // 更新版本库的代码地址
r($result1) && p('path') && e('https://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml'); // 更新版本库的代码地址
r($result2) && p() && e('0'); // 使用不存在的gitlabID更新代码库的代码地址
r($result3) && p() && e('0'); // 使用不存在的projectID更新代码库的代码地址
r($result3) && p() && e('0'); // 使用不存在的projectID更新代码库的代码地址
r($result4) && p('path') && e('https://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml'); // 更新版本库的代码地址
r($result5) && p('path') && e('https://gitlabdev.qc.oop.cc/gitlab-instance-76af86df/testhtml'); // 更新版本库的代码地址