public function AnswersTestCase::testDefaultPermissions in Answers 7.3
Same name and namespace in other branches
- 7.4 answers.test \AnswersTestCase::testDefaultPermissions()
Tests permissions for default roles.
File
- ./
answers.test, line 109 - Tests for answers.module.
Class
- AnswersTestCase
- Tests the functionality of the answers module.
Code
public function testDefaultPermissions() {
$admin = $this
->drupalCreateUser(array(
'administer permissions',
));
$this
->drupalLogin($admin);
$this
->drupalGet('admin/people/permissions');
// Administrators.
$this
->assertFieldChecked('edit-3-create-question-content', "Administrators role have create question.");
$this
->assertFieldChecked('edit-3-edit-own-question-content', "Administrators role has edit own question.");
$this
->assertFieldChecked('edit-3-edit-any-question-content', "Administrators role has edit any question.");
$this
->assertFieldChecked('edit-3-delete-own-question-content', "Administrators role has delete own question.");
$this
->assertFieldChecked('edit-3-delete-any-question-content', "Administrators role has delete any question.");
$this
->assertFieldChecked('edit-3-create-answer-content', "Administrators role has create answer.");
$this
->assertFieldChecked('edit-3-edit-own-answer-content', "Administrators role has edit own answer.");
$this
->assertFieldChecked('edit-3-edit-any-question-content', "Administrators role has edit any answer.");
$this
->assertFieldChecked('edit-3-delete-own-answer-content', "Administrators role has delete own answer.");
$this
->assertFieldChecked('edit-3-delete-any-answer-content', "Administrators role has delete any answer.");
}