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

Public Member Functions

 test_instantiateObjectSimple ()
 
 test_setGetPoints ()
 
 test_setGetTermId ()
 
 test_setGetPicture ()
 
 test_setGetPictureId ()
 
 test_setGetPictureId_NegativeShouldNotSetValue ()
 
 test_setGetDefinition ()
 
 test_setGetDefinitionId ()
 

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

Member Function Documentation

◆ setUp()

assAnswerMatchingTest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 30 of file assAnswerMatchingTest.php.

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

◆ test_instantiateObjectSimple()

assAnswerMatchingTest::test_instantiateObjectSimple ( )

Definition at line 36 of file assAnswerMatchingTest.php.

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

◆ test_setGetDefinition()

assAnswerMatchingTest::test_setGetDefinition ( )

Definition at line 123 of file assAnswerMatchingTest.php.

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

◆ test_setGetDefinitionId()

assAnswerMatchingTest::test_setGetDefinitionId ( )

Definition at line 138 of file assAnswerMatchingTest.php.

138 : void
139 {
140 // Arrange
141 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
142 $instance = new ASS_AnswerMatching();
143 $expected = 10;
144
145 // Act
146 $instance->setDefinitionId($expected);
147 $actual = $instance->getDefinitionId();
148
149 // Assert
150 $this->assertEquals($expected, $actual);
151 }

◆ test_setGetPicture()

assAnswerMatchingTest::test_setGetPicture ( )

Definition at line 78 of file assAnswerMatchingTest.php.

78 : void
79 {
80 // Arrange
81 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
82 $instance = new ASS_AnswerMatching();
83 $expected = '/link/to/image?';
84
85 // Act
86 $instance->setPicture($expected);
87 $actual = $instance->getPicture();
88
89 // Assert
90 $this->assertEquals($expected, $actual);
91 }

◆ test_setGetPictureId()

assAnswerMatchingTest::test_setGetPictureId ( )

Definition at line 93 of file assAnswerMatchingTest.php.

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

◆ test_setGetPictureId_NegativeShouldNotSetValue()

assAnswerMatchingTest::test_setGetPictureId_NegativeShouldNotSetValue ( )

Definition at line 108 of file assAnswerMatchingTest.php.

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

◆ test_setGetPoints()

assAnswerMatchingTest::test_setGetPoints ( )

Definition at line 48 of file assAnswerMatchingTest.php.

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

◆ test_setGetTermId()

assAnswerMatchingTest::test_setGetTermId ( )

Definition at line 63 of file assAnswerMatchingTest.php.

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

Field Documentation

◆ $backupGlobals

assAnswerMatchingTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerMatchingTest.php.


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