ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
assAnswerImagemapTest Class Reference

Unit tests. More...

+ Inheritance diagram for assAnswerImagemapTest:
+ Collaboration diagram for assAnswerImagemapTest:

Public Member Functions

 test_instantiateObjectSimple ()
 
 test_setGetCoords ()
 
 test_setGetArea ()
 
 test_setGetPointsUnchecked ()
 
 test_setGetPointsUnchecked_shouldNullifyOnNonNumericPoints ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = FALSE
 

Detailed Description

Unit tests.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 11 of file assAnswerImagemapTest.php.

Member Function Documentation

◆ setUp()

assAnswerImagemapTest::setUp ( )
protected

Definition at line 15 of file assAnswerImagemapTest.php.

16 {
17 if (defined('ILIAS_PHPUNIT_CONTEXT'))
18 {
19 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
20 ilUnitUtil::performInitialisation();
21 }
22 else
23 {
24 chdir( dirname( __FILE__ ) );
25 chdir('../../../');
26 }
27 }

◆ test_instantiateObjectSimple()

assAnswerImagemapTest::test_instantiateObjectSimple ( )

Definition at line 29 of file assAnswerImagemapTest.php.

30 {
31 // Arrange
32 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
33
34 // Act
35 $instance = new ASS_AnswerImagemap();
36
37 // Assert
38 $this->assertInstanceOf('ASS_AnswerImagemap', $instance);
39 }
Class for true/false or yes/no answers.

◆ test_setGetArea()

assAnswerImagemapTest::test_setGetArea ( )

Definition at line 56 of file assAnswerImagemapTest.php.

57 {
58 // Arrange
59 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
60 $instance = new ASS_AnswerImagemap();
61
62 // Act
63 $expected = "12345";
64 $instance->setArea($expected);
65 $actual = $instance->getArea();
66
67 // Assert
68 $this->assertEquals($expected, $actual);
69 }

◆ test_setGetCoords()

assAnswerImagemapTest::test_setGetCoords ( )

Definition at line 41 of file assAnswerImagemapTest.php.

42 {
43 // Arrange
44 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
45 $instance = new ASS_AnswerImagemap();
46
47 // Act
48 $expected = "12345";
49 $instance->setCoords($expected);
50 $actual = $instance->getCoords();
51
52 // Assert
53 $this->assertEquals($expected, $actual);
54 }

◆ test_setGetPointsUnchecked()

assAnswerImagemapTest::test_setGetPointsUnchecked ( )

Definition at line 71 of file assAnswerImagemapTest.php.

72 {
73 // Arrange
74 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
75 $instance = new ASS_AnswerImagemap();
76
77 // Act
78 $expected = "12345";
79 $instance->setPointsUnchecked($expected);
80 $actual = $instance->getPointsUnchecked();
81
82 // Assert
83 $this->assertEquals($expected, $actual);
84 }

◆ test_setGetPointsUnchecked_shouldNullifyOnNonNumericPoints()

assAnswerImagemapTest::test_setGetPointsUnchecked_shouldNullifyOnNonNumericPoints ( )

Definition at line 86 of file assAnswerImagemapTest.php.

87 {
88 // Arrange
89 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
90 $instance = new ASS_AnswerImagemap();
91
92 // Act
93 $expected = 0.0;
94 $instance->setPointsUnchecked('Günther');
95 $actual = $instance->getPointsUnchecked();
96
97 // Assert
98 $this->assertEquals($expected, $actual);
99 }

Field Documentation

◆ $backupGlobals

assAnswerImagemapTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerImagemapTest.php.


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