ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assAnswerSimpleTest.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
36 {
37 $instance = new ASS_AnswerSimple();
38
39 $this->assertInstanceOf(ASS_AnswerSimple::class, $instance);
40 }
41
43 {
44 $instance = new ASS_AnswerSimple('', 0.0, 0, -1, 0);
45 $expected = 1;
46
47 $instance->setId($expected);
48 $actual = $instance->getId();
49
50 $this->assertEquals($expected, $actual);
51 }
52
54 {
55 $instance = new ASS_AnswerSimple('', 0.0, 0, -1, 0);
56 $expected = 'The answer, of course, is 42.';
57
58 $instance->setAnswertext($expected);
59 $actual = $instance->getAnswertext();
60
61 $this->assertEquals($expected, $actual);
62 }
63
65 {
66 $instance = new ASS_AnswerSimple('', 0.0, 0, -1, 0);
67 $expected = 42;
68
69 $instance->setPoints($expected);
70 $actual = $instance->getPoints();
71
72 $this->assertEquals($expected, $actual);
73 }
74
76 {
77 $instance = new ASS_AnswerSimple();
78 $expected = 0.0;
79
80 $instance->setPoints('Günther');
81 $actual = $instance->getPoints();
82
83 $this->assertEquals($expected, $actual);
84 }
85
87 {
88 $instance = new ASS_AnswerSimple('', 0.0, 0, -1, 0);
89 $expected = 42;
90
91 $instance->setOrder($expected);
92 $actual = $instance->getOrder();
93
94 $this->assertEquals($expected, $actual);
95 }
96}
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_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput()
test_setGetAnswertext_shouldReturnUnchangedAnswertext()
Class assBaseTestCase.