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?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2NDPWO9
via IFTTT
Aucun commentaire:
Enregistrer un commentaire