I'm interested in whether anyone thinks this is a good idea?

I have found it useful - its a module which provides a mock api endpoint which can be used to replace a real API endpoint which Drupal needs to talk to during tests.

Expectations can be set for requests to the API and responses can also be set. The tests can then be made to pass or fail depending on if the expectations are met.

Sandbox code here including an example of how to use it within a FeatureContext :-

https://www.drupal.org/sandbox/johnennew/2539706

Comments

johnennew’s picture

Title: Testing remote API integrations Drupal 7 » Mocking remote API integrations during behat test run
jhedstrom’s picture

Thanks for sharing that code, it seems quite useful!