Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Unit tests for HTTP_Request2 package
4
 *
5
 * PHP version 5
6
 *
7
 * LICENSE:
8
 *
9
 * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net>
10
 * All rights reserved.
11
 *
12
 * Redistribution and use in source and binary forms, with or without
13
 * modification, are permitted provided that the following conditions
14
 * are met:
15
 *
16
 *    * Redistributions of source code must retain the above copyright
17
 *      notice, this list of conditions and the following disclaimer.
18
 *    * Redistributions in binary form must reproduce the above copyright
19
 *      notice, this list of conditions and the following disclaimer in the
20
 *      documentation and/or other materials provided with the distribution.
21
 *    * The names of the authors may not be used to endorse or promote products
22
 *      derived from this software without specific prior written permission.
23
 *
24
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
25
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
 *
36
 * @category   HTTP
37
 * @package    HTTP_Request2
38
 * @author     Alexey Borzov <avb@php.net>
39
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
40
 * @version    SVN: $Id: AllTests.php 309665 2011-03-24 21:03:48Z avb $
41
 * @link       http://pear.php.net/package/HTTP_Request2
42
 */
43
 
44
if (!defined('PHPUnit_MAIN_METHOD')) {
45
    define('PHPUnit_MAIN_METHOD', 'Request2_Adapter_AllTests::main');
46
}
47
 
48
require_once dirname(__FILE__) . '/MockTest.php';
49
require_once dirname(__FILE__) . '/SkippedTests.php';
50
require_once dirname(__FILE__) . '/SocketTest.php';
51
require_once dirname(__FILE__) . '/SocketProxyTest.php';
52
require_once dirname(__FILE__) . '/CurlTest.php';
53
 
54
class Request2_Adapter_AllTests
55
{
56
    public static function main()
57
    {
58
        PHPUnit_TextUI_TestRunner::run(self::suite());
59
    }
60
 
61
    public static function suite()
62
    {
63
        $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package - Request2 - Adapter');
64
 
65
        $suite->addTestSuite('HTTP_Request2_Adapter_MockTest');
66
        if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL) {
67
            $suite->addTestSuite('HTTP_Request2_Adapter_SocketTest');
68
        } else {
69
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketTest');
70
        }
71
        if (defined('HTTP_REQUEST2_TESTS_PROXY_HOST') && HTTP_REQUEST2_TESTS_PROXY_HOST
72
            && defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL
73
        ) {
74
            $suite->addTestSuite('HTTP_Request2_Adapter_SocketProxyTest');
75
        } else {
76
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketProxyTest');
77
        }
78
        if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL
79
            && extension_loaded('curl')
80
        ) {
81
            $suite->addTestSuite('HTTP_Request2_Adapter_CurlTest');
82
        } else {
83
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_CurlTest');
84
        }
85
 
86
        return $suite;
87
    }
88
}
89
 
90
if (PHPUnit_MAIN_METHOD == 'Request2_Adapter_AllTests::main') {
91
    Request2_Adapter_AllTests::main();
92
}
93
?>