diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ba244a..6d29de0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,6 +66,33 @@ jobs: composer update -n --prefer-dist php vendor/bin/phpunit --testsuite=no-optional-deps --exclude-group=without-filesystem-message + test-php81: + docker: + - image: cimg/php:8.1 + + working_directory: ~/project + steps: + - checkout + - run: + name: Run tests / Symfony 5^0 + command: | + rm -Rf var/* + composer update -n --prefer-dist + php vendor/bin/phpunit --testsuite=no-optional-deps --exclude-group=without-filesystem-message + + test-php82: + docker: + - image: cimg/php:8.2 + + working_directory: ~/project + steps: + - checkout + - run: + name: Run tests / Symfony 5^0 + command: | + rm -Rf var/* + composer update -n --prefer-dist + php vendor/bin/phpunit --testsuite=no-optional-deps --exclude-group=without-filesystem-message workflows: version: 2 test: @@ -73,3 +100,5 @@ workflows: - test-php74 - test-php74-with-filesystem - test-php80 + - test-php81 + - test-php82 diff --git a/src/Adapter/SymfonyKernelBasedAdapter.php b/src/Adapter/SymfonyKernelBasedAdapter.php index 85f74f7..82c46c9 100644 --- a/src/Adapter/SymfonyKernelBasedAdapter.php +++ b/src/Adapter/SymfonyKernelBasedAdapter.php @@ -125,7 +125,7 @@ public static function create( */ protected function preload(): PromiseInterface { - return resolve(); + return resolve(null); } /** @@ -293,7 +293,7 @@ private function toSymfonyUploadedFile(PsrUploadedFile $file): PromiseInterface ->file($tmpFilename) ->putContents($content) ) - : resolve(); + : resolve(null); return $promise ->then(function () use ($file, $tmpFilename, $filename) { @@ -316,6 +316,12 @@ private function cleanTemporaryUploadedFiles(Request $request): array { return array_map(function (SymfonyUploadedFile $file) { $filePath = $file->getPath().'/'.$file->getFilename(); + if ( + $file->getError() !== 0 || + $filePath === '/' + ) { + return resolve(null); + } return (is_null($this->filesystem)) ? resolve(unlink($filePath)) diff --git a/tests/FakeLaminasKernel.php b/tests/FakeLaminasKernel.php index fe81e8a..3ed7ad9 100644 --- a/tests/FakeLaminasKernel.php +++ b/tests/FakeLaminasKernel.php @@ -83,7 +83,7 @@ public static function getStaticFolder(): ? string */ public function shutDown(): PromiseInterface { - return resolve(); + return resolve(null); } /**