ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SettingsTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use PHPUnit\Framework\TestCase;
25
26class SettingsTest extends TestCase
27{
28 public function testTestResultsSettingsDefaults(): void
29 {
30 $trs = new Settings(0);
31 $this->assertFalse($trs->getShowHiddenQuestions());
32 $this->assertFalse($trs->getShowOptionalQuestions());
33 $this->assertTrue($trs->getShowBestSolution());
34 $this->assertTrue($trs->getShowFeedback());
35 $this->assertFalse($trs->getQuestionTextOnly());
36 $this->assertFalse($trs->getShowRecapitulation());
37 }
38
39 public function testTestResultsSettingsBasicProps(): void
40 {
41 $trs = new Settings(0, true, true, true, true, true, true);
42 $this->assertTrue($trs->getShowHiddenQuestions());
43 $this->assertTrue($trs->getShowOptionalQuestions());
44 $this->assertTrue($trs->getShowBestSolution());
45 $this->assertTrue($trs->getShowFeedback());
46 $this->assertTrue($trs->getQuestionTextOnly());
47 $this->assertTrue($trs->getShowRecapitulation());
48
49 $trs = new Settings(0, false, false, false, false, false, false);
50 $this->assertFalse($trs->getShowHiddenQuestions());
51 $this->assertFalse($trs->getShowOptionalQuestions());
52 $this->assertFalse($trs->getShowBestSolution());
53 $this->assertFalse($trs->getShowFeedback());
54 $this->assertFalse($trs->getQuestionTextOnly());
55 $this->assertFalse($trs->getShowRecapitulation());
56 }
57}