Chris@0: drupalCreateNode(); Chris@0: $this->assertTrue(Node::load($node->id()), 'Node created.'); Chris@0: Chris@0: // Try to edit with anonymous user. Chris@0: $this->drupalGet("node/" . $node->id() . "/edit"); Chris@0: $this->assertResponse(403); Chris@0: Chris@0: // Create a user without permission to edit node. Chris@0: $web_user = $this->drupalCreateUser(['access content']); Chris@0: $this->drupalLogin($web_user); Chris@0: Chris@0: // Attempt to access edit page. Chris@0: $this->drupalGet("node/" . $node->id() . "/edit"); Chris@0: $this->assertResponse(403); Chris@0: Chris@0: // Create user with permission to edit node. Chris@0: $web_user = $this->drupalCreateUser(['bypass node access']); Chris@0: $this->drupalLogin($web_user); Chris@0: Chris@0: // Attempt to access edit page. Chris@0: $this->drupalGet("node/" . $node->id() . "/edit"); Chris@0: $this->assertResponse(200); Chris@0: } Chris@0: Chris@0: }