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

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetCorrectness_shouldReturnUnchangedState ()
 
 test_isTrue_shouldReturnTrue ()
 
 test_isFalse_shouldReturnFalseOnTrueState ()
 
 test_setFalseGetCorrectness_shouldReturnFalse ()
 
 test_setTrueIsTrue_shouldReturnUnchangedState ()
 
 test_setFalseIsFalse_shouldReturnUnchangedState ()
 

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 assAnswerTrueFalseTest.php.

Member Function Documentation

◆ setUp()

assAnswerTrueFalseTest::setUp ( )
protected

Definition at line 30 of file assAnswerTrueFalseTest.php.

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

◆ test_instantiateObject_shouldReturnInstance()

assAnswerTrueFalseTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assAnswerTrueFalseTest.php.

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

◆ test_isFalse_shouldReturnFalseOnTrueState()

assAnswerTrueFalseTest::test_isFalse_shouldReturnFalseOnTrueState ( )

Definition at line 70 of file assAnswerTrueFalseTest.php.

70  : void
71  {
72  $instance = new ASS_AnswerTrueFalse();
73  $expected = false;
74 
75  // Act
76  $instance->setCorrectness(true);
77 
78  // Assert
79  $this->assertEquals($expected, $instance->isFalse());
80  $this->assertEquals($expected, $instance->isIncorrect());
81  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_isTrue_shouldReturnTrue()

assAnswerTrueFalseTest::test_isTrue_shouldReturnTrue ( )

Definition at line 57 of file assAnswerTrueFalseTest.php.

57  : void
58  {
59  $instance = new ASS_AnswerTrueFalse();
60  $expected = true;
61 
62  // Act
63  $instance->setCorrectness($expected);
64 
65  // Assert
66  $this->assertEquals($expected, $instance->isTrue());
67  $this->assertEquals($expected, $instance->isCorrect());
68  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setFalseGetCorrectness_shouldReturnFalse()

assAnswerTrueFalseTest::test_setFalseGetCorrectness_shouldReturnFalse ( )

Definition at line 83 of file assAnswerTrueFalseTest.php.

83  : void
84  {
85  $instance = new ASS_AnswerTrueFalse();
86  $expected = false;
87 
88  // Act
89  $instance->setFalse();
90  $actual = $instance->getCorrectness();
91 
92  // Assert
93  $this->assertEquals((bool) $expected, (bool) $actual);
94  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setFalseIsFalse_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setFalseIsFalse_shouldReturnUnchangedState ( )

Definition at line 109 of file assAnswerTrueFalseTest.php.

109  : void
110  {
111  $instance = new ASS_AnswerTrueFalse();
112  $expected = true;
113 
114  // Act
115  $instance->setFalse();
116  $actual = $instance->isFalse();
117 
118  // Assert
119  $this->assertEquals($expected, $actual);
120  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_setGetCorrectness_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setGetCorrectness_shouldReturnUnchangedState ( )

Definition at line 44 of file assAnswerTrueFalseTest.php.

44  : void
45  {
46  $instance = new ASS_AnswerTrueFalse();
47  $expected = true;
48 
49  // Act
50  $instance->setCorrectness($expected);
51  $actual = $instance->getCorrectness();
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_setTrueIsTrue_shouldReturnUnchangedState()

assAnswerTrueFalseTest::test_setTrueIsTrue_shouldReturnUnchangedState ( )

Definition at line 96 of file assAnswerTrueFalseTest.php.

96  : void
97  {
98  $instance = new ASS_AnswerTrueFalse();
99  $expected = true;
100 
101  // Act
102  $instance->setTrue();
103  $actual = $instance->isTrue();
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...

Field Documentation

◆ $backupGlobals

assAnswerTrueFalseTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerTrueFalseTest.php.


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