lundi 5 septembre 2016

How to mock getting user ip?

My site needs to know user location. Using browser's geolocation API is not enough. So it takes user ip and uses geoip database to find out user location. But when I run tests, there's no client ip. Can I mock it somehow? Laravel's documentation says that one shouldn't mock Request facade. What do I do then?

Aucun commentaire:

Enregistrer un commentaire