+ Add unit test for svn.

This commit is contained in:
caoyanyi
2023-12-12 09:28:41 +08:00
parent e366239905
commit a5368eded0
6 changed files with 112 additions and 6 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env php
<?php
/**
title=svnModel->setClient();
timeout=0
cid=1
- 测试https开头没有用户名密码的svn地址 @/usr/bin/svn --non-interactive --trust-server-cert
- 测试http开头没有用户名密码的svn地址 @/usr/bin/svn --non-interactive
- 测试svn开头有用户名密码的svn地址 @/usr/bin/svn --non-interactive --trust-server-cert --username test --password test --no-auth-cache
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
su('admin');
global $tester;
$svn = $tester->loadModel('svn');
$repo = new stdclass();
$repo->client = '/usr/bin/svn';
$repo->path = 'https://https-test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive --trust-server-cert'); // 测试https开头没有用户名密码的svn地址
$repo->path = 'http://https-test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive'); // 测试http开头没有用户名密码的svn地址
$repo->path = 'svn://https-test';
$repo->account = 'test';
$repo->password = 'test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive --trust-server-cert --username test --password test --no-auth-cache'); // 测试svn开头有用户名密码的svn地址