ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
assAnswerBinaryStateTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assAnswerBinaryStateTest:
+ Collaboration diagram for assAnswerBinaryStateTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetState_shouldReturnUnchangedState ()
 
 test_isStateChecked_shouldReturnActualState ()
 
 test_isStateSet_shouldReturnActualState ()
 
 test_isStateUnset_shouldReturnActualState ()
 
 test_isStateUnchecked_shouldReturnActualState ()
 
 test_setChecked_shouldAlterState ()
 
 test_setUnchecked_shouldAlterState ()
 
 test_setSet_shouldAlterState ()
 
 test_setUnset_shouldAlterState ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 26 of file assAnswerBinaryStateTest.php.

Member Function Documentation

◆ setUp()

assAnswerBinaryStateTest::setUp ( )
protected

Definition at line 30 of file assAnswerBinaryStateTest.php.

30  : void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }

◆ test_instantiateObject_shouldReturnInstance()

assAnswerBinaryStateTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assAnswerBinaryStateTest.php.

36  : void
37  {
38  // Arrange
39  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
40 
41  // Act
42  $instance = new ASS_AnswerBinaryState();
43 
44  $this->assertInstanceOf('ASS_AnswerBinaryState', $instance);
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_isStateChecked_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateChecked_shouldReturnActualState ( )

Definition at line 62 of file assAnswerBinaryStateTest.php.

62  : void
63  {
64  // Arrange
65  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
66  $instance = new ASS_AnswerBinaryState();
67  $expected = 1;
68 
69  // Act
70  $instance->setState($expected);
71  $actual = $instance->isStateChecked();
72 
73  // Assert
74  $this->assertEquals($expected, $actual);
75  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_isStateSet_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateSet_shouldReturnActualState ( )

Definition at line 77 of file assAnswerBinaryStateTest.php.

77  : void
78  {
79  // Arrange
80  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
81  $instance = new ASS_AnswerBinaryState();
82  $expected = 1;
83 
84  // Act
85  $instance->setState($expected);
86  $actual = $instance->isStateSet();
87 
88  // Assert
89  $this->assertEquals($expected, $actual);
90  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_isStateUnchecked_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateUnchecked_shouldReturnActualState ( )

Definition at line 107 of file assAnswerBinaryStateTest.php.

107  : void
108  {
109  // Arrange
110  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
111  $instance = new ASS_AnswerBinaryState();
112  $expected = 1;
113 
114  // Act
115  $instance->setState($expected);
116  $actual = !$instance->isStateUnchecked();
117 
118  // Assert
119  $this->assertEquals($expected, $actual);
120  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_isStateUnset_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateUnset_shouldReturnActualState ( )

Definition at line 92 of file assAnswerBinaryStateTest.php.

92  : void
93  {
94  // Arrange
95  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
96  $instance = new ASS_AnswerBinaryState();
97  $expected = 1;
98 
99  // Act
100  $instance->setState($expected);
101  $actual = !$instance->isStateUnset();
102 
103  // Assert
104  $this->assertEquals($expected, $actual);
105  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setChecked_shouldAlterState()

assAnswerBinaryStateTest::test_setChecked_shouldAlterState ( )

Definition at line 122 of file assAnswerBinaryStateTest.php.

122  : void
123  {
124  // Arrange
125  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
126  $instance = new ASS_AnswerBinaryState();
127  $expected = 0;
128  $instance->setState($expected);
129 
130  // Act
131  $instance->setChecked();
132  $actual = $instance->isStateUnchecked();
133 
134  // Assert
135  $this->assertEquals($expected, $actual);
136  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetState_shouldReturnUnchangedState()

assAnswerBinaryStateTest::test_setGetState_shouldReturnUnchangedState ( )

Definition at line 47 of file assAnswerBinaryStateTest.php.

47  : void
48  {
49  // Arrange
50  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
51  $instance = new ASS_AnswerBinaryState();
52  $expected = 1;
53 
54  // Act
55  $instance->setState($expected);
56  $actual = $instance->getState();
57 
58  // Assert
59  $this->assertEquals($expected, $actual);
60  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setSet_shouldAlterState()

assAnswerBinaryStateTest::test_setSet_shouldAlterState ( )

Definition at line 154 of file assAnswerBinaryStateTest.php.

154  : void
155  {
156  // Arrange
157  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
158  $instance = new ASS_AnswerBinaryState();
159  $expected = 0;
160  $instance->setState($expected);
161 
162  // Act
163  $instance->setSet();
164  $actual = $instance->isStateUnchecked();
165 
166  // Assert
167  $this->assertEquals($expected, $actual);
168  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setUnchecked_shouldAlterState()

assAnswerBinaryStateTest::test_setUnchecked_shouldAlterState ( )

Definition at line 138 of file assAnswerBinaryStateTest.php.

138  : void
139  {
140  // Arrange
141  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
142  $instance = new ASS_AnswerBinaryState();
143  $expected = 1;
144  $instance->setState($expected);
145 
146  // Act
147  $instance->setUnchecked();
148  $actual = $instance->isStateUnchecked();
149 
150  // Assert
151  $this->assertEquals($expected, $actual);
152  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setUnset_shouldAlterState()

assAnswerBinaryStateTest::test_setUnset_shouldAlterState ( )

Definition at line 170 of file assAnswerBinaryStateTest.php.

170  : void
171  {
172  // Arrange
173  require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
174  $instance = new ASS_AnswerBinaryState();
175  $expected = 1;
176  $instance->setState($expected);
177 
178  // Act
179  $instance->setUnset();
180  $actual = $instance->isStateUnchecked();
181 
182  // Assert
183  $this->assertEquals($expected, $actual);
184  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $backupGlobals

assAnswerBinaryStateTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerBinaryStateTest.php.


The documentation for this class was generated from the following file: