- some test fixup
authorMichael Wallner <mike@php.net>
Sun, 19 Mar 2006 13:13:16 +0000 (13:13 +0000)
committerMichael Wallner <mike@php.net>
Sun, 19 Mar 2006 13:13:16 +0000 (13:13 +0000)
tests/HttpMessage_001.phpt
tests/HttpRequest_004.phpt
tests/build_url_001.phpt
tests/ut_HttpMessage.phpt

index c2fe79a33e6cb64c0cdbec2daeabb26d91ddf955..e787523b2f20a57ebbb15906ee6db1502771f225 100644 (file)
@@ -30,9 +30,12 @@ $x = $m->getParentMessage();
 
 var_dump($m->getBody());
 var_dump(HttpMessage::fromString($m->toString(true))->toString(true));
-do {
-       var_dump($m->toString());
-} while ($m = $m->getParentMessage());
+try {
+       do {
+               var_dump($m->toString());
+       } while ($m = $m->getParentMessage());
+} catch (HttpException $ex) {
+}
 
 echo "Done\n";
 ?>
index a9ade65320c51f4c359188bbe0349666cb384c15..4c253e095ab8c5ede1c181a0c96c6c7887b01270 100644 (file)
@@ -69,7 +69,7 @@ array(2) {
 }
 
 Second Request
-string(269) "Array
+string(285) "Array
 (
     [0] => Array
         (
@@ -84,7 +84,7 @@ string(269) "Array
         )
 
 )
-string(56) "0[int]=1&0[dbl]=3.1415926535898&1[str]=something&1[nil]="
+string(72) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D="
 "
 array(2) {
   [0]=>
@@ -104,7 +104,7 @@ array(2) {
 }
 
 Third Request
-string(286) "Array
+string(302) "Array
 (
     [0] => Array
         (
@@ -120,7 +120,7 @@ string(286) "Array
 
     [x] => X
 )
-string(60) "0[int]=1&0[dbl]=3.1415926535898&1[str]=something&1[nil]=&x=X"
+string(76) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=&x=X"
 "
 array(2) {
   [0]=>
index 541e0f35d4678cc77809d02a214e7504b16e75e8..d131f55503dbe38b289e3e04eff5a64bdf07bb54 100644 (file)
@@ -9,9 +9,10 @@ include 'skip.inc';
 echo "-TEST\n";
 echo http_build_url('page'), "\n";
 echo http_build_url('with/some/path/'), "\n";
+echo "Done\n";
 ?>
 --EXPECTF--
 %sTEST
-http://localhost/page
-http://localhost/with/some/path/
-
+http://%s/page
+http://%s/with/some/path/
+Done
index 9e8e6d12ff5e5140b520c3f0cf9d0dbbd328df06..dd3668027270952656991b8eb6c3b7233b773cea 100644 (file)
@@ -164,9 +164,12 @@ class HttpMessageTest extends PHPUnit2_Framework_TestCase
 
     function test_getParentMessage()
     {
-        $this->assertNull($this->emptyMessage->getParentMessage());
         $this->assertTrue($this->responseMessage->getParentMessage() instanceOf HttpMessage);
-        $this->assertNull($this->requestMessage->getParentMessage());
+        try {
+            $this->requestMessage->getParentMessage();
+            $this->assertTrue(false, "\$this->requestMessage->getParentMessage() did not throw an exception");
+        } catch (HttpRuntimeException $ex) {
+        }
     }
 
     function test_send()