ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assAnswerSimpleTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assAnswerSimpleTest:
+ Collaboration diagram for assAnswerSimpleTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetId_shouldReturnUnchangedId ()
 
 test_setGetAnswertext_shouldReturnUnchangedAnswertext ()
 
 test_setGetPoints_shouldReturnUnchangedPoints ()
 
 test_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput ()
 
 test_setGetOrder_shouldReturnUnchangedOrder ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 getIRSSMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests

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

\

Definition at line 26 of file assAnswerSimpleTest.php.

Member Function Documentation

◆ setUp()

assAnswerSimpleTest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 30 of file assAnswerSimpleTest.php.

30 : void
31 {
32 chdir(__DIR__ . '/../../../../');
33 }

◆ test_instantiateObject_shouldReturnInstance()

assAnswerSimpleTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 35 of file assAnswerSimpleTest.php.

35 : void
36 {
37 $instance = new ASS_AnswerSimple();
38
39 $this->assertInstanceOf(ASS_AnswerSimple::class, $instance);
40 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetAnswertext_shouldReturnUnchangedAnswertext()

assAnswerSimpleTest::test_setGetAnswertext_shouldReturnUnchangedAnswertext ( )

Definition at line 53 of file assAnswerSimpleTest.php.

53 : void
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 }

◆ test_setGetId_shouldReturnUnchangedId()

assAnswerSimpleTest::test_setGetId_shouldReturnUnchangedId ( )

Definition at line 42 of file assAnswerSimpleTest.php.

42 : void
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 }

◆ test_setGetOrder_shouldReturnUnchangedOrder()

assAnswerSimpleTest::test_setGetOrder_shouldReturnUnchangedOrder ( )

Definition at line 86 of file assAnswerSimpleTest.php.

86 : void
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 }

◆ test_setGetPoints_shouldReturnUnchangedPoints()

assAnswerSimpleTest::test_setGetPoints_shouldReturnUnchangedPoints ( )

Definition at line 64 of file assAnswerSimpleTest.php.

64 : void
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 }

◆ test_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput()

assAnswerSimpleTest::test_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput ( )

Definition at line 75 of file assAnswerSimpleTest.php.

75 : void
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 }

Field Documentation

◆ $backupGlobals

assAnswerSimpleTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerSimpleTest.php.


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