You are here

public function ProtectedNodePageDisplay::testGlobalDescriptionOnly in Protected Node 7

Same name and namespace in other branches
  1. 1.0.x tests/protected_node.page_text.test \ProtectedNodePageDisplay::testGlobalDescriptionOnly()

Test function.

Test that the password page description site config setting works.

File

tests/protected_node.page_text.test, line 81
Test protected node password page display options.

Class

ProtectedNodePageDisplay
Configure protected_node to use per node password.

Code

public function testGlobalDescriptionOnly() {
  $global_description = $this
    ->randomName(32);
  $this
    ->drupalLogin($this->adminUser);
  $protected_node_settings = array(
    'protected_node_use_global_password' => PROTECTED_NODE_PER_NODE_PASSWORD,
    'protected_node_description' => $global_description,
  );
  $this
    ->drupalPost('admin/config/content/protected_node', $protected_node_settings, t('Save configuration'));

  // $show_title_option_available is false since there is a custom description
  // set.
  $node = $this
    ->createProtectedNode(FALSE);

  // User sees the set global text.
  $this
    ->drupalLogin($this->normalAccessAllowedUser);
  $this
    ->drupalGet('node/' . $node->nid);
  $this
    ->assertText($global_description, "Custom global text is displayed on the enter password page", $this->group);
}