From 3ac6f97a4953344d7c512bac1f2880ed636d837a Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Sat, 6 Jul 2024 18:49:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20fix=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 4 ++-- composer.json | 4 ++-- docker/Dockerfile81 | 6 +++++- docker/Dockerfile82 | 1 + docker/Dockerfile83 | 1 + src/Metadata/ClassMetadata.php | 10 ++-------- tests/DummyFile.php | 2 ++ tests/DummyImageFile.php | 1 + tests/VichUploaderBundleTest.php | 2 +- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b483841f..77601367 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,7 +17,7 @@ jobs: with: php-version: 8.1 - run: | - composer require --no-update doctrine/annotations:"^2.0" liip/imagine-bundle:"^2.8" phpstan/extension-installer phpstan/phpstan-phpunit:1.3.* phpstan/phpstan:1.9.* + composer require --no-update doctrine/annotations:^1.14 liip/imagine-bundle:"^2.8" phpstan/extension-installer phpstan/phpstan-phpunit:1.4.* phpstan/phpstan:1.11.* composer config --no-plugins allow-plugins.phpstan/extension-installer true composer install --ignore-platform-reqs XDEBUG_MODE=off vendor/bin/phpstan @@ -72,7 +72,7 @@ jobs: with_oneupbundle: false max_deprecations: 0 - php: '8.3' - symfony: '7.0.*' + symfony: '7.1.*' dependencies: highest with_imagine: false with_oneupbundle: false diff --git a/composer.json b/composer.json index 130ac4d3..3e2d9126 100644 --- a/composer.json +++ b/composer.json @@ -17,14 +17,14 @@ "require": { "php": "^8.1", "ext-simplexml": "*", - "doctrine/persistence": "^3", + "doctrine/persistence": "^3.0", "jms/metadata": "^2.4", "symfony/config": "^5.4 || ^6.0 || ^7.0", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", "symfony/event-dispatcher-contracts": "^3.1", "symfony/http-foundation": "^5.4 || ^6.0 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0, !=6.4.9 || ^7.0, !=7.1.2", "symfony/mime": "^5.4 || ^6.0 || ^7.0", "symfony/property-access": "^5.4 || ^6.0 || ^7.0", "symfony/string": "^5.4 || ^6.0 || ^7.0" diff --git a/docker/Dockerfile81 b/docker/Dockerfile81 index 60728d93..dcb12fcc 100644 --- a/docker/Dockerfile81 +++ b/docker/Dockerfile81 @@ -38,7 +38,11 @@ WORKDIR /srv/vich-uploader COPY . ./ RUN set -eux; \ - composer install --prefer-dist --ignore-platform-reqs; \ + composer global config --no-plugins allow-plugins.symfony/flex true; \ + composer global require --no-interaction --no-progress symfony/flex:^2.2; \ + composer config extra.symfony.require "^6.4"; \ + composer require --no-update doctrine/annotations:^1.14; \ + composer update --prefer-dist --ignore-platform-reqs; \ composer clear-cache CMD ["/init"] diff --git a/docker/Dockerfile82 b/docker/Dockerfile82 index 935ae075..395be855 100644 --- a/docker/Dockerfile82 +++ b/docker/Dockerfile82 @@ -38,6 +38,7 @@ WORKDIR /srv/vich-uploader COPY . ./ RUN set -eux; \ + composer require --no-update doctrine/annotations:^1.14; \ composer update --prefer-dist --ignore-platform-reqs; \ composer clear-cache diff --git a/docker/Dockerfile83 b/docker/Dockerfile83 index 74cbfdec..e8b7ffb4 100644 --- a/docker/Dockerfile83 +++ b/docker/Dockerfile83 @@ -38,6 +38,7 @@ WORKDIR /srv/vich-uploader COPY . ./ RUN set -eux; \ + composer require --no-update doctrine/annotations:^1.14; \ composer update --prefer-dist --ignore-platform-reqs; \ composer clear-cache diff --git a/src/Metadata/ClassMetadata.php b/src/Metadata/ClassMetadata.php index dad2cefd..a560884e 100644 --- a/src/Metadata/ClassMetadata.php +++ b/src/Metadata/ClassMetadata.php @@ -13,18 +13,12 @@ final class ClassMetadata extends BaseClassMetadata public function serialize(): string { - return \serialize([ - $this->fields, - parent::serialize(), - ]); + return \serialize([$this->fields, parent::serialize()]); } public function unserialize($str): void { - [ - $this->fields, - $parentStr - ] = \unserialize($str); + [$this->fields, $parentStr] = \unserialize($str); parent::unserialize($parentStr); } diff --git a/tests/DummyFile.php b/tests/DummyFile.php index d0b0a42a..991a4dfb 100644 --- a/tests/DummyFile.php +++ b/tests/DummyFile.php @@ -13,7 +13,9 @@ class DummyFile { /** * @ORM\Id + * * @ORM\Column(type="integer") + * * @ORM\GeneratedValue(strategy="AUTO") * * @var int diff --git a/tests/DummyImageFile.php b/tests/DummyImageFile.php index c2d4919f..129541aa 100644 --- a/tests/DummyImageFile.php +++ b/tests/DummyImageFile.php @@ -7,6 +7,7 @@ /** * @ORM\Entity + * * @Vich\Uploadable */ class DummyImageFile diff --git a/tests/VichUploaderBundleTest.php b/tests/VichUploaderBundleTest.php index 8a2120d5..2df3d980 100644 --- a/tests/VichUploaderBundleTest.php +++ b/tests/VichUploaderBundleTest.php @@ -89,7 +89,7 @@ public function testFlysystemOfficialKernel(): void public function testFlysystemOneUpKernel(): void { if (!\class_exists(OneupFlysystemBundle::class)) { - $this->markTestSkipped('OneupFlysystemBundle supports only PHP > 7.4'); + $this->markTestSkipped('OneupFlysystemBundle not installed'); } $kernel = new FlysystemOneUpAppKernel('test', true);