1 | <?php |
||
10 | final class FloatsTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @test |
||
14 | * @covers ::filter |
||
15 | */ |
||
16 | public function filterAllowNullIsTrueAndNullValue() |
||
20 | |||
21 | /** |
||
22 | * @test |
||
23 | * @covers ::filter |
||
24 | */ |
||
25 | public function filterPositiveFloat() |
||
29 | |||
30 | /** |
||
31 | * @test |
||
32 | * @covers ::filter |
||
33 | */ |
||
34 | public function filterNegativeFloat() |
||
38 | |||
39 | /** |
||
40 | * @test |
||
41 | * @covers ::filter |
||
42 | */ |
||
43 | public function filterZeroFloat() |
||
49 | |||
50 | /** |
||
51 | * @test |
||
52 | * @covers ::filter |
||
53 | */ |
||
54 | public function filterPositiveString() |
||
69 | |||
70 | /** |
||
71 | * @test |
||
72 | * @covers ::filter |
||
73 | */ |
||
74 | public function filterNegativeString() |
||
87 | |||
88 | /** |
||
89 | * @test |
||
90 | * @covers ::filter |
||
91 | * @expectedException \TraderInteractive\Filter\Exception |
||
92 | * @expectedExceptionMessage "true" $value is not a string |
||
93 | */ |
||
94 | public function filterNonStringOrFloat() |
||
98 | |||
99 | /** |
||
100 | * @test |
||
101 | * @covers ::filter |
||
102 | * @expectedException \TraderInteractive\Filter\Exception |
||
103 | * @exceptedExceptionMessage does not pass is_numeric |
||
104 | */ |
||
105 | public function filterEmptyString() |
||
109 | |||
110 | /** |
||
111 | * @test |
||
112 | * @covers ::filter |
||
113 | * @expectedException \TraderInteractive\Filter\Exception |
||
114 | * @expectedExceptionMessage does not pass is_numeric |
||
115 | */ |
||
116 | public function filterWhitespaceString() |
||
120 | |||
121 | /** |
||
122 | * @test |
||
123 | * @covers ::filter |
||
124 | * @expectedException \TraderInteractive\Filter\Exception |
||
125 | * @expectedExceptionMessage 123-4 does not pass is_numeric |
||
126 | */ |
||
127 | public function filterNonDigitString() |
||
131 | |||
132 | /** |
||
133 | * @test |
||
134 | * @covers ::filter |
||
135 | * @expectedException \TraderInteractive\Filter\Exception |
||
136 | */ |
||
137 | public function filterHexString() |
||
141 | |||
142 | /** |
||
143 | * @test |
||
144 | * @covers ::filter |
||
145 | * @expectedException \TraderInteractive\Filter\Exception |
||
146 | * @expectedExceptionMessage 1. 0 does not pass is_numeric |
||
147 | */ |
||
148 | public function filterRogueSpaceStringAfterPeriod() |
||
152 | |||
153 | /** |
||
154 | * @test |
||
155 | * @covers ::filter |
||
156 | * @expectedException \TraderInteractive\Filter\Exception |
||
157 | * @expectedExceptionMessage 1 0 does not pass is_numeric |
||
158 | */ |
||
159 | public function filterRogueSpaceStringBetweenDigits() |
||
163 | |||
164 | /** |
||
165 | * @test |
||
166 | * @covers ::filter |
||
167 | * @expectedException \TraderInteractive\Filter\Exception |
||
168 | * @expectedExceptionMessage 1e999999999999 overflow |
||
169 | */ |
||
170 | public function filterOverflow() |
||
174 | |||
175 | /** |
||
176 | * @test |
||
177 | * @covers ::filter |
||
178 | * @expectedException \TraderInteractive\Filter\Exception |
||
179 | * @expectedExceptionMessage -1e999999999999 overflow |
||
180 | */ |
||
181 | public function filterUnderflow() |
||
185 | |||
186 | /** |
||
187 | * @test |
||
188 | * @covers ::filter |
||
189 | * @expectedException \TraderInteractive\Filter\Exception |
||
190 | * @expectedExceptionMessage -1 is less than 0 |
||
191 | */ |
||
192 | public function filterLessThanMin() |
||
196 | |||
197 | /** |
||
198 | * @test |
||
199 | * @covers ::filter |
||
200 | */ |
||
201 | public function filterEqualToMin() |
||
205 | |||
206 | /** |
||
207 | * @test |
||
208 | * @covers ::filter |
||
209 | * @expectedException \TraderInteractive\Filter\Exception |
||
210 | * @expectedExceptionMessage 1 is greater than 0 |
||
211 | */ |
||
212 | public function filterGreaterThanMax() |
||
216 | |||
217 | /** |
||
218 | * @test |
||
219 | * @covers ::filter |
||
220 | */ |
||
221 | public function filterEqualToMax() |
||
225 | |||
226 | /** |
||
227 | * @test |
||
228 | * @covers ::filter |
||
229 | */ |
||
230 | public function filterCastInts() |
||
234 | |||
235 | /** |
||
236 | * @test |
||
237 | * @covers ::filter |
||
238 | * @expectedException \TraderInteractive\Filter\Exception |
||
239 | * @expectedExceptionMessage "1" $value is not a string |
||
240 | */ |
||
241 | public function filterCastIntsIsFalse() |
||
245 | } |
||
246 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: