* Finish task#110989
This commit is contained in:
@@ -6,22 +6,23 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 gitlabModel::isWebhookExists();
|
||||
title=测试 gitlabModel::addPushWebhook();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 检查url为空的webhook是否存在 @0
|
||||
- 用正常的url检查webhook是否存在 @1
|
||||
- 使用repoID为1,不存在的项目id推送webhook @0
|
||||
- 使用repoID为1,存在的项目id推送webhook @1
|
||||
|
||||
*/
|
||||
|
||||
zdTable('pipeline')->gen(5);
|
||||
zdTable('repo')->config('repo')->gen(1);
|
||||
zdTable('repo')->gen(1);
|
||||
|
||||
$gitlab = new gitlabTest();
|
||||
|
||||
$repoID = 1;
|
||||
$url = 'http:/api.php/v1/gitlab/webhook?repoID=1';
|
||||
$token = '';
|
||||
$_SERVER['REQUEST_URI'] = 'http://unittest/';
|
||||
|
||||
r($gitlab->isWebhookExistsTest($repoID, '')) && p() && e('0'); //检查url为空的webhook是否存在
|
||||
r($gitlab->isWebhookExistsTest($repoID, $url)) && p() && e('1'); //用正常的url检查webhook是否存在
|
||||
r($gitlab->addPushWebhookTest($repoID, $token)) && p() && e('0'); //使用repoID为1,不存在的项目id推送webhook
|
||||
r($gitlab->addPushWebhookTest($repoID, $token, 2)) && p() && e('1'); //使用repoID为1,存在的项目id推送webhook
|
||||
Reference in New Issue
Block a user