コード例 #1
0
 function testCreateResponseErrorOnlyThrowsBaseError()
 {
     $p = new PaymentRequest($this->fixture('wpf_payment_request_simple.json'));
     try {
         $data = $this->parseResponseFixture('wpf_payment_response_error_only.xml');
         $data['payment']['code'] = '777777';
         $p->createResponse($data);
         $this->fail('should throw exception');
     } catch (Errors\Error $exe) {
         $this->assertEqual(get_class($exe), 'Hypercharge\\Errors\\Error');
         $this->assertEqual($exe->message, 'The message');
         $this->assertEqual($exe->technical_message, 'The technical message');
         $this->assertEqual($exe->status_code, 777777);
         return;
     }
     $this->fail('should throw Error');
 }