* @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj
**/
-if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_prepend.php";
-
header('Content-Type: text/html; charset=utf-8');
?>
?>
</body>
</html>
-<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_append.php"; ?>
* @todo if js libs are not available, do not try to load them
**/
-if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_prepend.php";
-
// Make sure we set the correct charset type for output, so that we can display all characters
header('Content-Type: text/html; charset=utf-8');
</form>
</body>
</html>
-<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_append.php"; ?>
<?php
-if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_prepend.php";
-
$query = '';
if (isset($_GET['run'])) {
$path = parse_url($_GET['run']);
<frame name="frmaction" src="action.php" marginwidth="0" marginheight="0" frameborder="0"/>
</frameset>
</html>
-<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "/../demo/server/_append.php"; ?>
+++ /dev/null
-<?php
-
-// Out-of-band information: let the client manipulate the page operations.
-// We do this to help the testsuite script: do not reproduce in production!
-if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
- include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
-}
die();
}
-// Make errors visible
-ini_set('display_errors', true);
-error_reporting(E_ALL);
-
// Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer
include_once __DIR__ . '/../../src/Autoloader.php';
PhpXmlRpc\Autoloader::register();
define('XMLRPCSERVER', 'http://gggeek.altervista.org/sw/xmlrpc/demo/server/server.php');
}
-// Out-of-band information: let the client manipulate the page 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'])) {
- mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']);
- chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777);
- }
-
- include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php";
-}
-
// A helper for cli vs web output:
function output($text)
{
}
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
<p>Enter a state number to query its name</p>");
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
<?php
-
require_once __DIR__ . "/_prepend.php";
output('<html lang="en">
}
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
</body>
</html>
');
-
-require_once __DIR__ . "/_append.php";
<?php
-
require_once __DIR__ . "/_prepend.php";
use PhpXmlRpc\Encoder;
$resp = $client->send($reqs);
$t = microtime(true) - $t;
echo "Multicall send: $t secs\n";
-
-require_once __DIR__ . "/_append.php";
output("State $stateNo is ".htmlspecialchars($stateName));
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
}
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
}
output("</body></html>\n");
-
-require_once __DIR__ . "/_append.php";
+++ /dev/null
-<?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!
-if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
- include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
-}
* Hackish code used to make the demos both viewable as source, runnable, and viewable as html
*/
-// Make errors visible
-ini_set('display_errors', true);
-error_reporting(E_ALL);
-
if (isset($_GET['showSource']) && $_GET['showSource']) {
$file = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)[0]['file'];
highlight_file($file);
// Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer
include_once __DIR__ . '/../../src/Autoloader.php';
PhpXmlRpc\Autoloader::register();
-
-// 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'])) {
- mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']);
- chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777);
- }
-
- include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php";
-}
"docstring" => $getComments_doc,
),
));
-
-require_once __DIR__ . "/_append.php";
),
)
);
-
-require_once __DIR__ . "/_append.php";
$s->service();
// That should do all we need!
-
-require_once __DIR__ . "/_append.php";
output("</pre>\n");
output('</body></html>');
-
-require_once __DIR__ . "/client/_append.php";
<exclude>
<directory>./build</directory>
<directory>./doc</directory>
- <directory>./extras</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
<file>./pakefile.php</file>
$this->client->port = $server[1];
}
$this->client->server = $server[0];
- $this->client->path = $this->args['HTTPURI'];
+ $this->client->path = str_replace('/demo/server/server.php', '/tests/index.php?demo=server/server.php', $this->args['HTTPURI']);
$r = $this->client->send($m, 5, 'http11');
$this->assertEquals(0, $r->faultCode());
{
$this->args = argParser::getArgs();
+ $uri = str_replace('/demo/server/server.php', '/tests/index.php?demo=server/server.php', $this->args['HTTPURI']);
$server = explode(':', $this->args['HTTPSERVER']);
if (count($server) > 1) {
- $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
+ $this->client = new xmlrpc_client($uri, $server[0], $server[1]);
} else {
- $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
+ $this->client = new xmlrpc_client($uri, $this->args['HTTPSERVER']);
}
$this->client->setDebug($this->args['DEBUG']);
$this->client->request_compression = $this->request_compression;
$this->client->accepted_compression = $this->accepted_compression;
- $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
+ $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']);
if ($this->args['DEBUG'] == 1)
ob_start();
{
if ($this->expectHttp2) {
$hr = $r->httpResponse();
- $this->assertEquals("2", $hr['protocol_version']);
+ $this->assertEquals("2", @$hr['protocol_version']);
} else {
}
{
$this->args = argParser::getArgs();
- $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] );
+ $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/index.php', $this->args['HTTPURI'] );
- $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
+ $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/phpunit_coverage.php', $this->args['HTTPURI'] );
}
public function testAgeSort()
{
- $page = $this->request('client/agesort.php');
+ $page = $this->request('?demo=client/agesort.php');
}
public function testGetStateName()
{
- $page = $this->request('client/getstatename.php');
- $page = $this->request('client/getstatename.php', 'POST', array('stateno' => '1'));
+ $page = $this->request('?demo=client/getstatename.php');
+ $page = $this->request('?demo=client/getstatename.php', 'POST', array('stateno' => '1'));
}
public function testIntrospect()
{
- $page = $this->request('client/introspect.php');
+ $page = $this->request('?demo=client/introspect.php');
}
public function testMail()
{
- $page = $this->request('client/mail.php');
- $page = $this->request('client/mail.php', 'POST', array(
+ $page = $this->request('?demo=client/mail.php');
+ $page = $this->request('?demo=client/mail.php', 'POST', array(
"mailto" => '',
"mailsub" => '',
"mailmsg" => '',
public function testParallel()
{
- $page = $this->request('client/parallel.php');
+ $page = $this->request('?demo=client/parallel.php');
}
public function testProxy()
{
- $page = $this->request('client/proxy.php', 'GET', null, true);
+ $page = $this->request('?demo=client/proxy.php', 'GET', null, true);
}
public function testWhich()
{
- $page = $this->request('client/which.php');
+ $page = $this->request('?demo=client/which.php');
}
public function testWrap()
{
- $page = $this->request('client/wrap.php');
+ $page = $this->request('?demo=client/wrap.php');
}
public function testDiscussServer()
{
/// @todo add a couple of proper xmlrpc calls, too
- $page = $this->request('server/discuss.php');
+ $page = $this->request('?demo=server/discuss.php');
$this->assertStringContainsString('<name>faultCode</name>', $page);
$this->assertRegexp('#<int>10(5|3)</int>#', $page);
}
public function testProxyServer()
{
/// @todo add a couple of proper xmlrpc calls, too
- $page = $this->request('server/proxy.php');
+ $page = $this->request('?demo=server/proxy.php');
$this->assertStringContainsString('<name>faultCode</name>', $page);
$this->assertRegexp('#<int>10(5|3)</int>#', $page);
}
{
$this->args = argParser::getArgs();
- $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['HTTPURI'] );
+ $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/index.php', $this->args['HTTPURI'] );
- $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
+ $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/phpunit_coverage.php', $this->args['HTTPURI'] );
}
public function testIndex()
{
- $page = $this->request('index.php');
+ $page = $this->request('?debugger=index.php');
}
public function testController()
{
- $page = $this->request('controller.php');
+ $page = $this->request('?debugger=controller.php');
}
/**
*/
public function testAction()
{
- $page = $this->request('action.php');
+ $page = $this->request('?debugger=action.php');
}
}
{
$this->args = argParser::getArgs();
- $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/extras/', $this->args['HTTPURI'] );
+ $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/index.php', $this->args['HTTPURI'] );
- $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
+ $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/phpunit_coverage.php', $this->args['HTTPURI'] );
}
- /**
- * @todo collect code coverage for this...
- */
public function testBenchmark()
{
- $page = $this->request('benchmark.php');
+ $page = $this->request('?extras=benchmark.php');
}
- /**
- * @todo collect code coverage for this...
- */
public function testVerifyCompat()
{
- $page = $this->request('verify_compat.php');
+ $page = $this->request('?extras=verify_compat.php');
}
public function testVarDemo()
{
- $this->baseUrl = str_replace('/extras/', '/demo/', $this->baseUrl);
- $page = $this->request('vardemo.php');
+ $page = $this->request('?demo=vardemo.php');
}
}
# Env vars used by the test code, which we get from the environment
SetEnv HTTPSERVER ${HTTPSERVER}
- SetEnv TESTMODE true
<Directory "${TESTS_ROOT_DIR}">
Options FollowSymLinks MultiViews
# Env vars used by the test code, which we get from the environment
SetEnv HTTPSERVER ${HTTPSERVER}
- SetEnv TESTMODE true
<Directory "${TESTS_ROOT_DIR}">
Options FollowSymLinks MultiViews
--- /dev/null
+<?php
+
+// File accessed by http requests as part of the test suite, enabling testing of demo, debugger, extras files.
+// It triggers generation of code-coverage information
+
+// Make errors visible
+ini_set('display_errors', true);
+error_reporting(E_ALL);
+
+// Out-of-band information: let the client manipulate the page operations
+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'])) {
+ mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']);
+ chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777);
+ }
+
+ include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php";
+}
+
+$targetFile = null;
+$rootDir = dirname(__DIR__);
+if (isset($_GET['debugger'])) {
+ if (strpos(realpath($rootDir.'/debugger/'.$_GET['debugger']), realpath($rootDir.'/debugger/')) === 0) {
+ $targetFile = realpath($rootDir.'/debugger/'.$_GET['debugger']);
+ }
+} elseif (isset($_GET['demo'])) {
+ if (strpos(realpath($rootDir.'/demo/'.$_GET['demo']), realpath($rootDir.'/demo/')) === 0) {
+ $targetFile = realpath($rootDir.'/demo/'.$_GET['demo']);
+ }
+} elseif (isset($_GET['extras'])) {
+ if (strpos(realpath($rootDir.'/extras/'.$_GET['extras']), realpath($rootDir.'/extras/')) === 0) {
+ $targetFile = realpath($rootDir.'/extras/'.$_GET['extras']);
+ }
+}
+if ($targetFile) {
+ include $targetFile;
+}
+
+if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
+ include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
+}