/** * Mock a response for identify language * * @return GuzzleHttp\Psr7\Response */ public function pretendIdentifyLanguage() { //Build a new successful response for identify languages return new Response(202, ['Content-Type' => 'application/json'], collect(['languages' => [['language' => 'af', 'confidence' => $this->faker->randomFloat(null, 0.0001, 0.9999)], ['language' => 'ar', 'confidence' => $this->faker->randomFloat(null, 0.0001, 0.9999)], ['language' => 'az', 'confidence' => $this->faker->randomFloat(null, 0.0001, 0.9999)], ['language' => 'en', 'confidence' => $this->faker->randomFloat(null, 0.0001, 0.9999)], ['language' => 'fr', 'confidence' => $this->faker->randomFloat(null, 0.0001, 0.9999)]]])->toJson()); }