See https://github.com/mRoca/MrocaRequestLogBundle
The theory :
- A developer runs behat tests on the api project
- Behat tests generate api mock files (
@Then save the response as mock file
) - Api mock files are saved in a specific path (
%behat_mock_responses_dir%
) - Another git repository contains all mock files, updated from the api directory with a script
- In the front, a bash script and a private ssh key in the repo allow to get the mocks repository before tests
- In the front, a fake Guzzle Client is created : for each Guzzle call, if a mock file matching the request exists, its content is returned, else a 404 error us thrown