You are here

public function ModuleStub::hook in Authenticated User Page Caching (Authcache) 7.2

Install a stub for a hook-implementation.

Parameters

string $hookname: The name of the hook (without the module prefix). E.g. form_alter, if the stub-module has an implementation of hook_form_alter.

any $return: The result which should be returned when the hook is invoked.

Return value

HookStubProxy A proxy object representing the stubbed hook.

File

tests/HookStub.inc, line 36
Defines some helper classes for stubbing and recording hook invocations.

Class

ModuleStub
Helper class representing a stub-module.

Code

public function hook($hookname, $return = NULL) {
  return HookStub::on($this->name . '_' . $hookname, $return);
}