You are here

public function ProtectedNodePageDisplay::testDefaultShowTitle in Protected Node 1.0.x

Same name and namespace in other branches
  1. 7 tests/protected_node.page_text.test \ProtectedNodePageDisplay::testDefaultShowTitle()

Test function.

Test that default display text is displayed (showing title).

File

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

Class

ProtectedNodePageDisplay
Configure protected_node to use per node password.

Code

public function testDefaultShowTitle() {

  // Create a protected node that show its title.
  $node = $this
    ->createProtectedNode(TRUE, TRUE);

  // User sees the default text including node title.
  $this
    ->drupalLogin($this->normalAccessAllowedUser);
  $this
    ->drupalGet('node/' . $node->nid);
  $text = t('The @node_type @node_title you are trying to view is password protected. Please enter the password below to proceed.', array(
    '@node_type' => node_type_get_name($node),
    '@node_title' => '"' . $node->title . '"',
  ));
  $this
    ->assertText($text, "Default text displayed on the enter password page contains the node title if asked", $this->group);
}