 ===================================================================
 --- ports/classes/net/xp_framework/unittest/peer/HttpResponseTest.class.php	(revision 0)
 +++ ports/classes/net/xp_framework/unittest/peer/HttpResponseTest.class.php	(revision 0)
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,90 @@
 +<?php
 +/* This class is part of the XP framework
 + *

+    }
+
+    /**
+     * Test what happens when the server responds with an incorrect protocol
+     *
+     */

+    protected function newResponse(array $headers, $body= '') {
+      return new HttpResponse(new MemoryInputStream(implode("\r\n", $headers)."\r\n\r\n".$body));
+    }
+
+    /**
+     * Test non-empty response
+     *
+     */
+    #[@test]
+    public function errorDocument() {
+      $body= '<h1>File not found</h1>';
+      $response= $this->newResponse(array('HTTP/1.0 404 OK', 'Content-Length: 23', 'Content-Type: text/html'), $body);
+      $this->assertEquals(404, $response->getStatusCode());
