geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.94k stars 517 forks source link

Add Faker provider #1214

Open ker0x opened 5 months ago

ker0x commented 5 months ago

This PR introduce a faker provider using FakePHP. It's main purpose is to provide fake data during tests.

jbelien commented 4 months ago

Hello @ker0x, welcome to the project. I'm not exactly sure I understand the goal of that new provider, could you give us some use cases ? Thanks.

ker0x commented 4 months ago

@jbelien yes sure.

In my case, I have a listener on some of my entities that geocodes them each time they are created or updated. During my tests, I perform a lot of operations on these entities, and using a real provider slows down the tests because of HTTP calls. I don't particularly need the geocoded data to be accurate during tests, so having a provider with fake data saves me from making these HTTP calls (and it saves requests with some providers that have free request limits per month).

Chris53897 commented 3 months ago

@ker0x Could you please revert the changes to other files beside from your new provider, and rebase against master. This wil make the ci green.