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; }
public function testResponseXmlAttributesIsEmptyIfXmlIsMalformed() { $attributes = Helper::parseResponseXml('<bla bla="qwe" />a'); $this->assertEquals($attributes, array()); }
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); } }