public function testOkRequest()
 {
     $data = ['test' => 'pippo'];
     $mock = new \GuzzleHttp\Handler\MockHandler([new \GuzzleHttp\Psr7\Response(201, [], json_encode($data))]);
     $handler = \GuzzleHttp\HandlerStack::create($mock);
     $client = new \GuzzleHttp\Client(['handler' => $handler]);
     $this->client->setClient($client);
     $ticket = $this->client->newTicket();
     $this->assertEquals($data, $ticket->get());
 }
 public function testRequestJSONError()
 {
     $data = ['test' => 'pippo'];
     $mock = new \GuzzleHttp\Handler\MockHandler([new \GuzzleHttp\Psr7\Response(201, [], json_encode($data) . 'test')]);
     $handler = \GuzzleHttp\HandlerStack::create($mock);
     $client = new \GuzzleHttp\Client(['handler' => $handler]);
     $this->client->setClient($client);
     $message = '';
     try {
         $this->client->request('test', []);
     } catch (\Exception $e) {
         $message = $e->getMessage();
     }
     $this->assertEquals('Error during parsing response', $message);
 }