public static function HookStub::on in Authenticated User Page Caching (Authcache) 7.2
Enable a stubbed-function.
Parameters
string $hookname: The fully qualified name of a function in a stub-module.
any $return: The result which should be returned when the hook is invoked.
Return value
HookStubProxy A proxy object representing the stubbed hook.
26 calls to HookStub::on()
- AuthcacheBlockTest::testMarkupSubstitution in modules/
authcache_block/ authcache_block.test - Ensure that markup is substituted for authcache enabled blocks.
- AuthcacheCommentTest::testNoMarkupSubstitutionForGuestUser in modules/
authcache_comment/ authcache_comment.test - Ensure that markup is substituted for authcache enabled comments.
- AuthcacheCommentTest::testNumberOfNewComments in modules/
authcache_comment/ authcache_comment.test - Test that the number of new comments is replaced by a placeholder.
- AuthcacheCommentTest::testUserSettingInCommentForm in modules/
authcache_comment/ authcache_comment.test - Ensure that user setting is embedded for authenticated users.
- AuthcacheFieldTest::testNodeMarkupSubstitution in modules/
authcache_field/ authcache_field.test - Test that the field markup is substituted by a partial.
File
- tests/
HookStub.inc, line 158 - Defines some helper classes for stubbing and recording hook invocations.
Class
- HookStub
- Static methods for keeping track of enabled hooks and invocations.
Code
public static function on($hookname, $return = NULL) {
variable_set('hookstub_' . $hookname, new HookStub($hookname, $return));
return new HookStubProxy($hookname);
}