1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
include_once __DIR__ . '/LocalFileTestCase.php'; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Tests for php files in the 'demo' directory |
7
|
|
|
*/ |
8
|
|
|
class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase |
9
|
|
|
{ |
10
|
|
|
public function setUp() |
11
|
|
|
{ |
12
|
|
|
$this->args = argParser::getArgs(); |
13
|
|
|
|
14
|
|
|
$this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] ); |
15
|
|
|
|
16
|
|
|
$this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
public function testAgeSort() |
20
|
|
|
{ |
21
|
|
|
$page = $this->request('client/agesort.php'); |
|
|
|
|
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function testGetStateName() |
25
|
|
|
{ |
26
|
|
|
$page = $this->request('client/getstatename.php'); |
|
|
|
|
27
|
|
|
$page = $this->request('client/getstatename.php', 'POST', array('stateno' => '1')); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function testIntrospect() |
31
|
|
|
{ |
32
|
|
|
$page = $this->request('client/introspect.php'); |
|
|
|
|
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function testMail() |
36
|
|
|
{ |
37
|
|
|
$page = $this->request('client/mail.php'); |
|
|
|
|
38
|
|
|
$page = $this->request('client/mail.php', 'POST', array( |
39
|
|
|
"mailto" => '', |
40
|
|
|
"mailsub" => '', |
41
|
|
|
"mailmsg" => '', |
42
|
|
|
"mailfrom" => '', |
43
|
|
|
"mailcc" => '', |
44
|
|
|
"mailbcc" => '', |
45
|
|
|
)); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function testProxy() |
49
|
|
|
{ |
50
|
|
|
$page = $this->request('client/proxy.php', 'GET', null, true); |
|
|
|
|
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function testWhich() |
54
|
|
|
{ |
55
|
|
|
$page = $this->request('client/which.php'); |
|
|
|
|
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function testWrap() |
59
|
|
|
{ |
60
|
|
|
$page = $this->request('client/wrap.php'); |
|
|
|
|
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function testDiscussServer() |
64
|
|
|
{ |
65
|
|
|
$page = $this->request('server/discuss.php'); |
66
|
|
|
$this->assertContains('<name>faultCode</name>', $page); |
67
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function testProxyServer() |
71
|
|
|
{ |
72
|
|
|
$page = $this->request('server/proxy.php'); |
73
|
|
|
$this->assertContains('<name>faultCode</name>', $page); |
74
|
|
|
$this->assertRegexp('#<int>10(5|3)</int>#', $page); |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|