ILIAS  release_8 Revision v8.23
assAnswerTrueFalseTest 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 assAnswerTrueFalseTest:
+ Collaboration diagram for assAnswerTrueFalseTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetCorrectness_shouldReturnUnchangedState ()
 
 test_isTrue_shouldReturnTrue ()
 
 test_isFalse_shouldReturnFalseOnTrueState ()
 
 test_setFalseGetCorrectness_shouldReturnFalse ()
 
 test_setTrueIsTrue_shouldReturnUnchangedState ()
 
 test_setFalseIsFalse_shouldReturnUnchangedState ()
 

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 assAnswerTrueFalseTest.php.

Member Function Documentation

◆ setUp()

assAnswerTrueFalseTest::setUp ( )
protected

Definition at line 30 of file assAnswerTrueFalseTest.php.

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

◆ test_instantiateObject_shouldReturnInstance()

assAnswerTrueFalseTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assAnswerTrueFalseTest.php.

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

◆ test_isFalse_shouldReturnFalseOnTrueState()

assAnswerTrueFalseTest::test_isFalse_shouldReturnFalseOnTrueState ( )

Definition at line 77 of file assAnswerTrueFalseTest.php.

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

◆ test_isTrue_shouldReturnTrue()

assAnswerTrueFalseTest::test_isTrue_shouldReturnTrue ( )

Definition at line 62 of file assAnswerTrueFalseTest.php.

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

◆ test_setFalseGetCorrectness_shouldReturnFalse()

assAnswerTrueFalseTest::test_setFalseGetCorrectness_shouldReturnFalse ( )

Definition at line 92 of file assAnswerTrueFalseTest.php.

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

◆ test_setFalseIsFalse_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setFalseIsFalse_shouldReturnUnchangedState ( )

Definition at line 122 of file assAnswerTrueFalseTest.php.

122  : void
123  {
124  // Arrange
125  require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
126  $instance = new ASS_AnswerTrueFalse();
127  $expected = true;
128 
129  // Act
130  $instance->setFalse();
131  $actual = $instance->isFalse();
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_setGetCorrectness_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setGetCorrectness_shouldReturnUnchangedState ( )

Definition at line 47 of file assAnswerTrueFalseTest.php.

47  : void
48  {
49  // Arrange
50  require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
51  $instance = new ASS_AnswerTrueFalse();
52  $expected = true;
53 
54  // Act
55  $instance->setCorrectness($expected);
56  $actual = $instance->getCorrectness();
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_setTrueIsTrue_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setTrueIsTrue_shouldReturnUnchangedState ( )

Definition at line 107 of file assAnswerTrueFalseTest.php.

107  : void
108  {
109  // Arrange
110  require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
111  $instance = new ASS_AnswerTrueFalse();
112  $expected = true;
113 
114  // Act
115  $instance->setTrue();
116  $actual = $instance->isTrue();
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...

Field Documentation

◆ $backupGlobals

assAnswerTrueFalseTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerTrueFalseTest.php.


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