private function BookAccessTestCase::caseAdministerOwnBookAccess in Book access 7.2
1 call to BookAccessTestCase::caseAdministerOwnBookAccess()
File
- ./
book_access_test_case.test, line 167
Class
Code
private function caseAdministerOwnBookAccess() {
$user = $this
->drupalCreateUser(array(
'administer access of own books',
'access content',
));
$this
->drupalLogin($user);
$userBooks = array();
$userNodes = array();
$this
->createBook($userBooks, $userNodes, $user);
foreach ($this->nodes as $node) {
$nid = $node->nid;
$this
->drupalGet("node/{$nid}");
$this
->assertResponse('200', t('Can access content'));
$this
->drupalGet("book_access/delete/user_permission/{$nid}/{$this->author->uid}");
$this
->assertResponse('403', t('Cannot modify book_access permissions'));
$this
->drupalGet("node/{$nid}/book_access");
$this
->assertResponse('403', t('Cannot change book access'));
}
foreach ($userNodes as $node) {
$nid = $node->nid;
$this
->drupalGet("node/{$nid}/book_access");
$this
->assertResponse('200', t('Can change book access for own book'));
}
$this
->drupalLogout();
}