You are here

public static function HookStub::args in Authenticated User Page Caching (Authcache) 7.2

Returns a verifyier which succeeds when arguments match.

Parameters

array $args: A list of expected arguments

int $invoc: The invocation (starting from 0 for the first).

bool $strict: Whether or not to use identity instead of equality operator.

9 calls to HookStub::args()
AuthcacheBackendKeyManagementTestCase::testKeyRenewDuringLogin in tests/authcache.backend.test
Call hook_authcache_backend_key_set during login and logout.
AuthcacheBackendKeyManagementTestCase::testKeyRenewDuringLogout in tests/authcache.backend.test
Call hook_authcache_backend_key_set during logout.
AuthcacheEnumKeysTestCase::testCustomAuthenticatedKeys in modules/authcache_enum/lib/Drupal/authcache_enum/Tests/AuthcacheEnumKeysTestCase.php
Test authenticated key customization.
AuthcacheEnumKeysTestCase::testDeprecatedCustomAuthenticatedKeys in modules/authcache_enum/lib/Drupal/authcache_enum/Tests/AuthcacheEnumKeysTestCase.php
Test deprecated authenticated key customization.
AuthcacheP13nTestClient::testGetPreferredClientCustomList in modules/authcache_p13n/tests/authcache_p13n.client.test
Cover authcache_p13n_client_get_preferred() with custom list.

... See full list

File

tests/HookStub.inc, line 290
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 args($args, $invoc = 0, $strict = TRUE) {

  // Necessary until #1272900 lands
  // @ignore style_function_spacing
  return function ($invocations, &$message) use ($args, $invoc, $strict) {
    $message = t('On invocation number @invoc, expected @this and got @that.', array(
      '@invoc' => $invoc,
      '@this' => var_export($args, TRUE),
      '@that' => var_export($invocations[$invoc], TRUE),
    ));
    return $strict ? $invocations[$invoc] === $args : $invocations[$invoc] == $args;
  };
}