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());
 }
Esempio n. 2
0
 /**
  * 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;
 }