Exemplo n.º 1
0
 /**
  * @expectedException \RequestLab\XitiAnalytics\XitiException
  */
 public function testQueryWithJsonError()
 {
     $this->clientMock->expects($this->once())->method('getHeaders')->will($this->returnValue(array('Content-Type' => 'application/json', 'Authorization' => 'Basic ' . base64_encode($this->login . ':' . $this->password))));
     $this->queryMock->expects($this->once())->method('build')->will($this->returnValue('uri'));
     $this->httpAdapterMock->expects($this->once())->method('getContent')->with($this->equalTo('uri'))->will($this->returnValue(json_encode(array('ErrorCode' => '2017', 'ErrorMessage' => 'Le message'))));
     $this->service->query($this->queryMock);
 }