merge upstream phpxmlrpc
[plcapi.git] / php / phpxmlrpc / tests / 7DemofilesTest.php
similarity index 68%
rename from php/phpxmlrpc/tests/5DemofilesTest.php
rename to php/phpxmlrpc/tests/7DemofilesTest.php
index 3cbb5b4..7c4b775 100644 (file)
@@ -1,19 +1,19 @@
 <?php
 
-include_once __DIR__ . '/LocalFileTestCase.php';
+include_once __DIR__ . '/WebTestCase.php';
 
 /**
  * Tests for php files in the 'demo' directory
  */
-class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
+class DemoFilesTest extends PhpXmlRpc_WebTestCase
 {
-    public function setUp()
+    public function set_up()
     {
         $this->args = argParser::getArgs();
 
-        $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] );
+        $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] );
 
-        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
     }
 
     public function testAgeSort()
@@ -62,15 +62,17 @@ class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
 
     public function testDiscussServer()
     {
+        /// @todo add a couple of proper xmlrpc calls, too
         $page = $this->request('server/discuss.php');
-        $this->assertContains('<name>faultCode</name>', $page);
+        $this->assertStringContainsString('<name>faultCode</name>', $page);
         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
     }
 
     public function testProxyServer()
     {
+        /// @todo add a couple of proper xmlrpc calls, too
         $page = $this->request('server/proxy.php');
-        $this->assertContains('<name>faultCode</name>', $page);
+        $this->assertStringContainsString('<name>faultCode</name>', $page);
         $this->assertRegexp('#<int>10(5|3)</int>#', $page);
     }
 }