public function testFirstTranslatedResultIsReturned()
{
$text = 'Hello, World!';
$response = m::mock(ResponseInterface::class);
$this->guzzle->shouldReceive('request')->once()->with('GET', 'https://www.googleapis.com/language/translate/v2', ['query' => ['key' => config('translation.clients.api_key'), 'format' => 'html', 'source' => 'en', 'target' => 'es', 'q' => $text]])->andReturn($response);
$response->shouldReceive('getBody')->andReturn(json_encode(['data' => ['translations' => [['translatedText' => '¡Hola Mundo!'], ['translatedText' => 'Cerveza']]]]));
$this->client->setSource('en');
$this->client->setTarget('es');
$translation = $this->client->translate($text);
$this->assertEquals('¡Hola Mundo!', $translation);
}