public function testHttpRequestGeneratesFaultIfReadFromPhpInputFails() { Zend_AllTests_StreamWrapper_PhpInput::methodWillReturn('stream_open', false); $request = new Zend_XmlRpc_Request_Http(); $this->assertTrue($request->isFault()); $this->assertSame(630, $request->getFault()->getCode()); }
/** * Handle an xmlrpc call * * @param Zend_XmlRpc_Request $request Optional * @return Zend_XmlRpc_Response|Zend_XmlRpc_Fault */ public function handle(Zend_XmlRpc_Request $request = null) { // Get request if (null === $request) { require_once 'Zend/XmlRpc/Request/Http.php'; $request = new Zend_XmlRpc_Request_Http(); } if ($request->isFault()) { $response = $request->getFault(); } else { try { $response = $this->_handle($request); } catch (Exception $e) { $response = $this->fault($e); } } return $response; }