Source

						public function testParseMessage() {
		$message = join("\r\n", array(
			'HTTP/1.1 200 OK',
			'Header: Value',
			'Connection: close',
			'Content-Type: application/json;charset=iso-8859-1',
			'',
			'Test!'
		));

		$response = new Response(compact('message'));
		$this->assertEqual($message, (string) $response);
		$this->assertEqual('application/json', $response->type);
		$this->assertEqual('ISO-8859-1', $response->encoding);

		$body = 'Not a Message';
		$expected = join("\r\n", array('HTTP/1.1 200 OK', '', '', 'Not a Message'));
		$response = new Response(compact('body'));
		$this->assertEqual($expected, (string) $response);
	}