You are here

public function AuthcacheTestAdminWidgets::testRoleRestrictWidgetNoRoles in Authenticated User Page Caching (Authcache) 7.2

Test role restrict widget when no roles are enabled for authcache.

File

tests/authcache.widget.test, line 199
Test cases for pluggable cache backends.

Class

AuthcacheTestAdminWidgets
Cover authcache module.

Code

public function testRoleRestrictWidgetNoRoles() {
  variable_set('authcache_roles', array());
  $form = system_settings_form(array(
    'authcache_widget_test_roles' => array(
      '#title' => $this
        ->randomName(8),
      '#type' => 'authcache_role_restrict',
    ),
  ));
  $form_stub = $this->stubmod
    ->hook('form', $form);
  $this
    ->drupalGet('authcache-widget-test-form');
  $this
    ->assertStub($form_stub, HookStub::once());
  $this
    ->assertText('Currently there are no roles enabled for authcache');
  $this
    ->assertLink('authcache settings');
}