ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIRSSMock ()
 
 getFileDeliveryMock ()
 
 getIliasMock ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 

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

Definition at line 30 of file assAnswerSimpleTest.php.

30  : void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }

◆ test_instantiateObject_shouldReturnInstance()

assAnswerSimpleTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assAnswerSimpleTest.php.

36  : void
37  {
38  // Act
39  $instance = new ASS_AnswerSimple();
40 
41  $this->assertInstanceOf('ASS_AnswerSimple', $instance);
42  }
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 57 of file assAnswerSimpleTest.php.

57  : void
58  {
59  $instance = new ASS_AnswerSimple("", 0.0, 0, -1, 0);
60  $expected = 'The answer, of course, is 42.';
61 
62  // Act
63  $instance->setAnswertext($expected);
64  $actual = $instance->getAnswertext();
65 
66  // Assert
67  $this->assertEquals($expected, $actual);
68  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetId_shouldReturnUnchangedId()

assAnswerSimpleTest::test_setGetId_shouldReturnUnchangedId ( )

Definition at line 44 of file assAnswerSimpleTest.php.

44  : void
45  {
46  $instance = new ASS_AnswerSimple("", 0.0, 0, -1, 0);
47  $expected = 1;
48 
49  // Act
50  $instance->setId($expected);
51  $actual = $instance->getId();
52 
53  // Assert
54  $this->assertEquals($expected, $actual);
55  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetOrder_shouldReturnUnchangedOrder()

assAnswerSimpleTest::test_setGetOrder_shouldReturnUnchangedOrder ( )

Definition at line 96 of file assAnswerSimpleTest.php.

96  : void
97  {
98  $instance = new ASS_AnswerSimple("", 0.0, 0, -1, 0);
99  $expected = 42;
100 
101  // Act
102  $instance->setOrder($expected);
103  $actual = $instance->getOrder();
104 
105  // Assert
106  $this->assertEquals($expected, $actual);
107  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetPoints_shouldReturnUnchangedPoints()

assAnswerSimpleTest::test_setGetPoints_shouldReturnUnchangedPoints ( )

Definition at line 70 of file assAnswerSimpleTest.php.

70  : void
71  {
72  $instance = new ASS_AnswerSimple("", 0.0, 0, -1, 0);
73  $expected = 42;
74 
75  // Act
76  $instance->setPoints($expected);
77  $actual = $instance->getPoints();
78 
79  // Assert
80  $this->assertEquals($expected, $actual);
81  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput()

assAnswerSimpleTest::test_setGetPoints_shouldReturnUnchangedZeroOnNonNumericInput ( )

Definition at line 83 of file assAnswerSimpleTest.php.

83  : void
84  {
85  $instance = new ASS_AnswerSimple();
86  $expected = 0.0;
87 
88  // Act
89  $instance->setPoints('Günther');
90  $actual = $instance->getPoints();
91 
92  // Assert
93  $this->assertEquals($expected, $actual);
94  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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: