public static function HookStub::any in Authenticated User Page Caching (Authcache) 7.2
Returns a verifyier which succeeds when a hook was invoked at least once.
4 calls to HookStub::any()
- AuthcachePolicyTestCase::testCustomPagecaching in ./
authcache.test - Test custom page caching rules (variable: authcache_pagecaching).
- AuthcachePolicyTestCase::testDefaultCancelationRules in ./
authcache.test - Test builtin standard cache cancelation rules.
- AuthcachePolicyTestCase::testDefaultExclusionRules in ./
authcache.test - Test builtin standard cache exclusion rules.
- AuthcachePolicyTestCase::testOtherOptions in ./
authcache.test - Test rest of custom options (authcache_http200, authcache_noajax).
File
- tests/
HookStub.inc, line 237 - 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 any() {
// Necessary until #1272900 lands
// @ignore style_function_spacing
return function ($invocations, &$message) {
$message = format_string('Expecting any number of invocations, got @actual.', array(
'@actual' => count($invocations),
));
return count($invocations) > 0;
};
}