ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 getIRSSMock ()
 
 getFileDeliveryMock ()
 
 getIliasMock ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 

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  // Act
39  $instance = new ASS_AnswerBinaryState();
40 
41  $this->assertInstanceOf('ASS_AnswerBinaryState', $instance);
42  }
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 57 of file assAnswerBinaryStateTest.php.

57  : void
58  {
59  $instance = new ASS_AnswerBinaryState();
60  $expected = 1;
61 
62  // Act
63  $instance->setState($expected);
64  $actual = $instance->isStateChecked();
65 
66  // Assert
67  $this->assertEquals($expected, $actual);
68  }
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 70 of file assAnswerBinaryStateTest.php.

70  : void
71  {
72  $instance = new ASS_AnswerBinaryState();
73  $expected = 1;
74 
75  // Act
76  $instance->setState($expected);
77  $actual = $instance->isStateSet();
78 
79  // Assert
80  $this->assertEquals($expected, $actual);
81  }
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 96 of file assAnswerBinaryStateTest.php.

96  : void
97  {
98  $instance = new ASS_AnswerBinaryState();
99  $expected = 1;
100 
101  // Act
102  $instance->setState($expected);
103  $actual = !$instance->isStateUnchecked();
104 
105  // Assert
106  $this->assertEquals($expected, $actual);
107  }
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 83 of file assAnswerBinaryStateTest.php.

83  : void
84  {
85  $instance = new ASS_AnswerBinaryState();
86  $expected = 1;
87 
88  // Act
89  $instance->setState($expected);
90  $actual = !$instance->isStateUnset();
91 
92  // Assert
93  $this->assertEquals($expected, $actual);
94  }
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 109 of file assAnswerBinaryStateTest.php.

109  : void
110  {
111  $instance = new ASS_AnswerBinaryState();
112  $expected = 0;
113  $instance->setState($expected);
114 
115  // Act
116  $instance->setChecked();
117  $actual = $instance->isStateUnchecked();
118 
119  // Assert
120  $this->assertEquals($expected, $actual);
121  }
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 44 of file assAnswerBinaryStateTest.php.

44  : void
45  {
46  $instance = new ASS_AnswerBinaryState();
47  $expected = 1;
48 
49  // Act
50  $instance->setState($expected);
51  $actual = $instance->getState();
52 
53  // Assert
54  $this->assertEquals($expected, $actual);
55  }
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 137 of file assAnswerBinaryStateTest.php.

137  : void
138  {
139  $instance = new ASS_AnswerBinaryState();
140  $expected = 0;
141  $instance->setState($expected);
142 
143  // Act
144  $instance->setSet();
145  $actual = $instance->isStateUnchecked();
146 
147  // Assert
148  $this->assertEquals($expected, $actual);
149  }
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 123 of file assAnswerBinaryStateTest.php.

123  : void
124  {
125  $instance = new ASS_AnswerBinaryState();
126  $expected = 1;
127  $instance->setState($expected);
128 
129  // Act
130  $instance->setUnchecked();
131  $actual = $instance->isStateUnchecked();
132 
133  // Assert
134  $this->assertEquals($expected, $actual);
135  }
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 151 of file assAnswerBinaryStateTest.php.

151  : void
152  {
153  $instance = new ASS_AnswerBinaryState();
154  $expected = 1;
155  $instance->setState($expected);
156 
157  // Act
158  $instance->setUnset();
159  $actual = $instance->isStateUnchecked();
160 
161  // Assert
162  $this->assertEquals($expected, $actual);
163  }
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: