@@ -607,6 +607,7 @@ public function testIntegerMethod()
607
607
'nan ' => 'nan ' ,
608
608
'mixed ' => '1ab ' ,
609
609
'underscore_notation ' => '2_000 ' ,
610
+ 'null ' => null ,
610
611
]);
611
612
$ this ->assertSame (123 , $ request ->integer ('int ' ));
612
613
$ this ->assertSame (456 , $ request ->integer ('raw_int ' ));
@@ -616,6 +617,8 @@ public function testIntegerMethod()
616
617
$ this ->assertSame (1 , $ request ->integer ('mixed ' ));
617
618
$ this ->assertSame (2 , $ request ->integer ('underscore_notation ' ));
618
619
$ this ->assertSame (123456 , $ request ->integer ('unknown_key ' , 123456 ));
620
+ $ this ->assertSame (0 , $ request ->integer ('null ' ));
621
+ $ this ->assertSame (0 , $ request ->integer ('null ' , 123456 ));
619
622
}
620
623
621
624
public function testFloatMethod ()
@@ -629,6 +632,7 @@ public function testFloatMethod()
629
632
'nan ' => 'nan ' ,
630
633
'mixed ' => '1.ab ' ,
631
634
'scientific_notation ' => '1e3 ' ,
635
+ 'null ' => null ,
632
636
]);
633
637
$ this ->assertSame (1.23 , $ request ->float ('float ' ));
634
638
$ this ->assertSame (45.6 , $ request ->float ('raw_float ' ));
@@ -639,6 +643,8 @@ public function testFloatMethod()
639
643
$ this ->assertSame (1.0 , $ request ->float ('mixed ' ));
640
644
$ this ->assertSame (1e3 , $ request ->float ('scientific_notation ' ));
641
645
$ this ->assertSame (123.456 , $ request ->float ('unknown_key ' , 123.456 ));
646
+ $ this ->assertSame (0.0 , $ request ->float ('null ' ));
647
+ $ this ->assertSame (0.0 , $ request ->float ('null ' , 123.456 ));
642
648
}
643
649
644
650
public function testCollectMethod ()
0 commit comments