1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
include_once __DIR__ . '/WebTestCase.php'; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Tests for php files in the 'demo' directory |
7
|
|
|
*/ |
8
|
|
|
class DemoFilesTest extends PhpXmlRpc_WebTestCase |
9
|
|
|
{ |
10
|
|
|
public function set_up() |
11
|
|
|
{ |
12
|
|
|
$this->args = argParser::getArgs(); |
13
|
|
|
|
14
|
|
|
// assumes HTTPURI to be in the form /tests/index.php?etc... |
15
|
|
|
$this->baseUrl = $this->args['HTTPSERVER'] . preg_replace('|\?.+|', '', $this->args['HTTPURI']); |
16
|
|
|
$this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
public function testAgeSort() |
20
|
|
|
{ |
21
|
|
|
$page = $this->request('?demo=client/agesort.php'); |
|
|
|
|
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function testGetStateName() |
25
|
|
|
{ |
26
|
|
|
$page = $this->request('?demo=client/getstatename.php'); |
|
|
|
|
27
|
|
|
$page = $this->request('?demo=client/getstatename.php', 'POST', array('stateno' => '1')); |
|
|
|
|
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function testIntrospect() |
31
|
|
|
{ |
32
|
|
|
$page = $this->request('?demo=client/introspect.php'); |
|
|
|
|
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function testParallel() |
36
|
|
|
{ |
37
|
|
|
$page = $this->request('?demo=client/parallel.php'); |
|
|
|
|
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function testProxy() |
41
|
|
|
{ |
42
|
|
|
$page = $this->request('?demo=client/proxy.php', 'GET', null, true); |
|
|
|
|
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function testWhich() |
46
|
|
|
{ |
47
|
|
|
$page = $this->request('?demo=client/which.php'); |
|
|
|
|
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function testWrap() |
51
|
|
|
{ |
52
|
|
|
$page = $this->request('?demo=client/wrap.php'); |
|
|
|
|
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function testDiscussServer() |
56
|
|
|
{ |
57
|
|
|
/// @todo add a couple of proper xmlrpc calls, too |
58
|
|
|
$page = $this->request('?demo=server/discuss.php'); |
59
|
|
|
$this->assertStringContainsString('<name>faultCode</name>', $page); |
|
|
|
|
60
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
|
|
|
|
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function testProxyServer() |
64
|
|
|
{ |
65
|
|
|
/// @todo add a couple of proper xmlrpc calls, too |
66
|
|
|
$page = $this->request('?demo=server/proxy.php'); |
67
|
|
|
$this->assertStringContainsString('<name>faultCode</name>', $page); |
|
|
|
|
68
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
|
|
|
|
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|