ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assAnswerClozeTest Class Reference

Unit tests. More...

+ Inheritance diagram for assAnswerClozeTest:
+ Collaboration diagram for assAnswerClozeTest:

Public Member Functions

 test_constructorShouldReturnInstance ()
 
 test_setGetLowerBound ()
 
 test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ()
 
 test_setGetLowerBound_nonNumericShouldSetAnswertext ()
 
 test_setGetUpperBound ()
 
 test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ()
 
 test_setGetUpperBound_nonNumericShouldSetAnswertext ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Unit tests.

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

Definition at line 11 of file assAnswerClozeTest.php.

Member Function Documentation

◆ setUp()

assAnswerClozeTest::setUp ( )
protected

Definition at line 15 of file assAnswerClozeTest.php.

References defined.

16  {
17  if (defined('ILIAS_PHPUNIT_CONTEXT')) {
18  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19  ilUnitUtil::performInitialisation();
20  } else {
21  chdir(dirname(__FILE__));
22  chdir('../../../');
23  }
24  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ test_constructorShouldReturnInstance()

assAnswerClozeTest::test_constructorShouldReturnInstance ( )

Definition at line 26 of file assAnswerClozeTest.php.

27  {
28  // Arrange
29  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
30 
31  // Act
32  $instance = new assAnswerCloze();
33 
34  // Assert
35  $this->assertNotNull($instance);
36  }
Class for cloze question numeric answers.

◆ test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ( )

Definition at line 53 of file assAnswerClozeTest.php.

54  {
55  // Arrange
56  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
57  $instance = new assAnswerCloze('2');
58 
59  // Act
60  $expected = '2';
61  $instance->setLowerBound(4);
62  $actual = $instance->getLowerBound();
63 
64  // Assert
65  $this->assertEquals($expected, $actual);
66  }
Class for cloze question numeric answers.

◆ test_setGetLowerBound()

assAnswerClozeTest::test_setGetLowerBound ( )

Definition at line 38 of file assAnswerClozeTest.php.

39  {
40  // Arrange
41  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
42  $instance = new assAnswerCloze('2');
43 
44  // Act
45  $expected = '1';
46  $instance->setLowerBound($expected);
47  $actual = $instance->getLowerBound();
48 
49  // Assert
50  $this->assertEquals($expected, $actual);
51  }
Class for cloze question numeric answers.

◆ test_setGetLowerBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBound_nonNumericShouldSetAnswertext ( )

Definition at line 68 of file assAnswerClozeTest.php.

69  {
70  // Arrange
71  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
72  $instance = new assAnswerCloze('2');
73 
74  // Act
75  $expected = '2';
76  $instance->setLowerBound('test');
77  $actual = $instance->getLowerBound();
78 
79  // Assert
80  $this->assertEquals($expected, $actual);
81  }
Class for cloze question numeric answers.

◆ test_setGetUpperBound()

assAnswerClozeTest::test_setGetUpperBound ( )

Definition at line 83 of file assAnswerClozeTest.php.

84  {
85  // Arrange
86  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
87  $instance = new assAnswerCloze('1');
88 
89  // Act
90  $expected = '3';
91  $instance->setUpperBound($expected);
92  $actual = $instance->getUpperBound();
93 
94  // Assert
95  $this->assertEquals($expected, $actual);
96  }
Class for cloze question numeric answers.

◆ test_setGetUpperBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_nonNumericShouldSetAnswertext ( )

Definition at line 113 of file assAnswerClozeTest.php.

114  {
115  // Arrange
116  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
117  $instance = new assAnswerCloze('4');
118 
119  // Act
120  $expected = '4';
121  $instance->setUpperBound('test');
122  $actual = $instance->getUpperBound();
123 
124  // Assert
125  $this->assertEquals($expected, $actual);
126  }
Class for cloze question numeric answers.

◆ test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ( )

Definition at line 98 of file assAnswerClozeTest.php.

99  {
100  // Arrange
101  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
102  $instance = new assAnswerCloze('4');
103 
104  // Act
105  $expected = '4';
106  $instance->setUpperBound(2);
107  $actual = $instance->getUpperBound();
108 
109  // Assert
110  $this->assertEquals($expected, $actual);
111  }
Class for cloze question numeric answers.

Field Documentation

◆ $backupGlobals

assAnswerClozeTest::$backupGlobals = false
protected

Definition at line 13 of file assAnswerClozeTest.php.


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