You are here

public function ProtectedNodePerTypePassword::testAuthenticatedNonAllowedView in Protected Node 7

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

Test function.

Test that a node protected with per type protection can't be seen by an authenticated but not allowed user.

File

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

Class

ProtectedNodePerTypePassword
Configure protected_node to use per type password.

Code

public function testAuthenticatedNonAllowedView() {

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

  // User that can see published content is viewing the node.
  $this
    ->drupalLogin($this->normalNonAccessAllowedUser);
  $this
    ->drupalGet('node/' . $node->nid);
  $this
    ->assertResponse(403, "User with no access permission is not allowed to access a protected node");
}