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";
?>
}
Second Request
-string(269) "Array
+string(285) "Array
(
[0] => 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]=>
}
Third Request
-string(286) "Array
+string(302) "Array
(
[0] => 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]=>
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
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()