znt/module/svn/test/model/setclient.php

57 lines
2.2 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 svnModel::setClient();
timeout=0
cid=18722
- 执行svnTest模块的setClientTest方法参数是$repo 属性client @svn --non-interactive
- 执行svnTest模块的setClientTest方法参数是$repo 属性client @svn --non-interactive
- 执行svnTest模块的setClientTest方法参数是$repo 属性client @svn --non-interactive
- 执行svnTest模块的setClientTest方法参数是$repo 属性client @svn --non-interactive --username testuser --password testpass --no-auth-cache
- 执行svnTest模块的setClientTest方法参数是$repo 属性result @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$svnTest = new svnModelTest();
// 步骤1测试HTTPS协议且无用户名密码的情况SVN客户端不存在时返回false
$repo = new stdclass();
$repo->client = 'svn';
$repo->path = 'https://example.com/svn/repo';
r($svnTest->setClientTest($repo)) && p('client') && e('svn --non-interactive');
// 步骤2测试HTTP协议且无用户名密码的情况HTTP不需要版本检查
$repo = new stdclass();
$repo->client = 'svn';
$repo->path = 'http://example.com/svn/repo';
r($svnTest->setClientTest($repo)) && p('client') && e('svn --non-interactive');
// 步骤3测试SVN协议且有用户名密码的情况SVN客户端不存在时返回false
$repo = new stdclass();
$repo->client = 'svn';
$repo->path = 'svn://example.com/svn/repo';
$repo->account = 'testuser';
$repo->password = 'testpass';
r($svnTest->setClientTest($repo)) && p('client') && e('svn --non-interactive');
// 步骤4测试HTTP协议且有用户名密码的情况
$repo = new stdclass();
$repo->client = 'svn';
$repo->path = 'http://example.com/svn/repo';
$repo->account = 'testuser';
$repo->password = 'testpass';
r($svnTest->setClientTest($repo)) && p('client') && e('svn --non-interactive --username testuser --password testpass --no-auth-cache');
// 步骤5测试HTTP协议方法返回值验证
$repo = new stdclass();
$repo->client = 'svn';
$repo->path = 'http://example.com/svn/repo';
r($svnTest->setClientTest($repo)) && p('result') && e('1');