2
2
3
3
namespace Illuminate \Tests \Support ;
4
4
5
+ use Illuminate \Support \Carbon ;
5
6
use Illuminate \Support \Collection ;
6
7
use Illuminate \Support \Stringable ;
7
8
use Illuminate \Support \ValidatedInput ;
8
9
use Illuminate \Tests \Support \Fixtures \StringBackedEnum ;
9
10
use PHPUnit \Framework \TestCase ;
10
- use Illuminate \Support \Carbon ;
11
11
12
12
class ValidatedInputTest extends TestCase
13
13
{
@@ -120,7 +120,6 @@ public function test_when_has_method()
120
120
$ foo = $ value ;
121
121
});
122
122
123
-
124
123
$ input ->whenHas ('foo.bar ' , function ($ value ) use (&$ bar ) {
125
124
$ bar = $ value ;
126
125
});
@@ -212,7 +211,6 @@ public function test_when_filled_method()
212
211
$ foo = $ value ;
213
212
});
214
213
215
-
216
214
$ input ->whenFilled ('foo.bar ' , function ($ value ) use (&$ bar ) {
217
215
$ bar = $ value ;
218
216
});
@@ -248,7 +246,6 @@ public function test_missing_method()
248
246
$ this ->assertTrue ($ input ->missing (['votes ' , 'foo.bar ' ]));
249
247
}
250
248
251
-
252
249
public function test_when_missing_method ()
253
250
{
254
251
$ input = new ValidatedInput (['foo ' => ['bar ' => null ]]);
@@ -303,7 +300,6 @@ public function test_all_method()
303
300
$ this ->assertEquals (['name ' => 'Fatih ' , 'surname ' => 'AYDIN ' , 'foo ' => ['bar ' => null , 'baz ' => '' ]], $ input ->all ());
304
301
}
305
302
306
-
307
303
public function test_input_method ()
308
304
{
309
305
$ input = new ValidatedInput (['name ' => 'Fatih ' , 'surname ' => 'AYDIN ' , 'foo ' => ['bar ' => null , 'baz ' => '' ]]);
@@ -341,7 +337,6 @@ public function test_str_method()
341
337
$ this ->assertSame ('' , $ input ->str ('unknown_key ' )->value ());
342
338
}
343
339
344
-
345
340
public function test_string_method ()
346
341
{
347
342
$ input = new ValidatedInput ([
@@ -370,7 +365,6 @@ public function test_string_method()
370
365
$ this ->assertSame ('' , $ input ->string ('unknown_key ' )->value ());
371
366
}
372
367
373
-
374
368
public function test_boolean_method ()
375
369
{
376
370
$ input = new ValidatedInput ([
@@ -379,7 +373,7 @@ public function test_boolean_method()
379
373
'checked ' => 1 ,
380
374
'unchecked ' => '0 ' ,
381
375
'with_on ' => 'on ' ,
382
- 'with_yes ' => 'yes '
376
+ 'with_yes ' => 'yes ' ,
383
377
]);
384
378
385
379
$ this ->assertTrue ($ input ->boolean ('checked ' ));
@@ -391,7 +385,6 @@ public function test_boolean_method()
391
385
$ this ->assertTrue ($ input ->boolean ('with_yes ' ));
392
386
}
393
387
394
-
395
388
public function test_integer_method ()
396
389
{
397
390
$ input = new ValidatedInput ([
@@ -417,7 +410,6 @@ public function test_integer_method()
417
410
$ this ->assertSame (0 , $ input ->integer ('null ' , 123456 ));
418
411
}
419
412
420
-
421
413
public function test_float_method ()
422
414
{
423
415
$ input = new ValidatedInput ([
@@ -445,7 +437,6 @@ public function test_float_method()
445
437
$ this ->assertSame (0.0 , $ input ->float ('null ' , 123.456 ));
446
438
}
447
439
448
-
449
440
public function test_date_method ()
450
441
{
451
442
$ input = new ValidatedInput ([
@@ -516,7 +507,6 @@ public function test_collect_method()
516
507
$ this ->
assertEquals ([
'users ' => [
1 ,
2 ,
3 ],
'roles ' => [
4 ,
5 ,
6 ],
'foo ' => [
'bar ' ,
'baz ' ],
'email ' =>
'[email protected] ' ],
$ input->
collect ()->
all ());
517
508
}
518
509
519
-
520
510
public function test_only_method ()
521
511
{
522
512
$ input = new ValidatedInput (['name ' => 'Fatih ' , 'surname ' => 'AYDIN ' , 'foo ' => ['bar ' => null , 'baz ' => '' ]]);
0 commit comments