ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assNumericRangeTest.php
Go to the documentation of this file.
1 <?php
2 
27 {
28  protected $backupGlobals = false;
29 
30  protected function setUp(): void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }
35 
37  {
38  // Act
39  $instance = new assNumericRange();
40 
41  $this->assertInstanceOf('assNumericRange', $instance);
42  }
43 
45  {
46  $instance = new assNumericRange();
47  $expected = 1.00;
48 
49  // Act
50  $instance->setLowerLimit($expected);
51  $actual = $instance->getLowerLimit();
52 
53  // Assert
54  $this->assertEquals($expected, $actual);
55  }
56 
58  {
59  $instance = new assNumericRange();
60  $expected = 10.00;
61 
62  // Act
63  $instance->setUpperLimit($expected);
64  $actual = $instance->getUpperLimit();
65 
66  // Assert
67  $this->assertEquals($expected, $actual);
68  }
69 
71  {
72  $instance = new assNumericRange();
73  $expected = 10;
74 
75  // Act
76  $instance->setOrder($expected);
77  $actual = $instance->getOrder();
78 
79  // Assert
80  $this->assertEquals($expected, $actual);
81  }
82 
84  {
85  $instance = new assNumericRange();
86  $expected = 10;
87 
88  // Act
89  $instance->setPoints($expected);
90  $actual = $instance->getPoints();
91 
92  // Assert
93  $this->assertEquals($expected, $actual);
94  }
95 
97  {
98  $instance = new assNumericRange();
99  $instance->setLowerLimit(1.00);
100  $instance->setUpperLimit(10.00);
101  $expected = true;
102 
103  // Act
104  $actual = $instance->contains(5.00);
105 
106  // Assert
107  $this->assertEquals($expected, $actual);
108  }
109 
111  {
112  $instance = new assNumericRange();
113  $instance->setLowerLimit(1.00);
114  $instance->setUpperLimit(10.00);
115  $expected = false;
116 
117  // Act
118  $actual = $instance->contains(15.00);
119 
120  // Assert
121  $this->assertEquals($expected, $actual);
122  }
123 
125  {
126  $instance = new assNumericRange();
127  $instance->setLowerLimit(1.00);
128  $instance->setUpperLimit(10.00);
129  $expected = false;
130 
131  // Act
132  $actual = $instance->contains('Günther');
133 
134  // Assert
135  $this->assertEquals($expected, $actual);
136  }
137 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_setGetLowerLimit_shouldReturnUnchangedLowerLimit()
Class assBaseTestCase.
test_contains_shouldReturnFalseIfValueIsNotContained()
test_setGetUpperLimit_shouldReturnUnchangedUpperLimit()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...