/**
  * Public constructor.
  *
  * @param EncodingResponse $xmlResponse
  *            The XML response
  */
 public function __construct($xmlResponse)
 {
     if ($xmlResponse->hasError()) {
         $this->message = $xmlResponse->getErrorMessage();
     }
     parent::__construct($this->message);
 }
 public function testSuccess()
 {
     // $this->setExpectedException("Exception");
     $object = new EncodingResponse('<?xml version="1.0"?><response><message>OK</message></response>');
     $this->assertFalse($object->hasError());
     $this->assertNull($object->getErrorMessage());
     $this->assertNotEmpty($object->getXmlElement());
     $this->assertNotEmpty($object->getXmlString());
     $this->assertNotEmpty((string) $object);
 }