File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ protected function convertFileInformation($file)
111111 */
112112 protected function fixPhpFilesArray (array $ data )
113113 {
114+ // Remove extra key added by PHP 8.1.
115+ unset($ data ['full_path ' ]);
114116 $ keys = array_keys ($ data );
115117 sort ($ keys );
116118
Original file line number Diff line number Diff line change @@ -45,6 +45,23 @@ public function testShouldConvertsUploadedFiles()
4545 $ this ->assertEquals ($ file , $ bag ->get ('file ' ));
4646 }
4747
48+ public function testShouldConvertsUploadedFilesPhp81 ()
49+ {
50+ $ tmpFile = $ this ->createTempFile ();
51+ $ file = new UploadedFile ($ tmpFile , basename ($ tmpFile ), 'text/plain ' );
52+
53+ $ bag = new FileBag (['file ' => [
54+ 'name ' => basename ($ tmpFile ),
55+ 'full_path ' => basename ($ tmpFile ),
56+ 'type ' => 'text/plain ' ,
57+ 'tmp_name ' => $ tmpFile ,
58+ 'error ' => 0 ,
59+ 'size ' => null ,
60+ ]]);
61+
62+ $ this ->assertEquals ($ file , $ bag ->get ('file ' ));
63+ }
64+
4865 public function testShouldSetEmptyUploadedFilesToNull ()
4966 {
5067 $ bag = new FileBag (['file ' => [
You can’t perform that action at this time.
0 commit comments