function BookAccessRuleTestCase::testNodeAdministratorAccess in Book access 6.2
File
- ./
book_access.test, line 148
Class
Code
function testNodeAdministratorAccess() {
$books = array();
$nodes = array();
// Create the test books.
$this
->createBook($books, $nodes);
$this
->createBook($books, $nodes);
$this
->drupalLogin($this
->drupalCreateUser(array(
'administer nodes',
'access content',
)));
// Verify if the user has access to the book pages.
foreach ($nodes as $node) {
$nid = $node->nid;
$this
->drupalGet('node/' . $nid);
if ($this
->assertResponse('200', t('The node administrator user can view the book page %nid.', array(
'%nid' => $nid,
)))) {
$this
->assertNoLink(t('Add child page'), t('The node administrator user cannot add child pages to the book page %nid.', array(
'%nid' => $nid,
)));
$this
->drupalGet('node/' . $nid . '/book_access');
$this
->assertResponse('200', t('The node administrator user can change the permission for the book page %nid.', array(
'%nid' => $nid,
)));
$this
->drupalGet('node/' . $nid . '/delete');
$this
->assertResponse('200', t('The node administrator user can delete the book page %nid.', array(
'%nid' => $nid,
)));
$this
->drupalGet('node/' . $nid . '/edit');
$this
->assertResponse('200', t('The node administrator user can edit the book page %nid.', array(
'%nid' => $nid,
)));
$this
->drupalGet('node/' . $nid . '/outline');
$this
->assertResponse('403', t('The node administrator user cannot edit the outline for the book page %nid.', array(
'%nid' => $nid,
)));
}
}
$this
->drupalLogout();
}