From 33b92a395f2d2bbcc3522b7ef984df2b02d1ddf7 Mon Sep 17 00:00:00 2001 From: gggeek Date: Wed, 10 Dec 2014 00:53:05 +0000 Subject: [PATCH] WIP testsuite refactoring --- test/benchmark.php | 4 ++-- test/parse_args.php | 13 +------------ test/testsuite.php | 32 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/test/benchmark.php b/test/benchmark.php index 0c183d5b..8c0f6941 100644 --- a/test/benchmark.php +++ b/test/benchmark.php @@ -8,9 +8,9 @@ * @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'); diff --git a/test/parse_args.php b/test/parse_args.php index 418b18c7..f8e2f558 100644 --- a/test/parse_args.php +++ b/test/parse_args.php @@ -13,17 +13,6 @@ * @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'])) { @@ -135,5 +124,5 @@ } if(!isset($LOCALPATH)) { - $LOCALPATH = dirname(__FILE__); + $LOCALPATH = __DIR__; } diff --git a/test/testsuite.php b/test/testsuite.php index a5fe24b8..c1a111b5 100644 --- a/test/testsuite.php +++ b/test/testsuite.php @@ -1,24 +1,23 @@ Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."\n"; - echo '

Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...

\n"; + echo '

Running '.$suite->count().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...

\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 ? '.' : '
')); +//$PHPUnit = new PHPUnit; +//$result = $PHPUnit->run($suite, ($DEBUG == 0 ? '.' : '
')); +$result = $suite->run(); list($micro, $sec) = explode(' ', microtime()); $end_time = $sec + $micro; -- 2.47.0