include_once __DIR__ . '/LocalFileTestCase.php';
+/**
+ * Tests for php files in the 'demo' directory
+ */
class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
{
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
- $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] );
+ $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] );
- $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+ $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');
}
- public function testClient()
+ public function testGetStateName()
{
- $page = $this->request('client/client.php');
-
- // we could test many more calls to the client demo, but the upstream server is gone anyway...
-
- $page = $this->request('client/client.php', 'POST', array('stateno' => '1'));
- }
-
- public function testComment()
- {
- $page = $this->request('client/comment.php');
- $page = $this->request('client/client.php', 'POST', array('storyid' => '1'));
+ $page = $this->request('client/getstatename.php');
+ $page = $this->request('client/getstatename.php', 'POST', array('stateno' => '1'));
}
public function testIntrospect()
public function testMail()
{
$page = $this->request('client/mail.php');
- $page = $this->request('client/client.php', 'POST', array(
- 'server' => '',
+ $page = $this->request('client/mail.php', 'POST', array(
"mailto" => '',
"mailsub" => '',
"mailmsg" => '',
));
}
- public function testSimpleCall()
+ public function testProxy()
{
- $page = $this->request('client/simple_call.php');
+ $page = $this->request('client/proxy.php', 'GET', null, true);
}
public function testWhich()
$page = $this->request('client/wrap.php');
}
- public function testZopeTest()
- {
- $page = $this->request('client/zopetest.php');
- }
-
public function testDiscussServer()
{
+ /// @todo add a couple of proper xmlrpc calls, too
$page = $this->request('server/discuss.php');
- $this->assertContains('<name>faultCode</name>', $page);
+ $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');
- $this->assertContains('<name>faultCode</name>', $page);
+ $this->assertStringContainsString('<name>faultCode</name>', $page);
$this->assertRegexp('#<int>10(5|3)</int>#', $page);
}
}