ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
assAnswerTrueFalseTest.php
Go to the documentation of this file.
1 <?php
2 
27 {
28  protected $backupGlobals = false;
29 
30  protected function setUp(): void
31  {
32  chdir(__DIR__ . '/../../../../');
33  }
34 
36  {
37  $instance = new ASS_AnswerTrueFalse();
38 
39  $this->assertInstanceOf(ASS_AnswerTrueFalse::class, $instance);
40  }
41 
43  {
44  $instance = new ASS_AnswerTrueFalse();
45  $expected = true;
46 
47  $instance->setCorrectness($expected);
48  $actual = $instance->getCorrectness();
49 
50  $this->assertEquals($expected, $actual);
51  }
52 
53  public function test_isTrue_shouldReturnTrue(): void
54  {
55  $instance = new ASS_AnswerTrueFalse();
56  $expected = true;
57 
58  $instance->setCorrectness($expected);
59 
60  $this->assertEquals($expected, $instance->isTrue());
61  $this->assertEquals($expected, $instance->isCorrect());
62  }
63 
65  {
66  $instance = new ASS_AnswerTrueFalse();
67  $expected = false;
68 
69  $instance->setCorrectness(true);
70 
71  $this->assertEquals($expected, $instance->isFalse());
72  $this->assertEquals($expected, $instance->isIncorrect());
73  }
74 
76  {
77  $instance = new ASS_AnswerTrueFalse();
78  $expected = false;
79 
80  $instance->setFalse();
81  $actual = $instance->getCorrectness();
82 
83  $this->assertEquals((bool) $expected, (bool) $actual);
84  }
85 
87  {
88  $instance = new ASS_AnswerTrueFalse();
89  $expected = true;
90 
91  $instance->setTrue();
92  $actual = $instance->isTrue();
93 
94  $this->assertEquals($expected, $actual);
95  }
96 
98  {
99  $instance = new ASS_AnswerTrueFalse();
100  $expected = true;
101 
102  $instance->setFalse();
103  $actual = $instance->isFalse();
104 
105  $this->assertEquals($expected, $actual);
106  }
107 }
Class assBaseTestCase.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...