You are here

protected function AuthcacheBackendKeyManagementTestCase::assertStub in Authenticated User Page Caching (Authcache) 7.2

Test whether the given stub passes the invocation verifier.

3 calls to AuthcacheBackendKeyManagementTestCase::assertStub()
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.
AuthcacheBackendKeyManagementTestCase::testNoKeyRenewWhenKeyDoesNotChange in tests/authcache.backend.test
Do not call hook_authcache_backend_key_set when key remains the same.

File

tests/authcache.backend.test, line 285
Test cases for pluggable cache backends.

Class

AuthcacheBackendKeyManagementTestCase
Test key management.

Code

protected function assertStub(HookStubProxy $stub, $verifier, $message = NULL) {
  $result = $stub
    ->verify($verifier, $error);
  if (!$message) {
    $message = t('Verify invocation of hook @hook.', array(
      '@hook' => $stub
        ->hookname(),
    ));
  }
  if (!$result && is_string($error)) {
    $message .= ' ' . $error;
  }
  $this
    ->assertTrue($result, $message);
}