/**
  * @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);
 }
Example #2
0
 public function testGetHeaders()
 {
     $this->assertSame($this->headers, $this->client->getHeaders());
 }