@@ -61,6 +61,11 @@ public function testCanGrabPostBeforeGet()
6161
6262 //--------------------------------------------------------------------
6363
64+ public function testNoOldInput ()
65+ {
66+ $ this ->assertNull ($ this ->request ->getOldInput ('name ' ));
67+ }
68+
6469 public function testCanGetOldInput ()
6570 {
6671 $ _SESSION ['_ci_old_input ' ] = [
@@ -83,6 +88,16 @@ public function testCanGetOldInputDotted()
8388 $ this ->assertEquals ('two ' , $ this ->request ->getOldInput ('apple.name ' ));
8489 }
8590
91+ public function testMissingOldInput ()
92+ {
93+ $ _SESSION ['_ci_old_input ' ] = [
94+ 'get ' => ['apple ' => ['name ' => 'two ' ]],
95+ 'post ' => ['banana ' => ['name ' => 'foo ' ]],
96+ ];
97+
98+ $ this ->assertNull ($ this ->request ->getOldInput ('pineapple.name ' ));
99+ }
100+
86101 // Reference: https://github.com/codeigniter4/CodeIgniter4/issues/1492
87102 public function testCanGetOldInputArray ()
88103 {
@@ -349,4 +364,21 @@ public function testFileCollectionFactory()
349364 }
350365
351366 //--------------------------------------------------------------------
367+
368+ public function testGetFile ()
369+ {
370+ $ _FILES = [
371+ 'userfile ' => [
372+ 'name ' => 'someFile.txt ' ,
373+ 'type ' => 'text/plain ' ,
374+ 'size ' => '124 ' ,
375+ 'tmp_name ' => '/tmp/myTempFile.txt ' ,
376+ 'error ' => 0 ,
377+ ],
378+ ];
379+
380+ $ gotit = $ this ->request ->getFile ('userfile ' );
381+ $ this ->assertEquals (124 , $ gotit ->getSize ());
382+ }
383+
352384}
0 commit comments