ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assAnswerErrorTextTest 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 assAnswerErrorTextTest:
+ Collaboration diagram for assAnswerErrorTextTest:

Public Member Functions

 test_instantiateObjectSimple ()
 
 test_instantiateObjectFull ()
 
 test_instantiateObjectFullHasCorrectValues ()
 
 test_withPoints_valid ()
 
 test_withPosition_valid ()
 

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 for assAnswerErrorTextTest

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

Definition at line 26 of file assAnswerErrorTextTest.php.

Member Function Documentation

◆ setUp()

assAnswerErrorTextTest::setUp ( )
protected

Definition at line 30 of file assAnswerErrorTextTest.php.

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

◆ test_instantiateObjectFull()

assAnswerErrorTextTest::test_instantiateObjectFull ( )

Definition at line 46 of file assAnswerErrorTextTest.php.

46  : void
47  {
48  // Act
49  $instance = new assAnswerErrorText(
50  'errortext',
51  'correcttext',
52  0.01,
53  21
54  );
55 
56  // Assert
57  $this->assertInstanceOf(assAnswerErrorText::class, $instance);
58  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_instantiateObjectFullHasCorrectValues()

assAnswerErrorTextTest::test_instantiateObjectFullHasCorrectValues ( )

Definition at line 60 of file assAnswerErrorTextTest.php.

60  : void
61  {
62  $instance = new assAnswerErrorText(
63  'errortext',
64  'correcttext',
65  0.01,
66  21
67  );
68 
69  $this->assertInstanceOf(assAnswerErrorText::class, $instance);
70  $this->assertEquals('errortext', $instance->getTextWrong());
71  $this->assertEquals('correcttext', $instance->getTextCorrect());
72  $this->assertEquals(0.01, $instance->getPoints());
73  $this->assertEquals(21, $instance->getPosition());
74  $this->assertEquals(1, $instance->getLength());
75  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_instantiateObjectSimple()

assAnswerErrorTextTest::test_instantiateObjectSimple ( )

Definition at line 36 of file assAnswerErrorTextTest.php.

36  : void
37  {
38  // Act
39  $instance = new assAnswerErrorText('errortext');
40 
41  // Assert
42  $this->assertInstanceOf(assAnswerErrorText::class, $instance);
43  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_withPoints_valid()

assAnswerErrorTextTest::test_withPoints_valid ( )

Definition at line 77 of file assAnswerErrorTextTest.php.

77  : void
78  {
79  $instance = new assAnswerErrorText('errortext');
80  $expected = 0.01;
81 
82  // Act
83  $instance_with_points = $instance->withPoints($expected);
84  $actual = $instance_with_points->getPoints();
85 
86  // Assert
87  $this->assertEquals($actual, $expected);
88  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_withPosition_valid()

assAnswerErrorTextTest::test_withPosition_valid ( )

Definition at line 90 of file assAnswerErrorTextTest.php.

90  : void
91  {
92  $instance = new assAnswerErrorText('errortext');
93  $expected = 21;
94 
95  // Act
96  $instance_with_position = $instance->withPosition($expected);
97  $actual = $instance_with_position->getPosition();
98 
99  // Assert
100  $this->assertEquals($actual, $expected);
101  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $backupGlobals

assAnswerErrorTextTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerErrorTextTest.php.


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