You are here

public function ProtectedNodePerTypePassword::testAllowedView in Protected Node 7

Same name and namespace in other branches
  1. 1.0.x tests/protected_node.per_type.test \ProtectedNodePerTypePassword::testAllowedView()

Test function.

Test that a node protected with per type protection can be seen with the right password.

File

tests/protected_node.per_type.test, line 71
Test protected node per type functionality.

Class

ProtectedNodePerTypePassword
Configure protected_node to use per type password.

Code

public function testAllowedView() {

  // Generate a protected node.
  $node = $this
    ->adminCreateProtectedNode();

  // An authenticated user is viewing the node.
  $this
    ->drupalLogin($this->normalAccessAllowedUser);
  $form = array(
    'password' => $this->page_content_type_password,
  );
  $this
    ->drupalPost('node/' . $node->nid, $form, t('OK'));
  $text = $node->body[LANGUAGE_NONE][0]['value'];
  $this
    ->assertText($text, "User with right permission can access a protected node with right password", $this->group);
}