|
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 testVardemo() |
|
20
|
|
|
{ |
|
21
|
|
|
$page = $this->request('?demo=vardemo.php'); |
|
|
|
|
|
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
// *** client *** |
|
25
|
|
|
|
|
26
|
|
|
public function testAgeSort() |
|
27
|
|
|
{ |
|
28
|
|
|
$page = $this->request('?demo=client/agesort.php'); |
|
|
|
|
|
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function testCodegen() |
|
32
|
|
|
{ |
|
33
|
|
|
$page = $this->request('?demo=client/codegen.php'); |
|
|
|
|
|
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function testGetStateName() |
|
37
|
|
|
{ |
|
38
|
|
|
$page = $this->request('?demo=client/getstatename.php'); |
|
|
|
|
|
|
39
|
|
|
$page = $this->request('?demo=client/getstatename.php', 'POST', array('stateno' => '1')); |
|
|
|
|
|
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function testIntrospect() |
|
43
|
|
|
{ |
|
44
|
|
|
$page = $this->request('?demo=client/introspect.php'); |
|
|
|
|
|
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function testParallel() |
|
48
|
|
|
{ |
|
49
|
|
|
$page = $this->request('?demo=client/parallel.php'); |
|
|
|
|
|
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function testProxy() |
|
53
|
|
|
{ |
|
54
|
|
|
$page = $this->request('?demo=client/proxy.php', 'GET', null, true); |
|
|
|
|
|
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function testWhich() |
|
58
|
|
|
{ |
|
59
|
|
|
$page = $this->request('?demo=client/which.php'); |
|
|
|
|
|
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function testWindowsCharset() |
|
63
|
|
|
{ |
|
64
|
|
|
$page = $this->request('?demo=client/windowscharset.php'); |
|
|
|
|
|
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function testWrap() |
|
68
|
|
|
{ |
|
69
|
|
|
$page = $this->request('?demo=client/wrap.php'); |
|
|
|
|
|
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
// *** servers *** |
|
73
|
|
|
|
|
74
|
|
|
public function testCodegenServer() |
|
75
|
|
|
{ |
|
76
|
|
|
/// @todo add a couple of proper xmlrpc calls, too |
|
77
|
|
|
$page = $this->request('?demo=server/codegen.php'); |
|
78
|
|
|
$this->assertStringContainsString('<name>faultCode</name>', $page); |
|
|
|
|
|
|
79
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
|
|
|
|
|
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function testDiscussServer() |
|
83
|
|
|
{ |
|
84
|
|
|
/// @todo add a couple of proper xmlrpc calls, too |
|
85
|
|
|
$page = $this->request('?demo=server/discuss.php'); |
|
86
|
|
|
$this->assertStringContainsString('<name>faultCode</name>', $page); |
|
|
|
|
|
|
87
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
|
|
|
|
|
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function testProxyServer() |
|
91
|
|
|
{ |
|
92
|
|
|
/// @todo add a couple of proper xmlrpc calls, too |
|
93
|
|
|
$page = $this->request('?demo=server/proxy.php'); |
|
94
|
|
|
$this->assertStringContainsString('<name>faultCode</name>', $page); |
|
|
|
|
|
|
95
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
|
|
|
|
|
|
96
|
|
|
} |
|
97
|
|
|
} |
|
98
|
|
|
|