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