* Adjust unit test case for git->updateCommit.
This commit is contained in:
@@ -1,25 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/git.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试gitModel->updatecommit();
|
||||
title=gitModel->updateCommit();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 测试正常的版本库 @1
|
||||
- 测试空的版本库 @0
|
||||
- 未同步的代码库 @0
|
||||
- 已同步的代码库
|
||||
- 属性id @3
|
||||
- 属性repo @1
|
||||
- 属性commit @3
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/git.class.php';
|
||||
|
||||
$repo = zdTable('repo')->config('repo');
|
||||
$repo->path->range('https://gitlabdev.qc.oop.cc/root/unittest1');
|
||||
$repo->gen(3);
|
||||
zdTable('repohistory')->config('repohistory')->gen(1);
|
||||
su('admin');
|
||||
|
||||
$git = new gitTest();
|
||||
|
||||
$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); // 测试正常的版本库
|
||||
r($git->updateCommitTest(2)) && p() && e('0'); // 未同步的代码库
|
||||
|
||||
$repo = new stdclass();
|
||||
r($git->updateCommit($repo)) && p() && e(0); // 测试空的版本库
|
||||
r($git->updateCommitTest(1)) && p('id,repo,commit') && e('1,1,1'); // 已同步的代码库
|
||||
|
||||
Reference in New Issue
Block a user