File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/Codeception/Lib/Connector Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -463,4 +463,32 @@ public function clearApplicationHandlers(): void
463463 {
464464 $ this ->applicationHandlers = [];
465465 }
466+
467+ /**
468+ * Make sure files are \Illuminate\Http\UploadedFile instances with the private $test property set to true.
469+ * Fixes issue https://github.com/Codeception/Codeception/pull/3417.
470+ *
471+ * @param array $files
472+ * @return array
473+ */
474+ protected function filterFiles (array $ files ): array
475+ {
476+ $ files = parent ::filterFiles ($ files );
477+ return $ this ->convertToTestFiles ($ files );
478+ }
479+
480+ private function convertToTestFiles (array $ files ): array
481+ {
482+ $ filtered = [];
483+
484+ foreach ($ files as $ key => $ value ) {
485+ if (is_array ($ value )) {
486+ $ filtered [$ key ] = $ this ->convertToTestFiles ($ value );
487+ } else {
488+ $ filtered [$ key ] = UploadedFile::createFromBase ($ value , true );
489+ }
490+ }
491+
492+ return $ filtered ;
493+ }
466494}
You can’t perform that action at this time.
0 commit comments