ILIAS  release_8 Revision v8.24
assAnswerImagemapTest.php
Go to the documentation of this file.
1<?php
2
27{
28 protected $backupGlobals = false;
29
30 protected function setUp(): void
31 {
32 chdir(dirname(__FILE__));
33 chdir('../../../');
34 }
35
36 public function test_instantiateObjectSimple(): void
37 {
38 // Arrange
39 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
40
41 // Act
42 $instance = new ASS_AnswerImagemap();
43
44 // Assert
45 $this->assertInstanceOf('ASS_AnswerImagemap', $instance);
46 }
47
48 public function test_setGetCoords(): void
49 {
50 // Arrange
51 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
52 $instance = new ASS_AnswerImagemap();
53
54 // Act
55 $expected = "12345";
56 $instance->setCoords($expected);
57 $actual = $instance->getCoords();
58
59 // Assert
60 $this->assertEquals($expected, $actual);
61 }
62
63 public function test_setGetArea(): void
64 {
65 // Arrange
66 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
67 $instance = new ASS_AnswerImagemap();
68
69 // Act
70 $expected = "12345";
71 $instance->setArea($expected);
72 $actual = $instance->getArea();
73
74 // Assert
75 $this->assertEquals($expected, $actual);
76 }
77
78 public function test_setGetPointsUnchecked(): void
79 {
80 // Arrange
81 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
82 $instance = new ASS_AnswerImagemap();
83
84 // Act
85 $expected = "12345";
86 $instance->setPointsUnchecked($expected);
87 $actual = $instance->getPointsUnchecked();
88
89 // Assert
90 $this->assertEquals($expected, $actual);
91 }
92
94 {
95 // Arrange
96 require_once './Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
97 $instance = new ASS_AnswerImagemap();
98
99 // Act
100 $expected = 0.0;
101 $instance->setPointsUnchecked('Günther');
102 $actual = $instance->getPointsUnchecked();
103
104 // Assert
105 $this->assertEquals($expected, $actual);
106 }
107}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_setGetPointsUnchecked_shouldNullifyOnNonNumericPoints()
Class assBaseTestCase.