- add test
authorMichael Wallner <mike@php.net>
Wed, 28 Dec 2005 22:34:18 +0000 (22:34 +0000)
committerMichael Wallner <mike@php.net>
Wed, 28 Dec 2005 22:34:18 +0000 (22:34 +0000)
tests/HttpRequest_007.phpt [new file with mode: 0644]

diff --git a/tests/HttpRequest_007.phpt b/tests/HttpRequest_007.phpt
new file mode 100644 (file)
index 0000000..d8a7e66
--- /dev/null
@@ -0,0 +1,43 @@
+--TEST--
+HttpRequest PUT
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcls('HttpRequest');
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+
+$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r->recordHistory = true;
+$r->addHeaders(array('content-type' => 'text/plain'));
+$r->setPutFile(__FILE__);
+$r->send();
+var_dump($r->getRawRequestMessage());
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+string(467) "PUT /.print_request.php HTTP/1.1
+User-Agent: PECL::HTTP/0.21.0dev (PHP/5.1.2-dev)
+Host: dev.iworks.at
+Accept: */*
+content-type: text/plain
+Content-Length: 278
+Expect: 100-continue
+
+<?php
+echo "-TEST\n";
+
+$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r->recordHistory = true;
+$r->addHeaders(array('content-type' => 'text/plain'));
+$r->setPutFile(__FILE__);
+$r->send();
+var_dump($r->getRawRequestMessage());
+echo "Done\n";
+?>
+"
+Done
+