* Adjust unit test case for git->getRepoLogs.

This commit is contained in:
caoyanyi
2023-12-22 17:20:51 +08:00
parent 3ebb5279d6
commit 95bb7b58a6
9 changed files with 86 additions and 57 deletions
Regular → Executable
+6 -20
View File
@@ -92,28 +92,14 @@ class gitTest
/**
* Get repo logs.
*
* @param object $repo
* @param int $repoID
* @param string $branch
* @access public
* @return int
* @return array
*/
public function getRepoLogs($repo)
public function getRepoLogs(int $repoID, string $branch): array
{
$logs = $this->gitModel->getRepoLogs($repo, '');
if(is_array($logs) and count($logs) >= 1) return 1;
return 0;
}
/**
* Convert log from xml format to object.
*
* @param object $log
* @access public
* @return object
*/
public function convertLog($log)
{
$parsedLogs = $this->gitModel->convertLog($log);
if(empty($parsedLogs->revision)) $parsedLogs->revision = 0;
return $parsedLogs;
$repo = $this->gitModel->loadModel('repo')->getByID($repoID);
return $this->gitModel->getRepoLogs($repo, $branch);
}
}