public function QuizTestBase::setUp in Quiz 8.6
Same name and namespace in other branches
- 8.5 tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::setUp()
- 6.x tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::setUp()
Overrides BrowserTestBase::setUp
1 call to QuizTestBase::setUp()
- QuizQuestionTestBase::setUp in tests/
src/ Functional/ QuizQuestionTestBase.php - Set up a question test case.
1 method overrides QuizTestBase::setUp()
- QuizQuestionTestBase::setUp in tests/
src/ Functional/ QuizQuestionTestBase.php - Set up a question test case.
File
- tests/
src/ Functional/ QuizTestBase.php, line 30
Class
- QuizTestBase
- Base test class for Quiz questions.
Namespace
Drupal\Tests\quiz\FunctionalCode
public function setUp($admin_permissions = array(), $user_permissions = array()) {
parent::setUp();
$admin_permissions[] = 'administer quiz configuration';
$admin_permissions[] = 'administer quiz_question';
$admin_permissions[] = 'administer quiz_result_answer';
$admin_permissions[] = 'administer quiz_result';
$admin_permissions[] = 'administer quiz';
if ($this->profile == 'standard') {
$admin_permissions[] = 'use text format basic_html';
$admin_permissions[] = 'use text format restricted_html';
$admin_permissions[] = 'use text format full_html';
$user_permissions[] = 'use text format basic_html';
$user_permissions[] = 'use text format restricted_html';
}
$user_permissions[] = 'access quiz';
$user_permissions[] = 'view any quiz';
$user_permissions[] = 'view own quiz_result';
$this->admin = $this
->drupalCreateUser(array_unique($admin_permissions));
$this->user = $this
->drupalCreateUser(array_unique($user_permissions));
}