1- <?php
1+ <?php declare (strict_types= 1 );
22/*
33 * This file is part of Aplus Framework Validation Library.
44 *
@@ -136,24 +136,30 @@ public function testJson() : void
136136 public function testMaxLength () : void
137137 {
138138 self ::assertTrue (Validator ::maxLength ('alpha ' , $ this ->array , 3 ));
139+ self ::assertTrue (Validator ::maxLength ('alpha ' , $ this ->array , '3 ' ));
139140 self ::assertTrue (Validator ::maxLength ('number ' , $ this ->array , 3 ));
140141 self ::assertFalse (Validator ::maxLength ('alphaNumber ' , $ this ->array , 3 ));
142+ self ::assertFalse (Validator ::maxLength ('alphaNumber ' , $ this ->array , '3 ' ));
141143 self ::assertFalse (Validator ::maxLength ('unknown ' , $ this ->array , 3 ));
142144 }
143145
144146 public function testMinLength () : void
145147 {
146148 self ::assertTrue (Validator ::minLength ('alpha ' , $ this ->array , 3 ));
149+ self ::assertTrue (Validator ::minLength ('alpha ' , $ this ->array , '3 ' ));
147150 self ::assertTrue (Validator ::minLength ('number ' , $ this ->array , 3 ));
148151 self ::assertFalse (Validator ::minLength ('alpha ' , $ this ->array , 4 ));
152+ self ::assertFalse (Validator ::minLength ('alpha ' , $ this ->array , '4 ' ));
149153 self ::assertFalse (Validator ::minLength ('unknown ' , $ this ->array , 3 ));
150154 }
151155
152156 public function testLength () : void
153157 {
154158 self ::assertTrue (Validator ::length ('alpha ' , $ this ->array , 3 ));
159+ self ::assertTrue (Validator ::length ('alpha ' , $ this ->array , '3 ' ));
155160 self ::assertTrue (Validator ::length ('number ' , $ this ->array , 3 ));
156161 self ::assertFalse (Validator ::length ('alpha ' , $ this ->array , 4 ));
162+ self ::assertFalse (Validator ::length ('alpha ' , $ this ->array , '4 ' ));
157163 self ::assertFalse (Validator ::length ('unknown ' , $ this ->array , 3 ));
158164 }
159165
@@ -216,36 +222,40 @@ public function testBetween() : void
216222 {
217223 self ::assertTrue (Validator ::between ('alpha ' , $ this ->array , 'a ' , 'b ' ));
218224 self ::assertTrue (Validator ::between ('number ' , $ this ->array , 120 , 123 ));
225+ self ::assertTrue (Validator ::between ('number ' , $ this ->array , '120 ' , '123 ' ));
219226 self ::assertFalse (Validator ::between ('alpha ' , $ this ->array , 'b ' , 'c ' ));
220227 self ::assertFalse (Validator ::between ('unknown ' , $ this ->array , 1 , 2 ));
228+ self ::assertFalse (Validator ::between ('unknown ' , $ this ->array , '1 ' , '2 ' ));
221229 }
222230
223231 public function testNotBetween () : void
224232 {
225233 self ::assertFalse (Validator ::notBetween ('alpha ' , $ this ->array , 'a ' , 'b ' ));
226234 self ::assertFalse (Validator ::notBetween ('number ' , $ this ->array , 120 , 123 ));
235+ self ::assertFalse (Validator ::notBetween ('number ' , $ this ->array , '120 ' , '123 ' ));
227236 self ::assertTrue (Validator ::notBetween ('alpha ' , $ this ->array , 'b ' , 'c ' ));
228237 self ::assertTrue (Validator ::notBetween ('unknown ' , $ this ->array , 1 , 2 ));
238+ self ::assertTrue (Validator ::notBetween ('unknown ' , $ this ->array , '1 ' , '2 ' ));
229239 }
230240
231241 public function testIn () : void
232242 {
233243 self ::assertTrue (Validator ::in ('alpha ' , $ this ->array , 'a ' , 'abc ' , 'def ' ));
234- // @phpstan-ignore-next-line
235244 self ::assertTrue (Validator ::in ('number ' , $ this ->array , 120 , 123 , 456 ));
245+ self ::assertTrue (Validator ::in ('number ' , $ this ->array , '120 ' , '123 ' , '456 ' ));
236246 self ::assertFalse (Validator ::in ('alpha ' , $ this ->array , 'b ' , 'c ' , 'd ' ));
237- // @phpstan-ignore-next-line
238247 self ::assertFalse (Validator ::in ('unknown ' , $ this ->array , 1 , 2 , 3 ));
248+ self ::assertFalse (Validator ::in ('unknown ' , $ this ->array , '1 ' , '2 ' , '3 ' ));
239249 }
240250
241251 public function testNotIn () : void
242252 {
243253 self ::assertFalse (Validator ::notIn ('alpha ' , $ this ->array , 'a ' , 'abc ' , 'def ' ));
244- // @phpstan-ignore-next-line
245254 self ::assertFalse (Validator ::notIn ('number ' , $ this ->array , 120 , 123 , 456 ));
255+ self ::assertFalse (Validator ::notIn ('number ' , $ this ->array , '120 ' , '123 ' , '456 ' ));
246256 self ::assertTrue (Validator ::notIn ('alpha ' , $ this ->array , 'b ' , 'c ' , 'd ' ));
247- // @phpstan-ignore-next-line
248257 self ::assertTrue (Validator ::notIn ('unknown ' , $ this ->array , 1 , 2 , 3 ));
258+ self ::assertTrue (Validator ::notIn ('unknown ' , $ this ->array , '1 ' , '2 ' , '3 ' ));
249259 }
250260
251261 public function testLatin () : void
@@ -262,8 +272,10 @@ public function testIp() : void
262272 self ::assertTrue (Validator ::ip ('ipv4 ' , $ this ->array ));
263273 self ::assertTrue (Validator ::ip ('ipv6 ' , $ this ->array ));
264274 self ::assertTrue (Validator ::ip ('ipv4 ' , $ this ->array , 4 ));
275+ self ::assertTrue (Validator ::ip ('ipv4 ' , $ this ->array , '4 ' ));
265276 self ::assertTrue (Validator ::ip ('ipv6 ' , $ this ->array , 6 ));
266277 self ::assertFalse (Validator ::ip ('ipv4 ' , $ this ->array , 6 ));
278+ self ::assertFalse (Validator ::ip ('ipv4 ' , $ this ->array , '6 ' ));
267279 self ::assertFalse (Validator ::ip ('ipv6 ' , $ this ->array , 4 ));
268280 self ::assertFalse (Validator ::ip ('unknown ' , $ this ->array ));
269281 $ this ->expectException (\InvalidArgumentException::class);
0 commit comments