BiblioPageViewTestCase.test in Bibliography Module 7
File
tests/BiblioPageViewTestCase.test
View source
<?php
class BiblioPageViewTestCase extends BiblioWebTestCase {
public static function getInfo() {
return array(
'name' => 'Biblio node view and edit permissions',
'description' => 'Create a biblio node and test view / edit permissions.',
'group' => 'Biblio',
);
}
public function setUp() {
parent::setUp('biblio');
}
public function testBiblioPageView() {
$node = $this
->createNode('101');
$this
->assertTrue(node_load($node->nid), t('Node created.'));
$html = $this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(403);
$web_user = $this
->drupalCreateUser(array(
'access content',
));
$this
->drupalLogin($web_user);
$this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(403);
$web_user = $this
->drupalCreateUser(array(
'edit any biblio content',
));
$this
->drupalLogin($web_user);
$this
->drupalGet("node/{$node->nid}/edit");
$this
->assertResponse(200);
}
}