You are here

public function AuthcacheP13nTestClient::testHookClientInfo in Authenticated User Page Caching (Authcache) 7.2

Cover authcache_p13n_client_info().

Also cover hook_authcache_p13n_client() and hook_authcache_p13n_client_alter().

File

modules/authcache_p13n/tests/authcache_p13n.client.test, line 57
Defines tests for markup replacement clients.

Class

AuthcacheP13nTestClient
Tests update functionality unrelated to the database.

Code

public function testHookClientInfo() {
  $client_info = array(
    'authcache_ajax' => array(
      'title' => 'Ajax',
      'enabled' => TRUE,
    ),
    'authcache_esi' => array(
      'title' => 'ESI',
      'enabled' => TRUE,
    ),
  );
  $client_info_stub = $this->stubmod
    ->hook('authcache_p13n_client', $client_info);
  $client_info_alter_stub = $this->stubmod
    ->hook('authcache_p13n_client_alter');
  $result = authcache_p13n_client_info();
  $this
    ->assertNotNull($result);
  $this
    ->assertStub($client_info_stub, HookStub::once());
  $expect_args = array(
    $client_info,
    NULL,
    NULL,
    NULL,
  );
  $this
    ->assertStub($client_info_alter_stub, HookStub::args($expect_args));
}