You are here

public function AuthcacheP13nTestRequestRouterStub::generateURL in Authenticated User Page Caching (Authcache) 7.2

Given a request id and an optional argument, return the appropriate URL.

Parameters

String $route_id: The identifier of a request (e.g., frag/form-token).

Return value

String|FALSE An URL which can be used to call back to the request with the given argument.

Overrides AuthcacheP13nRequestRouterInterface::generateURL

File

modules/authcache_p13n/tests/authcache_p13n.stub.inc, line 563
Stub classes for testing.

Class

AuthcacheP13nTestRequestRouterStub
Stub router.

Code

public function generateURL($route_id, $arg = NULL) {
  if ($route_id === 'test/bad') {
    return FALSE;
  }
  else {
    return array(
      'path' => 'http://example.com/authcache.php',
      'options' => array(
        'query' => array(
          'r' => $route_id,
          'a' => $arg ?: '',
        ),
      ),
    );
  }
}