diff --git a/src/Codeception/Lib/Connector/Laravel.php b/src/Codeception/Lib/Connector/Laravel.php index 831f9e0..5351bb6 100644 --- a/src/Codeception/Lib/Connector/Laravel.php +++ b/src/Codeception/Lib/Connector/Laravel.php @@ -463,4 +463,32 @@ public function clearApplicationHandlers(): void { $this->applicationHandlers = []; } + + /** + * Make sure files are \Illuminate\Http\UploadedFile instances with the private $test property set to true. + * Fixes issue https://github.com/Codeception/Codeception/pull/3417. + * + * @param array $files + * @return array + */ + protected function filterFiles(array $files): array + { + $files = parent::filterFiles($files); + return $this->convertToTestFiles($files); + } + + private function convertToTestFiles(array $files): array + { + $filtered = []; + + foreach ($files as $key => $value) { + if (is_array($value)) { + $filtered[$key] = $this->convertToTestFiles($value); + } else { + $filtered[$key] = UploadedFile::createFromBase($value, true); + } + } + + return $filtered; + } }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: