You are here

public function AuthcacheP13nTestRequestHandlerBadStub::handle in Authenticated User Page Caching (Authcache) 7.2

Render and print the response according to the given parameters.

Overrides AuthcacheP13nRequestHandlerInterface::handle

File

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

Class

AuthcacheP13nTestRequestHandlerBadStub
Stub request handler.

Code

public function handle($params) {
  print 'this line is expected to be discarded';
  switch ($params['error']) {
    case 'not_found':
      throw new AuthcacheP13nRequestNotFound();
    case 'invalid_input':
      throw new AuthcacheP13nRequestInvalidInput();
    case 'access_denied':
      throw new AuthcacheP13nRequestAccessDenied();
    case 'server_error':
      throw new AuthcacheP13nRequestException();
    case 'redirect':
      drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
      drupal_goto('');
    default:
      throw new Exception();
  }
}