I want to test an HTTP route in laravel. The action function of the URL calls a helper function, which calls an external API. How can I mock the external API call while testing?
public function actionFunction(){
$helper = new HelperClassHelper();
return Response::json($helper->getNames());
}
Here, the getNames() function makes an external API call. How do I mock it?
Aucun commentaire:
Enregistrer un commentaire