Ejemplo n.º 1
0
 public function testCreateWithHttpErrorCode()
 {
     $code = 403;
     $rawResult = '<?xml version="1.0" encoding="UTF-8"?> <APINAMEResponse><RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId></APINAMEResponse>';
     $response = new ResponseXml();
     $response->create($code, $rawResult);
     $this->assertFalse($response->isOk());
     $this->assertEquals($rawResult, $response->getRawResult());
     $error = $response->getError();
     $this->assertEquals('HTTP_CODE_ERROR', $error);
 }
Ejemplo n.º 2
0
 public function testCreateWithHttpErrorCode()
 {
     $code = 403;
     $rawResult = '<?xml version="1.0" encoding="utf-8" ?><time_get_response><time>2015-09-16 15:52:52</time><request_id>1</request_id></time_get_response><!--e010101080212.zmf-->';
     $response = new ResponseXml();
     $response->create($code, $rawResult);
     $this->assertFalse($response->isOk());
     $this->assertEquals($rawResult, $response->getRawResult());
     $error = $response->getError();
     $this->assertEquals('HTTP_CODE_ERROR', $error);
 }