Esempio n. 1
0
 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package - Request2');
     $suite->addTestSuite('HTTP_Request2_MultipartBodyTest');
     $suite->addTestSuite('HTTP_Request2_ResponseTest');
     $suite->addTest(Request2_Adapter_AllTests::suite());
     return $suite;
 }
class Request2_Adapter_AllTests
{
    public static function main()
    {
        PHPUnit_TextUI_TestRunner::run(self::suite());
    }
    public static function suite()
    {
        $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package - Request2 - Adapter');
        $suite->addTestSuite('HTTP_Request2_Adapter_MockTest');
        if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL) {
            $suite->addTestSuite('HTTP_Request2_Adapter_SocketTest');
        } else {
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketTest');
        }
        if (defined('HTTP_REQUEST2_TESTS_PROXY_HOST') && HTTP_REQUEST2_TESTS_PROXY_HOST && defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL) {
            $suite->addTestSuite('HTTP_Request2_Adapter_SocketProxyTest');
        } else {
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketProxyTest');
        }
        if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL && extension_loaded('curl')) {
            $suite->addTestSuite('HTTP_Request2_Adapter_CurlTest');
        } else {
            $suite->addTestSuite('HTTP_Request2_Adapter_Skip_CurlTest');
        }
        return $suite;
    }
}
if (PHPUnit_MAIN_METHOD == 'Request2_Adapter_AllTests::main') {
    Request2_Adapter_AllTests::main();
}