* Adjust svn code error for unit test.

This commit is contained in:
caoyanyi
2023-12-22 13:33:48 +08:00
parent aec82dafce
commit 9ed2a5f68e
2 changed files with 11 additions and 4 deletions
+3 -3
View File
@@ -262,9 +262,9 @@ class svnModel extends model
$this->client = $repo->client . " --non-interactive";
if(stripos($repo->path, 'https') === 0 || stripos($repo->path, 'svn') === 0)
{
$cmd = $repo->client . ' --version --quiet';
$cmd = $repo->client . ' --version --quiet';
$version = `$cmd`;
if(version_compare($version, '1.6.0', '>'))
if(version_compare((string)$version, '1.6.0', '>'))
{
$this->client .= ' --trust-server-cert';
}
@@ -406,7 +406,7 @@ class svnModel extends model
* @access private
* @return object|false
*/
private function getRepoByURL(string $url): object|false
public function getRepoByURL(string $url): object|false
{
if(empty($this->repos)) $this->setRepos();
foreach($this->repos as $repo)
+8 -1
View File
@@ -23,7 +23,14 @@ class svnTest
return $this->objectModel->dao->select('*')->from(TABLE_REPOHISTORY)->where('id')->eq(2)->fetch();
}
public function getRepoLogsTest(int $version): object|bool
/**
* Test getRepoLogs method.
*
* @param int $version
* @access public
* @return object|bool|null
*/
public function getRepoLogsTest(int $version): object|bool|null
{
$this->objectModel->setRepos();
ob_start();