1 | <?php |
||
10 | final class IntsTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @test |
||
14 | * @covers ::filter |
||
15 | */ |
||
16 | public function filterAllowNullIsTrueAndNullValue() |
||
21 | |||
22 | /** |
||
23 | * @test |
||
24 | * @covers ::filter |
||
25 | */ |
||
26 | public function filterPositiveInt() |
||
30 | |||
31 | /** |
||
32 | * @test |
||
33 | * @covers ::filter |
||
34 | */ |
||
35 | public function filterNegativeInt() |
||
39 | |||
40 | /** |
||
41 | * @test |
||
42 | * @covers ::filter |
||
43 | */ |
||
44 | public function filterZeroInt() |
||
50 | |||
51 | /** |
||
52 | * @test |
||
53 | * @covers ::filter |
||
54 | */ |
||
55 | public function filterPositiveString() |
||
61 | |||
62 | /** |
||
63 | * @test |
||
64 | * @covers ::filter |
||
65 | */ |
||
66 | public function filterNegativeString() |
||
71 | |||
72 | /** |
||
73 | * @test |
||
74 | * @covers ::filter |
||
75 | * @expectedException \TraderInteractive\Filter\Exception |
||
76 | * @expectedExceptionMessage "true" $value is not a string |
||
77 | */ |
||
78 | public function filterNonStringOrInt() |
||
82 | |||
83 | /** |
||
84 | * @test |
||
85 | * @covers ::filter |
||
86 | * @expectedException \TraderInteractive\Filter\Exception |
||
87 | * @expectedExceptionMessage $value string length is zero |
||
88 | */ |
||
89 | public function filterEmptyString() |
||
93 | |||
94 | /** |
||
95 | * @test |
||
96 | * @covers ::filter |
||
97 | * @expectedException \TraderInteractive\Filter\Exception |
||
98 | * @expectedExceptionMessage $value string length is zero |
||
99 | */ |
||
100 | public function filterWhitespaceString() |
||
104 | |||
105 | /** |
||
106 | * @test |
||
107 | * @covers ::filter |
||
108 | */ |
||
109 | public function nonDigitString() |
||
122 | |||
123 | /** |
||
124 | * @test |
||
125 | * @covers ::filter |
||
126 | * @expectedException \TraderInteractive\Filter\Exception |
||
127 | */ |
||
128 | public function filterGreaterThanPhpIntMax() |
||
139 | |||
140 | /** |
||
141 | * @test |
||
142 | * @covers ::filter |
||
143 | * @expectedException \TraderInteractive\Filter\Exception |
||
144 | */ |
||
145 | public function filterLessThanPhpIntMin() |
||
156 | |||
157 | /** |
||
158 | * @test |
||
159 | * @covers ::filter |
||
160 | * @expectedException \TraderInteractive\Filter\Exception |
||
161 | * @expectedExceptionMessage -1 is less than 0 |
||
162 | */ |
||
163 | public function filterLessThanMin() |
||
167 | |||
168 | /** |
||
169 | * @test |
||
170 | * @covers ::filter |
||
171 | */ |
||
172 | public function filterEqualToMin() |
||
176 | |||
177 | /** |
||
178 | * @test |
||
179 | * @covers ::filter |
||
180 | * @expectedException \TraderInteractive\Filter\Exception |
||
181 | * @expectedExceptionMessage 1 is greater than 0 |
||
182 | */ |
||
183 | public function filterGreaterThanMax() |
||
187 | |||
188 | /** |
||
189 | * @test |
||
190 | * @covers ::filter |
||
191 | */ |
||
192 | public function filterEqualToMax() |
||
196 | } |
||
197 |
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: