diff --git a/module/repo/test/model/getgitlabprojects.php b/module/repo/test/model/getgitlabprojects.php index 65920482b8..4b0b4a3eb3 100755 --- a/module/repo/test/model/getgitlabprojects.php +++ b/module/repo/test/model/getgitlabprojects.php @@ -1,7 +1,6 @@ #!/usr/bin/env php gen(5); zdTable('user')->gen(10); +zdTable('repo')->config('repo')->gen(5); zdTable('oauth')->config('oauth')->gen(5); +su('admin'); $repo = $tester->loadModel('repo'); $gitlabID = 1; $projectFilters = array('IS_DEVELOPER', 'ALL'); $result = $repo->getGitlabProjects($gitlabID, ''); -r(end($result)) && p('name') && e('testHtml'); //使用正确的gitlabID,空的filter查询群组 +r(end($result)) && p('name') && e('unittest1'); //使用正确的gitlabID,空的filter查询群组 + su('user6'); $result = $repo->getGitlabProjects($gitlabID, $projectFilters[0]); -r(end($result)) && p('name') && e('testHtml'); //普通用户使用正确的gitlabID,IS_DEVELOPER filter查询群组 +r(end($result)) && p('name') && e('privateProject'); //普通用户使用正确的gitlabID,IS_DEVELOPER filter查询群组 + $result = $repo->getGitlabProjects($gitlabID, $projectFilters[1]); -r(end($result)) && p('name') && e('testHtml'); //普通用户使用正确的gitlabID,filter查询群组 \ No newline at end of file +r(end($result)) && p('name') && e('unittest1'); //普通用户使用正确的gitlabID,filter查询群组 \ No newline at end of file diff --git a/module/repo/test/model/getimportedprojects.php b/module/repo/test/model/getimportedprojects.php old mode 100644 new mode 100755 index 02b29850e8..bd7bbea7c8 --- a/module/repo/test/model/getimportedprojects.php +++ b/module/repo/test/model/getimportedprojects.php @@ -10,11 +10,14 @@ title=测试 repoModel->getImportedProjects(); timeout=0 cid=1 +- 查询已关联的版本库服务器ID为1的版本库列表属性1 @1 +- 查询未关联的版本库服务器ID为2的版本库列表,结果应该为空属性1 @0 + */ zdTable('repo')->config('repo')->gen(4); $repo = $tester->loadModel('repo'); -r($repo->getImportedProjects(1)) && p('1:serviceProject') && e('1'); // 查询已关联的版本库服务器ID为1的版本库列表 -r($repo->getImportedProjects(2)) && p('1:serviceProject') && e('0'); // 查询未关联的版本库服务器ID为2的版本库列表,结果应该为空 +r($repo->getImportedProjects(1)) && p('1') && e('1'); // 查询已关联的版本库服务器ID为1的版本库列表 +r($repo->getImportedProjects(2)) && p('1') && e('0'); // 查询未关联的版本库服务器ID为2的版本库列表,结果应该为空 \ No newline at end of file