ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
19  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
20  ilUnitUtil::performInitialisation();
21  }
22  else
23  {
24  chdir( dirname( __FILE__ ) );
25  chdir('../../../');
26  }
27  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ test_constructorShouldReturnInstance()

assAnswerClozeTest::test_constructorShouldReturnInstance ( )

Definition at line 29 of file assAnswerClozeTest.php.

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

◆ test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ( )

Definition at line 56 of file assAnswerClozeTest.php.

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

◆ test_setGetLowerBound()

assAnswerClozeTest::test_setGetLowerBound ( )

Definition at line 41 of file assAnswerClozeTest.php.

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

◆ test_setGetLowerBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetLowerBound_nonNumericShouldSetAnswertext ( )

Definition at line 71 of file assAnswerClozeTest.php.

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

◆ test_setGetUpperBound()

assAnswerClozeTest::test_setGetUpperBound ( )

Definition at line 86 of file assAnswerClozeTest.php.

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

◆ test_setGetUpperBound_nonNumericShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_nonNumericShouldSetAnswertext ( )

Definition at line 116 of file assAnswerClozeTest.php.

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

◆ test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext()

assAnswerClozeTest::test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ( )

Definition at line 101 of file assAnswerClozeTest.php.

102  {
103  // Arrange
104  require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
105  $instance = new assAnswerCloze('4');
106 
107  // Act
108  $expected = '4';
109  $instance->setUpperBound(2);
110  $actual = $instance->getUpperBound();
111 
112  // Assert
113  $this->assertEquals($expected, $actual);
114  }
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: