Index: tests/Zend/Rest/responses/returnEmptyStatus.xml =================================================================== --- tests/Zend/Rest/responses/returnEmptyStatus.xml (revision 0) +++ tests/Zend/Rest/responses/returnEmptyStatus.xml (revision 0) @@ -0,0 +1,3 @@ + + + \ No newline at end of file Index: tests/Zend/Rest/ClientTest.php =================================================================== --- tests/Zend/Rest/ClientTest.php (revision 23882) +++ tests/Zend/Rest/ClientTest.php (working copy) @@ -297,4 +297,27 @@ } } + + /** + * @group ZF-11281 + */ + public function testCallStatusGetterOnResponseObjectWhenServerResponseHasNoStatusXmlElement() + { + $expXml = file_get_contents($this->path . 'returnEmptyStatus.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->get('/rest/'); + $this->assertTrue($response instanceof Zend_Rest_Client_Result); + $this->assertFalse($response->getStatus()); + } + } Index: library/Zend/Rest/Client/Result.php =================================================================== --- library/Zend/Rest/Client/Result.php (revision 23882) +++ library/Zend/Rest/Client/Result.php (working copy) @@ -180,7 +180,8 @@ public function getStatus() { $status = $this->_sxml->xpath('//status/text()'); - + if ( !isset($status[0]) ) return false; + $status = strtolower($status[0]); if (ctype_alpha($status) && $status == 'success') {