* Adjust unit test case for repo.

This commit is contained in:
caoyanyi
2024-04-22 10:48:55 +08:00
parent c01c70de1d
commit f07035a4fc
2 changed files with 15 additions and 9 deletions
+10 -7
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
su('admin');
/**
@@ -9,24 +8,28 @@ title=测试 gitlabModel::getGitlabProjects();
timeout=0
cid=1
- 使用正确的gitlabID,空的filter查询群组属性name @testHtml
- 普通用户使用正确的gitlabID,IS_DEVELOPER filter查询群组属性name @testHtml
- 普通用户使用正确的gitlabID,filter查询群组属性name @testHtml
- 使用正确的gitlabID,空的filter查询群组属性name @unittest1
- 普通用户使用正确的gitlabID,IS_DEVELOPER filter查询群组属性name @privateProject
- 普通用户使用正确的gitlabID,filter查询群组属性name @unittest1
*/
zdTable('pipeline')->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查询群组
r(end($result)) && p('name') && e('unittest1'); //普通用户使用正确的gitlabID,filter查询群组