function BiblioPageViewTestCase::testBiblioPageView in Bibliography Module 7.2
Same name and namespace in other branches
- 7 tests/BiblioPageViewTestCase.test \BiblioPageViewTestCase::testBiblioPageView()
Creates a node and then an anonymous and unpermissioned user attempt to edit the node.
File
- tests/
biblio.test, line 156
Class
Code
function testBiblioPageView() {
// Create a node to view.
$node = $this
->createNode('101');
$this
->assertTrue(node_load($node->nid), t('Node created.'));
// Try to edit with anonymous user.
$html = $this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(403);
// Create a user without permission to edit node.
$web_user = $this
->drupalCreateUser(array(
'access content',
));
$this
->drupalLogin($web_user);
// Attempt to access edit page.
$this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(403);
// Create user with permission to edit node.
$web_user = $this
->drupalCreateUser(array(
'edit any biblio content',
));
$this
->drupalLogin($web_user);
// Attempt to access edit page.
$this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(200);
}