ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assAnswerMatchingTest.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(__DIR__ . '/../../../../');
33 }
34
35 public function test_instantiateObjectSimple(): void
36 {
37 $instance = new ASS_AnswerMatching();
38
39 $this->assertInstanceOf(ASS_AnswerMatching::class, $instance);
40 }
41
42 public function test_setGetPoints(): void
43 {
44 $instance = new ASS_AnswerMatching();
45 $expected = 10;
46
47 $instance->setPoints($expected);
48 $actual = $instance->getPoints();
49
50 $this->assertEquals($expected, $actual);
51 }
52
53 public function test_setGetTermId(): void
54 {
55 $instance = new ASS_AnswerMatching();
56 $expected = 10;
57
58 $instance->setTermId($expected);
59 $actual = $instance->getTermId();
60
61 $this->assertEquals($expected, $actual);
62 }
63
64 public function test_setGetPicture(): void
65 {
66 $instance = new ASS_AnswerMatching();
67 $expected = '/link/to/image?';
68
69 $instance->setPicture($expected);
70 $actual = $instance->getPicture();
71
72 $this->assertEquals($expected, $actual);
73 }
74
75 public function test_setGetPictureId(): void
76 {
77 $instance = new ASS_AnswerMatching();
78 $expected = 47;
79
80 $instance->setPictureId($expected);
81 $actual = $instance->getPictureId();
82
83 $this->assertEquals($expected, $actual);
84 }
85
87 {
88 $instance = new ASS_AnswerMatching();
89 $expected = 0;
90
91 $instance->setPictureId(-47);
92 $actual = $instance->getPictureId();
93
94 $this->assertEquals($expected, $actual);
95 }
96
97 public function test_setGetDefinition(): void
98 {
99 $instance = new ASS_AnswerMatching();
100 $expected = 'Definition is this.';
101
102 $instance->setDefinition($expected);
103 $actual = $instance->getDefinition();
104
105 $this->assertEquals($expected, $actual);
106 }
107
108 public function test_setGetDefinitionId(): void
109 {
110 $instance = new ASS_AnswerMatching();
111 $expected = 10;
112
113 $instance->setDefinitionId($expected);
114 $actual = $instance->getDefinitionId();
115
116 $this->assertEquals($expected, $actual);
117 }
118}
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.