How to specify a web service URL within a Drupal module's simpletest?

Posted by Matt V. on Stack Overflow See other posts from Stack Overflow or by Matt V.
Published on 2011-01-13T20:25:37Z Indexed on 2011/01/17 3:53 UTC
Read the original article Hit count: 262

I have a Drupal module that talks to a REST API on a separate server for user registration and authentication. The module runs on multiple sites which point to different servers which may run different versions of the REST API.

Ideally, I'd like to be able to run each site against its own end-point, in case changes on the back end break things. Is there a way to dynamically specify a different end-point URL when running a test? Or do I have to edit the .test file for each site?

I'm trying to keep the module's files as generic and flexible as possible. I guess I could have the .test file look for a .inc file that could override the URL, if needed for a particular site. Is there a better way though?

© Stack Overflow or respective owner

Related posts about web-services

Related posts about drupal