Files
EasySoft-ZenTaoPMS/test/model/git/updatecommit.php
2022-05-06 17:33:43 +08:00

31 lines
822 B
PHP
Executable File

#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/git.class.php';
su('admin');
/**
title=测试gitModel->updatecommit();
cid=1
pid=1
测试正常的版本库 >> 1
测试空的版本库 >> 0
*/
$git = new gitTest();
/* Fix error Gitlab url. */
$tester->dao->update(TABLE_PIPELINE)->set('url')->eq('http://10.0.1.161:51080')->where('id')->eq(1)->exec();
$repo = $tester->dao->select('*')->from(TABLE_REPO)->limit(1)->fetch();
if(strtolower($repo->SCM) == 'gitlab') $repo = $tester->loadModel('repo')->processGitlab($repo);
r($git->updateCommit($repo)) && p() && e(1); // 测试正常的版本库
$repo = new stdclass();
r($git->updateCommit($repo)) && p() && e(0); // 测试空的版本库
system("./ztest init");