You are here

public function QuizTestBase::createQuestion in Quiz 8.6

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::createQuestion()
  2. 6.x tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::createQuestion()

Return value

QuizQuestion

44 calls to QuizTestBase::createQuestion()
MatchingTestCase::testCreateQuizQuestion in question_types/quiz_matching/tests/src/Functional/MatchingTestCase.php
Test adding and taking a matching question.
QuizAccessTest::testQuizOwnerResultEdit in tests/src/Functional/QuizAccessTest.php
Test quiz authors being able to score results for own quiz.
QuizAccessTest::testQuizTakerAnswerScore in tests/src/Functional/QuizAccessTest.php
Test quiz takers being able to grade their own results.
QuizBuildOnLastTest::testBuildOnLastAttempt in tests/src/Functional/QuizBuildOnLastTest.php
Test the build on last attempt functionality.
QuizCreationTest::testCloneQuiz in tests/src/Functional/QuizCreationTest.php
Test cloning quizzes with questions.

... See full list

File

tests/src/Functional/QuizTestBase.php, line 102

Class

QuizTestBase
Base test class for Quiz questions.

Namespace

Drupal\Tests\quiz\Functional

Code

public function createQuestion($settings = array()) {
  $question = QuizQuestion::create($settings);
  $question
    ->save();
  return $question;
}