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 @@ -113,6 +113,8 @@ protected function convertFileInformation($file)
113
113
*/
114
114
protected function fixPhpFilesArray ($ data )
115
115
{
116
+ // Remove extra key added by PHP 8.1.
117
+ unset($ data ['full_path ' ]);
116
118
$ keys = array_keys ($ data );
117
119
sort ($ keys );
118
120
Original file line number Diff line number Diff line change @@ -45,6 +45,23 @@ public function testShouldConvertsUploadedFiles()
45
45
$ this ->assertEquals ($ file , $ bag ->get ('file ' ));
46
46
}
47
47
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
+
48
65
public function testShouldSetEmptyUploadedFilesToNull ()
49
66
{
50
67
$ bag = new FileBag (['file ' => [
You can’t perform that action at this time.
0 commit comments