ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 getIRSSMock ()
 

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

Reimplemented from assBaseTestCase.

Definition at line 30 of file assAnswerBinaryStateTest.php.

30 : void
31 {
32 chdir(__DIR__ . '/../../../../');
33 }

◆ test_instantiateObject_shouldReturnInstance()

assAnswerBinaryStateTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 35 of file assAnswerBinaryStateTest.php.

35 : void
36 {
37 $instance = new ASS_AnswerBinaryState();
38
39 $this->assertInstanceOf(ASS_AnswerBinaryState::class, $instance);
40 }
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 53 of file assAnswerBinaryStateTest.php.

53 : void
54 {
55 $instance = new ASS_AnswerBinaryState();
56 $expected = 1;
57
58 $instance->setState($expected);
59 $actual = $instance->isStateChecked();
60
61 $this->assertEquals($expected, $actual);
62 }

◆ test_isStateSet_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateSet_shouldReturnActualState ( )

Definition at line 64 of file assAnswerBinaryStateTest.php.

64 : void
65 {
66 $instance = new ASS_AnswerBinaryState();
67 $expected = 1;
68
69 $instance->setState($expected);
70 $actual = $instance->isStateSet();
71
72 $this->assertEquals($expected, $actual);
73 }

◆ test_isStateUnchecked_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateUnchecked_shouldReturnActualState ( )

Definition at line 86 of file assAnswerBinaryStateTest.php.

86 : void
87 {
88 $instance = new ASS_AnswerBinaryState();
89 $expected = 1;
90
91 $instance->setState($expected);
92 $actual = !$instance->isStateUnchecked();
93
94 $this->assertEquals($expected, $actual);
95 }

◆ test_isStateUnset_shouldReturnActualState()

assAnswerBinaryStateTest::test_isStateUnset_shouldReturnActualState ( )

Definition at line 75 of file assAnswerBinaryStateTest.php.

75 : void
76 {
77 $instance = new ASS_AnswerBinaryState();
78 $expected = 1;
79
80 $instance->setState($expected);
81 $actual = !$instance->isStateUnset();
82
83 $this->assertEquals($expected, $actual);
84 }

◆ test_setChecked_shouldAlterState()

assAnswerBinaryStateTest::test_setChecked_shouldAlterState ( )

Definition at line 97 of file assAnswerBinaryStateTest.php.

97 : void
98 {
99 $instance = new ASS_AnswerBinaryState();
100 $expected = 0;
101 $instance->setState($expected);
102
103 $instance->setChecked();
104 $actual = $instance->isStateUnchecked();
105
106 $this->assertEquals($expected, $actual);
107 }

◆ test_setGetState_shouldReturnUnchangedState()

assAnswerBinaryStateTest::test_setGetState_shouldReturnUnchangedState ( )

Definition at line 42 of file assAnswerBinaryStateTest.php.

42 : void
43 {
44 $instance = new ASS_AnswerBinaryState();
45 $expected = 1;
46
47 $instance->setState($expected);
48 $actual = $instance->getState();
49
50 $this->assertEquals($expected, $actual);
51 }

◆ test_setSet_shouldAlterState()

assAnswerBinaryStateTest::test_setSet_shouldAlterState ( )

Definition at line 121 of file assAnswerBinaryStateTest.php.

121 : void
122 {
123 $instance = new ASS_AnswerBinaryState();
124 $expected = 0;
125 $instance->setState($expected);
126
127 $instance->setSet();
128 $actual = $instance->isStateUnchecked();
129
130 $this->assertEquals($expected, $actual);
131 }

◆ test_setUnchecked_shouldAlterState()

assAnswerBinaryStateTest::test_setUnchecked_shouldAlterState ( )

Definition at line 109 of file assAnswerBinaryStateTest.php.

109 : void
110 {
111 $instance = new ASS_AnswerBinaryState();
112 $expected = 1;
113 $instance->setState($expected);
114
115 $instance->setUnchecked();
116 $actual = $instance->isStateUnchecked();
117
118 $this->assertEquals($expected, $actual);
119 }

◆ test_setUnset_shouldAlterState()

assAnswerBinaryStateTest::test_setUnset_shouldAlterState ( )

Definition at line 133 of file assAnswerBinaryStateTest.php.

133 : void
134 {
135 $instance = new ASS_AnswerBinaryState();
136 $expected = 1;
137 $instance->setState($expected);
138
139 $instance->setUnset();
140 $actual = $instance->isStateUnchecked();
141
142 $this->assertEquals($expected, $actual);
143 }

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: