Make charset-related tests more friendly to hhvm; stricter tests for demo files
[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 testClient()
22     {
23         $page = $this->request('client/client.php');
24
25         // we could test many more calls to the client demo, but the upstream server is gone anyway...
26
27         $page = $this->request('client/client.php', 'POST', array('stateno' => '1'));
28     }
29
30     public function testComment()
31     {
32         $page = $this->request('client/comment.php');
33         $page = $this->request('client/client.php', 'POST', array('storyid' => '1'));
34     }
35
36     public function testIntrospect()
37     {
38         $page = $this->request('client/introspect.php');
39     }
40
41     public function testMail()
42     {
43         $page = $this->request('client/mail.php');
44         $page = $this->request('client/client.php', 'POST', array(
45             'server' => '',
46             "mailto" => '',
47             "mailsub" => '',
48             "mailmsg" => '',
49             "mailfrom" => '',
50             "mailcc" => '',
51             "mailbcc" => '',
52         ));
53     }
54
55     public function testSimpleCall()
56     {
57         $page = $this->request('client/simple_call.php', 'GET', null, true);
58     }
59
60     public function testWhich()
61     {
62         $page = $this->request('client/which.php');
63     }
64
65     public function testWrap()
66     {
67         $page = $this->request('client/wrap.php');
68     }
69
70     public function testZopeTest()
71     {
72         $page = $this->request('client/zopetest.php');
73     }
74
75     public function testDiscussServer()
76     {
77         $page = $this->request('server/discuss.php');
78         $this->assertContains('<name>faultCode</name>', $page);
79         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
80     }
81
82     public function testProxyServer()
83     {
84         $page = $this->request('server/proxy.php');
85         $this->assertContains('<name>faultCode</name>', $page);
86         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
87     }
88 }