* @todo add a test for response ok in call testing?
**/
- include(dirname(__FILE__).'/parse_args.php');
+ include_once(__DIR__.'/../vendor/autoload.php');
- require_once('xmlrpc.inc');
+ include(__DIR__.'/parse_args.php');
// Set up PHP structures to be used in many tests
$data1 = array(1, 1.0, 'hello world', true, '20051021T23:43:00', -1, 11.0, '~!@#$%^&*()_+|', false, '20051021T23:43:00');
* @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
**/
- require_once('xmlrpc.inc');
- require_once('xmlrpcs.inc');
-
- // play nice to older PHP versions that miss superglobals
- if(!isset($_SERVER))
- {
- $_SERVER = $HTTP_SERVER_VARS;
- $_GET = isset($HTTP_GET_VARS) ? $HTTP_GET_VARS : array();
- $_POST = isset($HTTP_POST_VARS) ? $HTTP_POST_VARS : array();
- }
-
// check for command line vs web page input params
if(!isset($_SERVER['REQUEST_METHOD']))
{
}
if(!isset($LOCALPATH))
{
- $LOCALPATH = dirname(__FILE__);
+ $LOCALPATH = __DIR__;
}
<?php
-include(dirname(__FILE__).'/parse_args.php');
+include_once(__DIR__.'/../vendor/autoload.php');
-require_once('xmlrpc.inc');
-require_once('xmlrpcs.inc');
-require_once('xmlrpc_wrappers.inc');
+include(__DIR__.'/parse_args.php');
+
+require_once(__DIR__.'/../lib/xmlrpc_wrappers.php');
-require_once 'phpunit.php';
//require_once 'PHPUnit/TestDecorator.php';
-// let testuite run for the needed time
+// let testsuite run for the needed time
if ((int)ini_get('max_execution_time') < 180)
ini_set('max_execution_time', 180);
-$suite = new PHPUnit_TestSuite();
+$suite = new PHPUnit_Framework_TestSuite();
// array with list of failed tests
$failed_tests = array();
-class LocalhostTests extends PHPUnit_TestCase
+class LocalhostTests extends PHPUnit_Framework_TestCase
{
var $client = null;
var $method = 'http';
var $request_compression = null;
var $accepted_compression = '';
- function fail($message = '')
+ static function fail($message = '')
{
- PHPUnit_TestCase::fail($message);
+ parent::fail($message);
// save in global var that this particular test has failed
// (but only if not called from subclass objects / multitests)
if (function_exists('debug_backtrace') && strtolower(get_class($this)) == 'localhosttests')
}
}
-class ParsingBugsTests extends PHPUnit_TestCase
+class ParsingBugsTests extends PHPUnit_Framework_TestCase
{
function testMinusOneString()
{
}
}
-class InvalidHostTests extends PHPUnit_TestCase
+class InvalidHostTests extends PHPUnit_Framework_TestCase
{
var $client = null;
if(isset($_SERVER['REQUEST_METHOD']))
{
echo "<h3>Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."</h3>\n";
- echo '<h3>Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...</h3>\n";
+ echo '<h3>Running '.$suite->count().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...</h3>\n";
flush();
@ob_flush();
}
else
{
echo "Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."\n";
- echo 'Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.$LOCALSERVER.$URI.' and https://'.$HTTPSSERVER.$HTTPSURI."\n\n";
+ echo 'Running '.$suite->count().' tests (some of which are multiple) against servers: http://'.$LOCALSERVER.$URI.' and https://'.$HTTPSSERVER.$HTTPSURI."\n\n";
}
// do some basic timing measurement
list($micro, $sec) = explode(' ', microtime());
$start_time = $sec + $micro;
-$PHPUnit = new PHPUnit;
-$result = $PHPUnit->run($suite, ($DEBUG == 0 ? '.' : '<hr/>'));
+//$PHPUnit = new PHPUnit;
+//$result = $PHPUnit->run($suite, ($DEBUG == 0 ? '.' : '<hr/>'));
+$result = $suite->run();
list($micro, $sec) = explode(' ', microtime());
$end_time = $sec + $micro;