Example #1
0
 public function __construct($data, $signature = '')
 {
     $this->raw_data = $data;
     $data = Helper::parseResponseXml($this->raw_data);
     foreach ($data as $key => $value) {
         $this->data[strToLower($key)] = $value;
     }
     $this->signature = $signature;
 }
Example #2
0
 public function testResponseXmlAttributesIsEmptyIfXmlIsMalformed()
 {
     $attributes = Helper::parseResponseXml('<bla bla="qwe" />a');
     $this->assertEquals($attributes, array());
 }
Example #3
0
 public function getResponse()
 {
     $msg = $this->result();
     $msg = ltrim($msg, 'OK');
     $msg = ltrim($msg, 'ERROR:');
     $msg = trim($msg);
     if (empty($msg)) {
         return null;
     }
     if (!Helper::starts_with($msg, '<') && !Helper::ends_with($msg, '/>')) {
         return new Response('<IDP result="' . ($this->hasError() ? 7007 : 0) . '" message="' . htmlentities($msg) . '"/>');
     } else {
         return new Response($msg);
     }
 }