* Add repo unit test.

This commit is contained in:
zenggang
2024-01-03 03:25:42 +00:00
parent a9db14ca39
commit 99c1ab49da
4 changed files with 82 additions and 0 deletions
@@ -0,0 +1,28 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/repo.class.php';
su('admin');
/**
title=测试 repoModel->updateCommitDate();
timeout=0
cid=1
- 更新gitlab版本库属性lastCommit @2023-12-23 11:39:02
- 更新gitea版本库属性lastCommit @~~
- 更新空版本库 @return empty
*/
zdTable('repo')->config('repo')->gen(5);
$repo = new repoTest();
$gitlabID = 1;
$giteaID = 3;
r($repo->updateCommitDateTest($gitlabID)) && p('lastCommit') && e('2023-12-23 11:39:02'); //更新gitlab版本库
r($repo->updateCommitDateTest($giteaID)) && p('lastCommit') && e('~~'); //更新gitea版本库
r($repo->updateCommitDateTest(0)) && p() && e('return empty'); //更新空版本库