ILIAS  release_8 Revision v8.25
assAnswerMatchingTermTest.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.assAnswerMatchingTerm.php';
40
41 // Act
42 $instance = new assAnswerMatchingTerm();
43
44 // Assert
45 $this->assertInstanceOf('assAnswerMatchingTerm', $instance);
46 }
47
48 public function test_setGetText(): void
49 {
50 // Arrange
51 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
52 $instance = new assAnswerMatchingTerm();
53 $expected = 'Text';
54
55 // Act
56 $instance = $instance->withText($expected);
57 $actual = $instance->getText();
58
59 // Assert
60 $this->assertEquals($expected, $actual);
61 }
62
63 public function test_setGetPicture(): void
64 {
65 // Arrange
66 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
67 $instance = new assAnswerMatchingTerm();
68 $expected = 'path/to/picture?';
69
70 // Act
71 $instance = $instance->withPicture($expected);
72 $actual = $instance->getPicture();
73
74 // Assert
75 $this->assertEquals($expected, $actual);
76 }
77
78 public function test_getUnsetPicture(): void
79 {
80 // Arrange
81 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
82 $instance = new assAnswerMatchingTerm();
83 $expected = null;
84
85 // Act
86 $actual = $instance->getPicture();
87
88 // Assert
89 $this->assertEquals($expected, $actual);
90 }
91
92 public function test_setGetIdentifier(): void
93 {
94 // Arrange
95 require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
96 $instance = new assAnswerMatchingTerm();
97 $expected = 12345;
98
99 // Act
100 $instance = $instance->withIdentifier($expected);
101 $actual = $instance->getIdentifier();
102
103 // Assert
104 $this->assertEquals($expected, $actual);
105 }
106}
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...
Class assBaseTestCase.