I want to unit test some drupal custom modules but the drupal_goto()
function is causing problems by creating header errors (e.g.: PHP Warning: session_start(): Cannot send session cookie
).
My question is, is it possible to stop the drupal_goto() function from redirecting to the destination page or somehow tap into hook_exit()
to return the $destination
.
I’ve tried something like (in addition to exit
and die
, but it stops the PHPUnit tests:
function custommodule_exit( $destination = null ) {
return $destination;
}
Any help is appreciated.
Sponsored by SupremePR