For now modules must change:

- REQUEST_TIME for mockable_time() (perhaps mockable_time() can still be used as the time elapsed since the request, see #2100517: Review how REQUEST_TIME and time() are mocked)
- $_SERVER['HTTP_USER_AGENT'] for mockable_browser()

Perhaps it might be better, if possible, to override REQUEST_TIME and $_SERVER['HTTP_USER_AGENT'], in our module so that other modules need not modify their code at all (as is the case currently for their Javascript).

If so, should the real data (time, and user agent) be available somehow? Perhaps not.

Comments

alberto56’s picture

See also #2100523: Create mockable_http_request module for mocking http requests.