public function QuizTrueFalseTestCase::testCreateQuizQuestion in Quiz 6.x
Same name and namespace in other branches
- 8.6 question_types/quiz_truefalse/tests/src/Functional/QuizTrueFalseTestCase.php \Drupal\Tests\quiz_truefalse\Functional\QuizTrueFalseTestCase::testCreateQuizQuestion()
- 8.5 question_types/quiz_truefalse/tests/src/Functional/QuizTrueFalseTestCase.php \Drupal\Tests\quiz_truefalse\Functional\QuizTrueFalseTestCase::testCreateQuizQuestion()
Test adding a truefalse question.
3 calls to QuizTrueFalseTestCase::testCreateQuizQuestion()
- QuizTrueFalseTestCase::testEditQuestionResponse in question_types/
quiz_truefalse/ tests/ src/ Functional/ QuizTrueFalseTestCase.php - Test that the question response can be edited.
- QuizTrueFalseTestCase::testQuestionFeedback in question_types/
quiz_truefalse/ tests/ src/ Functional/ QuizTrueFalseTestCase.php - Test incorrect question with all feedbacks on.
- QuizTrueFalseTestCase::testTakeQuestion in question_types/
quiz_truefalse/ tests/ src/ Functional/ QuizTrueFalseTestCase.php
File
- question_types/
quiz_truefalse/ tests/ src/ Functional/ QuizTrueFalseTestCase.php, line 24
Class
- QuizTrueFalseTestCase
- Test class for true false questions.
Namespace
Drupal\Tests\quiz_truefalse\FunctionalCode
public function testCreateQuizQuestion($settings = []) {
// Login as our privileged user.
$this
->drupalLogin($this->admin);
$question = QuizQuestion::create([
'type' => 'truefalse',
'title' => 'TF 1 title',
'truefalse_correct' => [
'value' => 1,
],
'body' => 'TF 1 body text',
] + $settings);
$question
->save();
return $question;
}