You are here

public function AuthcacheUserTest::testUserContactForm in Authenticated User Page Caching (Authcache) 7.2

Ensure that user setting is embedded for authenticated users.

File

modules/authcache_user/authcache_user.test, line 117
Test cases for the Authcache User module.

Class

AuthcacheUserTest
Tests for markup substitution.

Code

public function testUserContactForm() {
  $this->stubmod
    ->hook('authcache_p13n_client', array(
    'authcache_p13n_test' => array(
      'title' => t('Test Client'),
      'enabled' => TRUE,
    ),
  ));

  // Then ensure that the setting is added when the site wide contact form is
  // accessed with authenticated user.
  $this
    ->drupalLogin($this->member1);
  $setting_markup = $this
    ->randomName(8);
  $setting_stub = HookStub::on('theme_authcache_p13n_setting__authcache_p13n_test', $setting_markup);
  $this
    ->drupalGet('user/' . $this->member2->uid . '/contact');
  $this
    ->assertNoText($this->member1->name);
  $this
    ->assertNoText($this->member1->mail);
  $this
    ->assertText($setting_markup);
  $this
    ->assertStub($setting_stub, HookStub::once());
}