public function QuizCreationTest::testQuizCreation in Quiz 6.x
Same name and namespace in other branches
- 8.6 tests/src/Functional/QuizCreationTest.php \Drupal\Tests\quiz\Functional\QuizCreationTest::testQuizCreation()
- 8.5 tests/src/Functional/QuizCreationTest.php \Drupal\Tests\quiz\Functional\QuizCreationTest::testQuizCreation()
Test basic quiz creation.
File
- tests/
src/ Functional/ QuizCreationTest.php, line 17
Class
- QuizCreationTest
- Test aspects of quiz creation.
Namespace
Drupal\Tests\quiz\FunctionalCode
public function testQuizCreation() {
$this
->drupalLogin($this->admin);
$this
->drupalGet("quiz/add/quiz");
// These are the basic system defaults.
$this
->assertFieldChecked('edit-allow-resume-value');
$this
->assertFieldChecked('edit-allow-skipping-value');
$this
->assertNoFieldChecked('edit-allow-jumping-value');
$this
->assertFieldChecked('edit-allow-change-value');
$this
->assertFieldChecked('edit-backwards-navigation-value');
$this
->assertNoFieldChecked('edit-repeat-until-correct-value');
$this
->assertNoFieldChecked('edit-mark-doubtful-value');
$this
->assertFieldChecked('edit-show-passed-value');
$this
->assertFieldChecked('edit-status-value');
$this
->drupalPostForm(NULL, [
'title[0][value]' => 'Test quiz creation',
'body[0][value]' => 'Test quiz description',
], t('Save'));
$this
->assertText('Manage questions');
}