X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FHttpMessage_005.phpt;fp=tests%2FHttpMessage_005.phpt;h=6466d6e22d9e33dc45e16a397320897fd2eb58a0;hb=2a76e8214572645ccdecb20c7b6ad24b65a626b1;hp=0000000000000000000000000000000000000000;hpb=bbe81747963aa5b1bd27dff95f923b6b446f5a04;p=m6w6%2Fext-http diff --git a/tests/HttpMessage_005.phpt b/tests/HttpMessage_005.phpt new file mode 100644 index 0000000..6466d6e --- /dev/null +++ b/tests/HttpMessage_005.phpt @@ -0,0 +1,86 @@ +--TEST-- +HttpMessage::prepend() +--SKIPIF-- + +--FILE-- +prepend($m2); +$m2 = NULL; +echo $m1->toString(true); + +$m1->prepend($m1->detach(), false); +echo $m1->toString(true); + +echo "Done\n"; +?> +--EXPECTF-- +%sTEST +GET http://example.com/ HTTP/1.0 +HTTP/1.1 200 ok +Server: Funky/2.0 +Content-Type: text/html +Content-Length: 9 + +Hi there! +GET / HTTP/1.1 +Host: example.com +Accept: */* +Connection: close +HTTP/1.1 200 ok +Server: Funky/1.0 +Content-Type: text/plain +Content-Length: 3 + +Hi! +GET http://example.com/ HTTP/1.0 +HTTP/1.1 200 ok +Server: Funky/2.0 +Content-Type: text/html +Content-Length: 9 + +Hi there! +GET / HTTP/1.1 +Host: example.com +Accept: */* +Connection: close +HTTP/1.1 200 ok +Server: Funky/1.0 +Content-Type: text/plain +Content-Length: 3 + +Hi! +HTTP/1.1 200 ok +Server: Funky/1.0 +Content-Type: text/plain +Content-Length: 3 + +Hi! +Done \ No newline at end of file