t('Unauthorized node view'), 'desc' => t('Creates a node of type page and then an unpermissioned user attempts to edit the node, ' . 'before tries with an anonymous user. Asserts failure.' . 'WARNING: This is based on default registered user permuissions (no administer nodes).') , 'group' => 'Node Tests', ); } function testPageView() { /* Prepare a node to view */ global $user; $node = $this->drupalCreateNode(); $this->assertNotNull(node_load($node->nid), 'Node created'); /* Tries to edit with anonymous user */ $html = $this->drupalGet("node/$node->nid/edit"); $this->assertResponse(403); /* Prepare a user to request the node view */ $test_user = $this->drupalCreateUserRolePerm(array('access content')); $this->drupalLoginUser($test_user); $html = $this->drupalGet("node/$node->nid/edit"); $this->assertResponse(403); $test_user = $this->drupalCreateUserRolePerm(array('administer nodes')); //TODO: Add edit page attempt with administer nodes user node_delete($node->nid); } }