bump up version nr
[plcapi.git] / tests / LocalFileTestCase.php
index 688e0df..13160c7 100644 (file)
@@ -2,7 +2,9 @@
 
 include_once __DIR__ . '/parse_args.php';
 
-abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
+include_once __DIR__ . '/PolyfillTestCase.php';
+
+abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase
 {
     public $args = array();
 
@@ -13,7 +15,7 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
     protected $collectCodeCoverageInformation;
     protected $coverageScriptUrl;
 
-    public function run(PHPUnit_Framework_TestResult $result = NULL)
+    public function _run($result = NULL)
     {
         $this->testId = get_class($this) . '__' . $this->getName();
 
@@ -23,7 +25,7 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
 
         $this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation();
 
-        parent::run($result);
+        parent::_run($result);
 
         if ($this->collectCodeCoverageInformation) {
             $coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage(
@@ -41,7 +43,7 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
         return $result;
     }
 
-    protected function request($file, $method = 'GET', $payload = '')
+    protected function request($file, $method = 'GET', $payload = '', $emptyPageOk = false)
     {
         $url = $this->baseUrl . $file;
 
@@ -68,8 +70,11 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
         curl_close($ch);
 
         $this->assertNotFalse($page);
-        $this->assertNotContains('Fatal error', $page);
-        $this->assertNotContains('Notice:', $page);
+        if (!$emptyPageOk) {
+            $this->assertNotEquals('', $page);
+        }
+        $this->assertStringNotContainsStringIgnoringCase('Fatal error', $page);
+        $this->assertStringNotContainsStringIgnoringCase('Notice:', $page);
 
         return $page;
     }