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

Public Member Functions

 test_constructorShouldReturnInstance ()
 
 test_setGetLowerBound ()
 
 test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ()
 
 test_setGetLowerBound_nonNumericShouldSetAnswertext ()
 
 test_setGetUpperBound ()
 
 test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ()
 
 test_setGetUpperBound_nonNumericShouldSetAnswertext ()
 

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

Member Function Documentation

◆ setUp()

assAnswerClozeTest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 30 of file assAnswerClozeTest.php.

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

◆ test_constructorShouldReturnInstance()

assAnswerClozeTest::test_constructorShouldReturnInstance ( )

Definition at line 36 of file assAnswerClozeTest.php.

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

◆ test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ( )

Definition at line 63 of file assAnswerClozeTest.php.

63 : void
64 {
65 // Arrange
66 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
67 $instance = new assAnswerCloze('2');
68
69 // Act
70 $expected = '2';
71 $instance->setLowerBound(4);
72 $actual = $instance->getLowerBound();
73
74 // Assert
75 $this->assertEquals($expected, $actual);
76 }

◆ test_setGetLowerBound()

assAnswerClozeTest::test_setGetLowerBound ( )

Definition at line 48 of file assAnswerClozeTest.php.

48 : void
49 {
50 // Arrange
51 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
52 $instance = new assAnswerCloze('2');
53
54 // Act
55 $expected = '1';
56 $instance->setLowerBound($expected);
57 $actual = $instance->getLowerBound();
58
59 // Assert
60 $this->assertEquals($expected, $actual);
61 }

◆ test_setGetLowerBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBound_nonNumericShouldSetAnswertext ( )

Definition at line 78 of file assAnswerClozeTest.php.

78 : void
79 {
80 // Arrange
81 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
82 $instance = new assAnswerCloze('3');
83
84 // Act
85 $expected = '3';
86 $instance->setLowerBound('test');
87 $actual = $instance->getLowerBound();
88
89 // Assert
90 $this->assertEquals($expected, $actual);
91 }

◆ test_setGetUpperBound()

assAnswerClozeTest::test_setGetUpperBound ( )

Definition at line 93 of file assAnswerClozeTest.php.

93 : void
94 {
95 // Arrange
96 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
97 $instance = new assAnswerCloze('1');
98
99 // Act
100 $expected = '3';
101 $instance->setUpperBound($expected);
102 $actual = $instance->getUpperBound();
103
104 // Assert
105 $this->assertEquals($expected, $actual);
106 }

◆ test_setGetUpperBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_nonNumericShouldSetAnswertext ( )

Definition at line 123 of file assAnswerClozeTest.php.

123 : void
124 {
125 // Arrange
126 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
127 $instance = new assAnswerCloze('4');
128
129 // Act
130 $expected = '4';
131 $instance->setUpperBound('test');
132 $actual = $instance->getUpperBound();
133
134 // Assert
135 $this->assertEquals($expected, $actual);
136 }

◆ test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ( )

Definition at line 108 of file assAnswerClozeTest.php.

108 : void
109 {
110 // Arrange
111 require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
112 $instance = new assAnswerCloze('4');
113
114 // Act
115 $expected = '4';
116 $instance->setUpperBound(2);
117 $actual = $instance->getUpperBound();
118
119 // Assert
120 $this->assertEquals($expected, $actual);
121 }

Field Documentation

◆ $backupGlobals

assAnswerClozeTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerClozeTest.php.


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