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

38 lines
1 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=测试 gitModel::setClient();
timeout=0
cid=16553
- 步骤1正常设置git客户端 @git
- 步骤2正常设置http客户端 @http://https-test
- 步骤3设置空字符串客户端 @0
- 步骤4设置null值客户端 @0
- 步骤5传入null参数 @null_repo
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$gitTest = new gitModelTest();
$repo = new stdclass();
$repo->client = 'git';
r($gitTest->setClientTest($repo)) && p() && e('git'); // 步骤1正常设置git客户端
$repo->client = 'http://https-test';
r($gitTest->setClientTest($repo)) && p() && e('http://https-test'); // 步骤2正常设置http客户端
$repo->client = '';
r($gitTest->setClientTest($repo)) && p() && e('0'); // 步骤3设置空字符串客户端
$repo->client = null;
r($gitTest->setClientTest($repo)) && p() && e('0'); // 步骤4设置null值客户端
r($gitTest->setClientTest(null)) && p() && e('null_repo'); // 步骤5传入null参数