Пример #1
0
 public function testCreate()
 {
     $code = 200;
     $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->assertTrue($response->isOk());
     $this->assertEquals($rawResult, $response->getRawResult());
     $result = $response->getResult();
     $this->assertArrayHasKey('RequestId', $result);
 }
Пример #2
0
 public function testCreate()
 {
     $code = 200;
     $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->assertTrue($response->isOk());
     $this->assertEquals($rawResult, $response->getRawResult());
     $result = $response->getResult();
     $this->assertArrayHasKey('time', $result);
 }