require_once __DIR__ . "/_bootstrap.php";
-// out-of-band information: let the client manipulate the server operations.
-// we do this to help the testsuite script: do not reproduce in production!
+// Out-of-band information: let the client manipulate the server operations.
+// We do this to help the testsuite script: do not reproduce in production!
if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage';
if (!is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {
*
* @todo add a test for response ok in call testing
* @todo add support for --help option to give users the list of supported parameters
+ * @todo make number of test iterations flexible
+ * @todo add https tests
**/
use PhpXmlRpc\PhpXmlRpc;
if (!$xd) {
+ $num_tests = 25;
+
/// test multicall vs. many calls vs. keep-alives
$encoder = new Encoder();
$value = $encoder->encode($data1, array('auto_dates'));
$req = new Request('interopEchoTests.echoValue', array($value));
$reqs = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$reqs[] = $req;
}
$server = explode(':', $args['HTTPSERVER']);
}
begin_test($testName, 'http 10');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req);
$response[] = $resp->value();
}
if (function_exists('curl_init')) {
begin_test($testName, 'http 11 w. keep-alive');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req, 10, 'http11');
$response[] = $resp->value();
}
$c->keepalive = false;
begin_test($testName, 'http 11');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req, 10, 'http11');
$response[] = $resp->value();
}
begin_test($testName, 'http 10 w. compression');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req);
$response[] = $resp->value();
}
if (function_exists('curl_init')) {
begin_test($testName, 'http 11 w. keep-alive and compression');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req, 10, 'http11');
$response[] = $resp->value();
}
$c->keepalive = false;
begin_test($testName, 'http 11 w. compression');
$response = array();
- for ($i = 0; $i < 25; $i++) {
+ for ($i = 0; $i < $num_tests; $i++) {
$resp = $c->send($req, 10, 'http11');
$response[] = $resp->value();
}
#!/bin/sh
# @todo set up the same user for running tests as on travis (ie. 'travis'), or maybe user 'user' ?
-# @todo make the GID & UID of the user variable
+# @todo make the GID & UID of the user variable (we picked 2000 as it is the one used by default by Travis)
set -e
USERNAME="${1:-test}"
-addgroup --gid 1013 "${USERNAME}"
-adduser --system --uid=1013 --gid=1013 --home "/home/${USERNAME}" --shell /bin/bash "${USERNAME}"
+addgroup --gid 2000 "${USERNAME}"
+adduser --system --uid=2000 --gid=2000 --home "/home/${USERNAME}" --shell /bin/bash "${USERNAME}"
adduser "${USERNAME}" "${USERNAME}"
mkdir -p "/home/${USERNAME}/.ssh"