diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 4a0f18a97..73ede6d8d 100755 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.5-fpm +FROM php:8.2-fpm RUN apt-get update \ && apt-get install -y --no-install-recommends vim curl debconf subversion git apt-transport-https apt-utils \ @@ -14,8 +14,8 @@ RUN docker-php-ext-configure gd --with-jpeg RUN docker-php-ext-install pdo pdo_mysql gd zip pcntl COPY php.ini /usr/local/etc/php/php.ini -COPY php.ini /etc/php/8.1.5/php.ini -COPY php-fpm-pool.conf /etc/php/8.1.5/pool.d/www.conf +COPY php.ini /etc/php/8.2/php.ini +COPY php-fpm-pool.conf /etc/php/8.2/pool.d/www.conf #COMPOSER RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \ @@ -34,7 +34,7 @@ RUN apt-get install -y --no-install-recommends awscli #XDEBUG ARG xdebug RUN if [ $xdebug = "1" ] ; then \ - pecl install -f xdebug-3.1.4 \ + pecl install -f xdebug-3.3.1 \ && docker-php-ext-enable xdebug \ ; fi diff --git a/.github/actions/git-split/Dockerfile b/.github/actions/git-split/Dockerfile index 1c3fecf6f..d970295d5 100644 --- a/.github/actions/git-split/Dockerfile +++ b/.github/actions/git-split/Dockerfile @@ -1,5 +1,5 @@ # THIS IS BASE IMAGE -FROM php:8.3-cli-alpine +FROM php:8.2-cli-alpine RUN apk add --no-cache git git-subtree @@ -14,4 +14,4 @@ WORKDIR /splitter COPY entrypoint.sh . # see https://nickjanetakis.com/blog/docker-tip-86-always-make-your-entrypoint-scripts-executable -ENTRYPOINT ["sh", "/splitter/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["sh", "/splitter/entrypoint.sh"] diff --git a/.github/workflows/after_splitting_test.yaml b/.github/workflows/after_splitting_test.yaml index 795da3590..8f0bcfd98 100644 --- a/.github/workflows/after_splitting_test.yaml +++ b/.github/workflows/after_splitting_test.yaml @@ -51,7 +51,7 @@ jobs: - name: PHP Setup uses: 'shivammathur/setup-php@v2' with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Setup MySQL @@ -68,7 +68,7 @@ jobs: - name: 'Composer Setup' run: | composer install --no-progress - vendor-bin/monorepo/vendor/bin/monorepo-builder localize-composer-paths composer.json + vendor-bin/monorepo/vendor/bin/monorepo-builder localize-composer-paths packages/${{ matrix.package_name }}/composer.json cd packages/${{ matrix.package_name }} composer update --no-progress diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0306eade..104017cf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.2', '8.3'] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 223b2ad93..874239805 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -23,7 +23,7 @@ jobs: - name: PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: composer - name: Composer run: composer install diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 875d2e11b..4d2eee9d3 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -23,7 +23,7 @@ jobs: - name: PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: composer - name: Composer run: composer install diff --git a/app/src/Resources/skeleton/draw-package/composer.json.twig b/app/src/Resources/skeleton/draw-package/composer.json.twig index d4361c84a..87f4feac6 100644 --- a/app/src/Resources/skeleton/draw-package/composer.json.twig +++ b/app/src/Resources/skeleton/draw-package/composer.json.twig @@ -11,10 +11,10 @@ } ], "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, @@ -28,4 +28,4 @@ "dev-master": "0.11-dev" } } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json index 794385b48..34172523d 100644 --- a/composer.json +++ b/composer.json @@ -32,9 +32,9 @@ "jms/serializer-bundle": "^5.4.0", "knplabs/doctrine-behaviors": "*", "nesbot/carbon": "^2.0", - "php": ">=8.1", + "php": ">=8.2", "phpdocumentor/reflection-docblock": "^5.2", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "psr/http-message": "^1.0", "psr/log": "^3", "ramsey/uuid": "^4.2", diff --git a/composer.lock b/composer.lock index 000efd3ac..21288fc39 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1c85073d453ff2c2f4ff118ab6f28d1d", + "content-hash": "6d601d4191257809fe0b434c1ca6073f", "packages": [ { "name": "aws/aws-crt-php", @@ -3777,16 +3777,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", "shasum": "" }, "require": { @@ -3797,7 +3797,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -3829,9 +3829,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.2.0" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-09-15T16:40:33+00:00" }, { "name": "phar-io/manifest", @@ -4175,35 +4175,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.15", + "version": "11.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae" + "reference": "ebdffc9e09585dafa71b9bffcdb0a229d4704c45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", - "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ebdffc9e09585dafa71b9bffcdb0a229d4704c45", + "reference": "ebdffc9e09585dafa71b9bffcdb0a229d4704c45", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "nikic/php-parser": "^5.1.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.0", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.1", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^10.1" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -4212,7 +4212,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.1-dev" + "dev-main": "11.0.x-dev" } }, "autoload": { @@ -4241,7 +4241,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.6" }, "funding": [ { @@ -4249,32 +4249,32 @@ "type": "github" } ], - "time": "2024-06-29T08:25:15+00:00" + "time": "2024-08-22T04:37:56+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.1.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -4302,7 +4302,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" }, "funding": [ { @@ -4310,28 +4310,28 @@ "type": "github" } ], - "time": "2023-08-31T06:24:48+00:00" + "time": "2024-08-27T05:02:59+00:00" }, { "name": "phpunit/php-invoker", - "version": "4.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcntl": "*" @@ -4339,7 +4339,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -4365,7 +4365,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" }, "funding": [ { @@ -4373,32 +4374,32 @@ "type": "github" } ], - "time": "2023-02-03T06:56:09+00:00" + "time": "2024-07-03T05:07:44+00:00" }, { "name": "phpunit/php-text-template", - "version": "3.0.1", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -4425,7 +4426,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" }, "funding": [ { @@ -4433,32 +4434,32 @@ "type": "github" } ], - "time": "2023-08-31T14:07:24+00:00" + "time": "2024-07-03T05:08:43+00:00" }, { "name": "phpunit/php-timer", - "version": "6.0.0", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -4484,7 +4485,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" }, "funding": [ { @@ -4492,20 +4494,20 @@ "type": "github" } ], - "time": "2023-02-03T06:57:52+00:00" + "time": "2024-07-03T05:09:35+00:00" }, { "name": "phpunit/phpunit", - "version": "10.5.24", + "version": "11.3.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015" + "reference": "d62c45a19c665bb872c2a47023a0baf41a98bb2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f124e3e3e561006047b532fd0431bf5bb6b9015", - "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d62c45a19c665bb872c2a47023a0baf41a98bb2b", + "reference": "d62c45a19c665bb872c2a47023a0baf41a98bb2b", "shasum": "" }, "require": { @@ -4515,26 +4517,25 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=8.1", - "phpunit/php-code-coverage": "^10.1.5", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.1", - "sebastian/global-state": "^6.0.1", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.6", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.1", + "sebastian/comparator": "^6.1.0", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.0", + "sebastian/exporter": "^6.1.3", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.0", + "sebastian/version": "^5.0.1" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -4545,7 +4546,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.5-dev" + "dev-main": "11.3-dev" } }, "autoload": { @@ -4577,7 +4578,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.3.6" }, "funding": [ { @@ -4593,7 +4594,7 @@ "type": "tidelift" } ], - "time": "2024-06-20T13:09:54+00:00" + "time": "2024-09-19T10:54:28+00:00" }, { "name": "psr/cache", @@ -5762,28 +5763,28 @@ }, { "name": "sebastian/cli-parser", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -5807,7 +5808,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" }, "funding": [ { @@ -5815,32 +5816,32 @@ "type": "github" } ], - "time": "2024-03-02T07:12:49+00:00" + "time": "2024-07-03T04:41:36+00:00" }, { "name": "sebastian/code-unit", - "version": "2.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + "reference": "6bb7d09d6623567178cf54126afa9c2310114268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", + "reference": "6bb7d09d6623567178cf54126afa9c2310114268", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -5863,7 +5864,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" }, "funding": [ { @@ -5871,32 +5873,32 @@ "type": "github" } ], - "time": "2023-02-03T06:58:43+00:00" + "time": "2024-07-03T04:44:28+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "3.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -5918,7 +5920,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" }, "funding": [ { @@ -5926,36 +5929,36 @@ "type": "github" } ], - "time": "2023-02-03T06:59:15+00:00" + "time": "2024-07-03T04:45:54+00:00" }, { "name": "sebastian/comparator", - "version": "5.0.1", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa37b9e2ca618cb051d71b60120952ee8ca8b03d", + "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/diff": "^5.0", - "sebastian/exporter": "^5.0" + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -5995,7 +5998,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.1.0" }, "funding": [ { @@ -6003,33 +6006,33 @@ "type": "github" } ], - "time": "2023-08-14T13:18:12+00:00" + "time": "2024-09-11T15:42:56+00:00" }, { "name": "sebastian/complexity", - "version": "3.2.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68ff824baeae169ec9f2137158ee529584553799" + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", - "reference": "68ff824baeae169ec9f2137158ee529584553799", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -6053,7 +6056,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" }, "funding": [ { @@ -6061,33 +6064,33 @@ "type": "github" } ], - "time": "2023-12-21T08:37:17+00:00" + "time": "2024-07-03T04:49:50+00:00" }, { "name": "sebastian/diff", - "version": "5.1.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6120,7 +6123,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -6128,27 +6131,27 @@ "type": "github" } ], - "time": "2024-03-02T07:15:17+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "sebastian/environment", - "version": "6.1.0", + "version": "7.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", - "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-posix": "*" @@ -6156,7 +6159,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.1-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -6184,7 +6187,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" }, "funding": [ { @@ -6192,34 +6195,34 @@ "type": "github" } ], - "time": "2024-03-23T08:47:14+00:00" + "time": "2024-07-03T04:54:44+00:00" }, { "name": "sebastian/exporter", - "version": "5.1.2", + "version": "6.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -6262,7 +6265,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" }, "funding": [ { @@ -6270,35 +6273,35 @@ "type": "github" } ], - "time": "2024-03-02T07:17:12+00:00" + "time": "2024-07-03T04:56:19+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.2", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -6324,7 +6327,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" }, "funding": [ { @@ -6332,33 +6335,33 @@ "type": "github" } ], - "time": "2024-03-02T07:19:19+00:00" + "time": "2024-07-03T04:57:36+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -6382,7 +6385,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" }, "funding": [ { @@ -6390,34 +6393,34 @@ "type": "github" } ], - "time": "2023-12-21T08:38:20+00:00" + "time": "2024-07-03T04:58:38+00:00" }, { "name": "sebastian/object-enumerator", - "version": "5.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6439,7 +6442,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" }, "funding": [ { @@ -6447,32 +6451,32 @@ "type": "github" } ], - "time": "2023-02-03T07:08:32+00:00" + "time": "2024-07-03T05:00:13+00:00" }, { "name": "sebastian/object-reflector", - "version": "3.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -6494,7 +6498,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" }, "funding": [ { @@ -6502,32 +6507,32 @@ "type": "github" } ], - "time": "2023-02-03T07:06:18+00:00" + "time": "2024-07-03T05:01:32+00:00" }, { "name": "sebastian/recursion-context", - "version": "5.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6557,7 +6562,8 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" }, "funding": [ { @@ -6565,32 +6571,32 @@ "type": "github" } ], - "time": "2023-02-03T07:05:40+00:00" + "time": "2024-07-03T05:10:34+00:00" }, { "name": "sebastian/type", - "version": "4.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -6613,7 +6619,8 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" }, "funding": [ { @@ -6621,29 +6628,29 @@ "type": "github" } ], - "time": "2023-02-03T07:10:45+00:00" + "time": "2024-09-17T13:12:04+00:00" }, { "name": "sebastian/version", - "version": "4.0.1", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + "reference": "45c9debb7d039ce9b97de2f749c2cf5832a06ac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/45c9debb7d039ce9b97de2f749c2cf5832a06ac4", + "reference": "45c9debb7d039ce9b97de2f749c2cf5832a06ac4", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6666,7 +6673,8 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.1" }, "funding": [ { @@ -6674,7 +6682,7 @@ "type": "github" } ], - "time": "2023-02-07T11:34:05+00:00" + "time": "2024-07-03T05:13:08+00:00" }, { "name": "sensiolabs/ansi-to-html", @@ -15493,7 +15501,7 @@ "ext-mongodb": "*", "ext-simplexml": "*", "ext-zip": "*", - "php": ">=8.1" + "php": ">=8.2" }, "platform-dev": { "ext-pcntl": "*" diff --git a/doc/create-new-packages.md b/doc/create-new-packages.md index 9dff6432a..60d66d2f6 100644 --- a/doc/create-new-packages.md +++ b/doc/create-new-packages.md @@ -60,10 +60,10 @@ Add the package to the autoload section: } ], "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/monorepo-builder.php b/monorepo-builder.php index 103e6ad74..6f0a65ce2 100644 --- a/monorepo-builder.php +++ b/monorepo-builder.php @@ -25,7 +25,7 @@ 'doctrine/sql-formatter' => '^1.1', 'nelmio/cors-bundle' => '^2.0', 'pelago/emogrifier' => '^7.0', - 'phpunit/phpunit' => '^10.0', + 'phpunit/phpunit' => '^11.3', 'sonata-project/admin-bundle' => '^4.8', 'sonata-project/doctrine-orm-admin-bundle' => '^4.2', 'symfony/debug-bundle' => '^6.4.0', diff --git a/packages/application/composer.json b/packages/application/composer.json index ec176de9a..72acb3bd4 100644 --- a/packages/application/composer.json +++ b/packages/application/composer.json @@ -11,7 +11,7 @@ "versioning" ], "require": { - "php": ">=8.1", + "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", "doctrine/common": "^3.1", @@ -22,7 +22,7 @@ "symfony/event-dispatcher": "^6.4.0" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", "symfony/cache": "^6.4.0", diff --git a/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php b/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php index 58b45397c..f29756369 100644 --- a/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php +++ b/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php @@ -28,9 +28,7 @@ protected function setUp(): void ->getMockBuilder(CloudWatchLogsClient::class) ->disableOriginalConstructor() ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->addMethods(['getLogEvents']) + ->onlyMethods(['__call']) ->getMock(); $this->command = new CloudWatchLogsDownloadCommand($this->cloudWatchLogsClient); @@ -88,21 +86,29 @@ public function testExecuteNewFile(): void file_put_contents($output, "Before\n"); register_shutdown_function('unlink', $output); - $logEvents = [ - 'startFromHead' => true, - 'logGroupName' => $logGroupName, - 'logStreamName' => $logStreamName, - 'startTime' => $startTime->getTimestamp() * 1000, - 'endTime' => $endTime->getTimestamp() * 1000, - ]; - $this->cloudWatchLogsClient ->expects(static::exactly(2)) - ->method('getLogEvents') + ->method('__call') ->with( ...static::withConsecutive( - [$logEvents], - [$logEvents + ['nextToken' => 'next-token']] + [ + 'getLogEvents', + [ + $logEvents = [ + 'startFromHead' => true, + 'logGroupName' => $logGroupName, + 'logStreamName' => $logStreamName, + 'startTime' => $startTime->getTimestamp() * 1000, + 'endTime' => $endTime->getTimestamp() * 1000, + ], + ], + ], + [ + 'getLogEvents', + [ + $logEvents + ['nextToken' => 'next-token'], + ], + ], ) ) ->willReturnOnConsecutiveCalls( @@ -147,14 +153,17 @@ public function testExecuteAppendFile(): void $this->cloudWatchLogsClient ->expects(static::once()) - ->method('getLogEvents') + ->method('__call') ->with( + 'getLogEvents', [ - 'startFromHead' => true, - 'logGroupName' => $logGroupName, - 'logStreamName' => $logStreamName, - 'startTime' => $startTime->getTimestamp() * 1000, - 'endTime' => $endTime->getTimestamp() * 1000, + [ + 'startFromHead' => true, + 'logGroupName' => $logGroupName, + 'logStreamName' => $logStreamName, + 'startTime' => $startTime->getTimestamp() * 1000, + 'endTime' => $endTime->getTimestamp() * 1000, + ], ] ) ->willReturn( diff --git a/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php b/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php index d3b19b2fe..4ff69a3e5 100644 --- a/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php +++ b/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php @@ -247,7 +247,7 @@ private function mockEc2ClientDescribeInstances( ): void { $ec2Client = $this->getMockBuilder(Ec2Client::class) ->disableOriginalConstructor() - ->addMethods(['describeInstances']) + ->onlyMethods(['__call']) ->getMock(); ReflectionAccessor::setPropertyValue( @@ -258,18 +258,21 @@ private function mockEc2ClientDescribeInstances( $invocationMocker = $ec2Client ->expects(static::once()) - ->method('describeInstances') + ->method('__call') ->with( + 'describeInstances', [ - 'DryRun' => false, - 'Filters' => [ - [ - 'Name' => 'tag:Name', - 'Values' => [$role], - ], - [ - 'Name' => 'instance-state-name', - 'Values' => ['running'], + [ + 'DryRun' => false, + 'Filters' => [ + [ + 'Name' => 'tag:Name', + 'Values' => [$role], + ], + [ + 'Name' => 'instance-state-name', + 'Values' => ['running'], + ], ], ], ] @@ -279,13 +282,15 @@ private function mockEc2ClientDescribeInstances( $invocationMocker->willThrowException($error); } else { $invocationMocker - ->willReturn([ - 'Reservations' => [ - [ - 'Instances' => $instances, + ->willReturn( + [ + 'Reservations' => [ + [ + 'Instances' => $instances, + ], ], - ], - ]); + ] + ); } } diff --git a/packages/aws-tool-kit/composer.json b/packages/aws-tool-kit/composer.json index 5e4bab31f..3e0354e81 100644 --- a/packages/aws-tool-kit/composer.json +++ b/packages/aws-tool-kit/composer.json @@ -16,7 +16,7 @@ "draw/core": "^0.11", "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/cache": "^6.4.0", "symfony/http-client": "^6.4.0", "symfony/http-client-contracts": "^3.4" diff --git a/packages/console/composer.json b/packages/console/composer.json index ffb960fb1..faa819373 100644 --- a/packages/console/composer.json +++ b/packages/console/composer.json @@ -20,7 +20,7 @@ "doctrine/orm": "^2.11", "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/cache": "^6.4.0" }, "minimum-stability": "dev", diff --git a/packages/core/Tests/DateTimeUtilsTest.php b/packages/core/Tests/DateTimeUtilsTest.php index 1997804a3..1812f3c76 100644 --- a/packages/core/Tests/DateTimeUtilsTest.php +++ b/packages/core/Tests/DateTimeUtilsTest.php @@ -3,6 +3,7 @@ namespace Draw\Component\Core\Tests; use Draw\Component\Core\DateTimeUtils; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DateTimeUtilsTest extends TestCase @@ -48,9 +49,7 @@ public static function provideTestIsSameTimestamp(): array ]; } - /** - * @dataProvider provideTestIsSameTimestamp - */ + #[DataProvider('provideTestIsSameTimestamp')] public function testIsSameTimestamp( ?\DateTimeInterface $dateTime1, ?\DateTimeInterface $dateTime2, @@ -71,9 +70,7 @@ public static function provideTestToDateTimeX(): array ]; } - /** - * @dataProvider provideTestToDateTimeX - */ + #[DataProvider('provideTestToDateTimeX')] public function testToDateTimeImmutable(?\DateTimeInterface $dateTimeInterface): void { $dateTimeImmutable = DateTimeUtils::toDateTimeImmutable($dateTimeInterface); @@ -88,9 +85,7 @@ public function testToDateTimeImmutable(?\DateTimeInterface $dateTimeInterface): static::assertNotSame($dateTimeInterface, $dateTimeImmutable); } - /** - * @dataProvider provideTestToDateTimeX - */ + #[DataProvider('provideTestToDateTimeX')] public function testToDateTime(?\DateTimeInterface $dateTimeInterface): void { $dateTime = DateTimeUtils::toDateTime($dateTimeInterface); @@ -115,9 +110,7 @@ public static function provideTestMillisecondDiff(): array ]; } - /** - * @dataProvider provideTestMillisecondDiff - */ + #[DataProvider('provideTestMillisecondDiff')] public function testMillisecondDiff(string $delay, ?string $compareToDelay, int $expected): void { static::assertSame( diff --git a/packages/core/Tests/FilterExpression/EvaluatorTest.php b/packages/core/Tests/FilterExpression/EvaluatorTest.php index 178b73abc..b2f74671b 100644 --- a/packages/core/Tests/FilterExpression/EvaluatorTest.php +++ b/packages/core/Tests/FilterExpression/EvaluatorTest.php @@ -5,6 +5,7 @@ use Draw\Component\Core\FilterExpression\Evaluator; use Draw\Component\Core\FilterExpression\Expression\ConstraintExpression; use Draw\Component\Core\FilterExpression\Query; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\EqualTo; @@ -69,9 +70,7 @@ public static function provideExecute(): iterable ]; } - /** - * @dataProvider provideExecute - */ + #[DataProvider('provideExecute')] public function testExecute(Query $query, int $expectedCount): void { static::assertCount( diff --git a/packages/core/composer.json b/packages/core/composer.json index f06c9e825..34739677c 100644 --- a/packages/core/composer.json +++ b/packages/core/composer.json @@ -4,13 +4,13 @@ "license": "MIT", "type": "library", "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/dependency-injection": "^6.4.0", "symfony/property-access": "^6.4.0", "symfony/validator": "^6.4.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/cron-job/composer.json b/packages/cron-job/composer.json index fb02dd87f..401f6a1ad 100644 --- a/packages/cron-job/composer.json +++ b/packages/cron-job/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "doctrine/orm": "^2.11", "dragonmantank/cron-expression": "^3.3", "draw/core": "^0.11", @@ -29,7 +29,7 @@ "symfony/messenger": "^6.4.0" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", "nesbot/carbon": "^2.0" diff --git a/packages/dependency-injection/Integration/Test/IntegrationTestCase.php b/packages/dependency-injection/Integration/Test/IntegrationTestCase.php index 1bd1080b1..1f7ad2c53 100644 --- a/packages/dependency-injection/Integration/Test/IntegrationTestCase.php +++ b/packages/dependency-injection/Integration/Test/IntegrationTestCase.php @@ -4,6 +4,7 @@ use Draw\Component\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -64,9 +65,7 @@ public function testDefaultConfiguration(): void ); } - /** - * @dataProvider provideTestLoad - */ + #[DataProvider('provideTestLoad')] public function testLoad( array $configuration = [], array $services = [], diff --git a/packages/dependency-injection/composer.json b/packages/dependency-injection/composer.json index a1d99a7f0..4bd717f96 100644 --- a/packages/dependency-injection/composer.json +++ b/packages/dependency-injection/composer.json @@ -15,12 +15,12 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/config": "^6.4.0", "symfony/dependency-injection": "^6.4.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/doctrine-extra/composer.json b/packages/doctrine-extra/composer.json index 0f474ca28..70f536b0a 100644 --- a/packages/doctrine-extra/composer.json +++ b/packages/doctrine-extra/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { "doctrine/orm": "^2.11", @@ -23,7 +23,7 @@ "doctrine/collections": "^1.0", "doctrine/data-fixtures": "^1.5", "draw/dependency-injection": "^0.11", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/entity-migrator/composer.json b/packages/entity-migrator/composer.json index 488a04465..c694e41f6 100644 --- a/packages/entity-migrator/composer.json +++ b/packages/entity-migrator/composer.json @@ -24,7 +24,7 @@ }, "require-dev": { "draw/tester": "^0.11", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php b/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php index 01e719aae..604c7f320 100644 --- a/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php +++ b/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php @@ -4,6 +4,7 @@ use Draw\Fixer\ClassNotation\ClassPrivateStaticCallFixer; use PhpCsFixer\Tokenizer\Tokens; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ClassPrivateStaticCallFixerTest extends TestCase @@ -26,9 +27,7 @@ public static function provideTestFix(): iterable } } - /** - * @dataProvider provideTestFix - */ + #[DataProvider('provideTestFix')] public function testFix(string $inCode, string $outCode): void { $tokens = Tokens::fromCode($inCode); diff --git a/packages/fixer/Tests/ClassStaticCallFixerTest.php b/packages/fixer/Tests/ClassStaticCallFixerTest.php index 7be3667a0..a5b32aad1 100644 --- a/packages/fixer/Tests/ClassStaticCallFixerTest.php +++ b/packages/fixer/Tests/ClassStaticCallFixerTest.php @@ -4,6 +4,7 @@ use Draw\Fixer\ClassNotation\ClassStaticCallFixer; use PhpCsFixer\Tokenizer\Tokens; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ClassStaticCallFixerTest extends TestCase @@ -26,9 +27,7 @@ public static function provideTestFix(): iterable } } - /** - * @dataProvider provideTestFix - */ + #[DataProvider('provideTestFix')] public function testFix(string $inCode, string $outCode): void { $tokens = Tokens::fromCode($inCode); diff --git a/packages/fixer/composer.json b/packages/fixer/composer.json index 7246ba25c..d659659c8 100644 --- a/packages/fixer/composer.json +++ b/packages/fixer/composer.json @@ -14,11 +14,11 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "friendsofphp/php-cs-fixer": "^3.13" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/framework-extra-bundle/composer.json b/packages/framework-extra-bundle/composer.json index ecd1904e3..263237c1e 100644 --- a/packages/framework-extra-bundle/composer.json +++ b/packages/framework-extra-bundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "ext-json": "*", "draw/core": "^0.11", "draw/dependency-injection": "^0.11", @@ -46,7 +46,7 @@ "draw/workflow": "^0.11", "monolog/monolog": "^3.5.0", "pelago/emogrifier": "^7.0", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "psr/log": "^3", "symfony/event-dispatcher": "^6.4.0", "symfony/http-foundation": "^6.4.0", diff --git a/packages/log/Tests/Symfony/Processor/RequestHeadersProcessorTest.php b/packages/log/Tests/Symfony/Processor/RequestHeadersProcessorTest.php index f993d861e..bd39a3320 100644 --- a/packages/log/Tests/Symfony/Processor/RequestHeadersProcessorTest.php +++ b/packages/log/Tests/Symfony/Processor/RequestHeadersProcessorTest.php @@ -5,6 +5,7 @@ use Draw\Component\Log\Symfony\Processor\RequestHeadersProcessor; use Monolog\Level; use Monolog\LogRecord; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; @@ -66,9 +67,7 @@ public static function provideTestInvoke(): iterable ]; } - /** - * @dataProvider provideTestInvoke - */ + #[DataProvider('provideTestInvoke')] public function testInvoke( ?array $requestHeaders, array $onlyHeaders, diff --git a/packages/log/composer.json b/packages/log/composer.json index 63ae5e9b6..86636ec30 100644 --- a/packages/log/composer.json +++ b/packages/log/composer.json @@ -15,14 +15,14 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^3" }, "require-dev": { "draw/dependency-injection": "^0.11", "draw/user-bundle": "^0.11", "monolog/monolog": "^3.5.0", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/event-dispatcher": "^6.4.0", "symfony/http-foundation": "^6.4.0", "symfony/http-kernel": "^6.4.0", diff --git a/packages/mailer/Tests/EmailComposerTest.php b/packages/mailer/Tests/EmailComposerTest.php index 93af4bd5c..675c1322d 100644 --- a/packages/mailer/Tests/EmailComposerTest.php +++ b/packages/mailer/Tests/EmailComposerTest.php @@ -5,6 +5,7 @@ use Draw\Component\Mailer\Email\LocalizeEmailInterface; use Draw\Component\Mailer\EmailComposer; use Draw\Component\Mailer\EmailWriter\EmailWriterInterface; +use Draw\Component\Mailer\Tests\Stub\EmailWriter\EmailWriterStub; use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; @@ -85,7 +86,7 @@ public function testComposeMessage(): void ) ) ->willReturn( - $emailWriter = $this->createMockWithExtraMethods(EmailWriterInterface::class, ['method1', 'method2']) + $emailWriter = $this->createMock(EmailWriterStub::class) ); $emailWriter diff --git a/packages/mailer/Tests/Stub/EmailWriter/EmailWriterStub.php b/packages/mailer/Tests/Stub/EmailWriter/EmailWriterStub.php new file mode 100644 index 000000000..9825fc3a8 --- /dev/null +++ b/packages/mailer/Tests/Stub/EmailWriter/EmailWriterStub.php @@ -0,0 +1,26 @@ +=8.1", + "php": ">=8.2", "draw/core": "^0.11", "symfony/dom-crawler": "^6.4.0", "symfony/css-selector": "^6.4.0", @@ -23,7 +23,7 @@ "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", "pelago/emogrifier": "^7.0", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php b/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php index 2c50e60db..79c33e203 100644 --- a/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php +++ b/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php @@ -10,6 +10,7 @@ use Draw\Component\Tester\Application\CommandTestTrait; use Draw\Contracts\Process\ProcessFactoryInterface; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Exception\InvalidOptionException; @@ -218,9 +219,7 @@ function (BrokerStartedEvent $event) use ($concurrent, $timeout, $context): void ); } - /** - * @dataProvider provideDataForTestExecuteWithAutoConcurrent - */ + #[DataProvider('provideDataForTestExecuteWithAutoConcurrent')] public function testExecuteWithAutoConcurrent( int $numCpus, float $processesPerCore, diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php index 640259c85..3f545c5fd 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php @@ -12,6 +12,7 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\DoctrineBusMessageListener; use Draw\Component\Messenger\DoctrineMessageBusHook\Message\LifeCycleAwareMessageInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\Model\MessageHolderInterface; +use Draw\Component\Messenger\Tests\Stub\Message\PreSendAwareMessageInterface; use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; @@ -221,8 +222,8 @@ public function testPostFlushWithOneMessage(): void ->willReturn( $messages = [ $message1 = $this->createMock(LifeCycleAwareMessageInterface::class), - // Arbitrary interface just to add preSen method without implementing LifeCycleAwareMessageInterface - $message2 = $this->createMockWithExtraMethods(MessageHolderInterface::class, ['preSend']), + // Arbitrary interface just to add preSend method without implementing LifeCycleAwareMessageInterface + $message2 = $this->createMock(PreSendAwareMessageInterface::class), ] ); diff --git a/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php b/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php index 95999ef25..f9fcd6ce9 100644 --- a/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php +++ b/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php @@ -5,6 +5,7 @@ use Draw\Component\Messenger\Expirable\Command\PurgeExpiredMessageCommand; use Draw\Component\Messenger\Expirable\PurgeableTransportInterface; use Draw\Component\Messenger\Searchable\TransportRepository; +use Draw\Component\Messenger\Tests\Stub\Transport\PurgeAwareTransportInterface; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; use Draw\Component\Tester\MockTrait; @@ -13,7 +14,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Messenger\Transport\TransportInterface; #[CoversClass(PurgeExpiredMessageCommand::class)] class PurgeExpiredMessageCommandTest extends TestCase @@ -85,10 +85,7 @@ public function testExecute(): void ) ->willReturnOnConsecutiveCalls( $transport1 = $this->createMock(PurgeableTransportInterface::class), - $transport2 = $this->createMockWithExtraMethods( - TransportInterface::class, - ['purgeObsoleteMessages'] - ) + $transport2 = $this->createMock(PurgeAwareTransportInterface::class) ); $transport1 diff --git a/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php b/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php index eaa378a85..1e59ed9ad 100644 --- a/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php +++ b/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php @@ -10,6 +10,7 @@ use Draw\Component\Messenger\Searchable\TransportRepository; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -92,9 +93,7 @@ public static function provideTestClickEnvelopeError(): iterable ]; } - /** - * @dataProvider provideTestClickEnvelopeError - */ + #[DataProvider('provideTestClickEnvelopeError')] public function testClickEnvelopeError( ?Envelope $returnedEnveloped, string $exceptionClass, diff --git a/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php b/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php index 464b13f63..dde99e2ee 100644 --- a/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php +++ b/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php @@ -5,6 +5,7 @@ use Draw\Component\Messenger\Searchable\EnvelopeFinder; use Draw\Component\Messenger\Searchable\Stamp\FoundFromTransportStamp; use Draw\Component\Messenger\Searchable\TransportRepository; +use Draw\Component\Messenger\Tests\Stub\Transport\FindAwareTransportInterface; use Draw\Component\Tester\MockTrait; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; use PHPUnit\Framework\Attributes\CoversClass; @@ -12,7 +13,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface; -use Symfony\Component\Messenger\Transport\TransportInterface; #[CoversClass(EnvelopeFinder::class)] class EnvelopeFinderTest extends TestCase @@ -60,7 +60,7 @@ public function testFindByIdNotListableReceiver(): void ->method('findAll') ->willReturn( [ - $transport = $this->createMockWithExtraMethods(TransportInterface::class, ['find']), + $transport = $this->createMock(FindAwareTransportInterface::class), $transport, ] ); diff --git a/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php b/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php index eba4d1b92..489ec15fc 100644 --- a/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php +++ b/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php @@ -6,6 +6,7 @@ use Draw\Component\Messenger\SerializerEventDispatcher\Event\PostDecodeEvent; use Draw\Component\Messenger\SerializerEventDispatcher\Event\PostEncodeEvent; use Draw\Component\Messenger\SerializerEventDispatcher\Event\PreEncodeEvent; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; @@ -18,9 +19,7 @@ public static function provideTestConstruct(): iterable yield [PreEncodeEvent::class]; } - /** - * @dataProvider provideTestConstruct - */ + #[DataProvider('provideTestConstruct')] public function testConstruct(string $class): void { $object = new $class($envelope = new Envelope((object) [])); diff --git a/packages/messenger/Tests/Stub/Message/PreSendAwareMessageInterface.php b/packages/messenger/Tests/Stub/Message/PreSendAwareMessageInterface.php new file mode 100644 index 000000000..29f56a889 --- /dev/null +++ b/packages/messenger/Tests/Stub/Message/PreSendAwareMessageInterface.php @@ -0,0 +1,12 @@ +=8.1", + "php": ">=8.2", "ext-json": "*", "doctrine/dbal": "^3.3", "doctrine/persistence": "^2.2 || ^3.0", @@ -39,7 +39,7 @@ "doctrine/orm": "^2.11", "draw/dependency-injection": "^0.11", "draw/tester": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "psr/log": "^3" }, "suggest": { diff --git a/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php b/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php index cc5adfb24..dab0f551f 100644 --- a/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php +++ b/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php @@ -6,6 +6,7 @@ use Draw\Component\OpenApi\Extraction\ExtractionContext; use Draw\Component\OpenApi\OpenApi; use Draw\Component\OpenApi\Schema\Root; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; abstract class BaseCleanerTestCase extends TestCase @@ -21,9 +22,7 @@ public static function provideTestClean(): iterable } } - /** - * @dataProvider provideTestClean - */ + #[DataProvider('provideTestClean')] public function testClean(string $dirty, string $clean): void { $openApi = new OpenApi(); diff --git a/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php index 3394d3505..a8208cd40 100644 --- a/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php @@ -9,6 +9,7 @@ use Draw\Component\OpenApi\Extraction\Extractor\TypeSchemaExtractor; use Draw\Component\OpenApi\OpenApi; use Draw\Component\OpenApi\Schema\Schema; +use Draw\Component\Tester\MockTrait; use JMS\Serializer\Annotation as Serializer; use JMS\Serializer\Naming\CamelCaseNamingStrategy; use JMS\Serializer\Naming\SerializedNameAnnotationStrategy; @@ -22,6 +23,8 @@ #[CoversClass(PropertiesExtractor::class)] class PropertiesExtractorTest extends TestCase { + use MockTrait; + private PropertiesExtractor $jmsExtractor; public static function provideTestCanExtract(): iterable @@ -54,10 +57,14 @@ public function testCanExtract(mixed $source, mixed $type, bool $canBeExtract): $source = new \ReflectionClass($source); } - /** @var ExtractionContextInterface $context */ - $context = $this->getMockForAbstractClass(ExtractionContextInterface::class); - - static::assertSame($canBeExtract, $this->jmsExtractor->canExtract($source, $type, $context)); + static::assertSame( + $canBeExtract, + $this->jmsExtractor->canExtract( + $source, + $type, + $context = $this->createMock(ExtractionContextInterface::class) + ) + ); if (!$canBeExtract) { try { diff --git a/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php index 29952aeb8..ccea80585 100644 --- a/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php @@ -6,11 +6,15 @@ use Draw\Component\OpenApi\Extraction\ExtractionContextInterface; use Draw\Component\OpenApi\Extraction\Extractor\OpenApi\JsonRootSchemaExtractor; use Draw\Component\OpenApi\Schema\Root; +use Draw\Component\Tester\MockTrait; use JMS\Serializer\SerializerBuilder; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class RootSchemaExtractorTest extends TestCase { + use MockTrait; + public static function provideTestCanExtract(): array { return [ @@ -23,17 +27,19 @@ public static function provideTestCanExtract(): array ]; } - /** - * @dataProvider provideTestCanExtract - */ + #[DataProvider('provideTestCanExtract')] public function testCanExtract(mixed $source, mixed $type, bool $expected): void { $extractor = new JsonRootSchemaExtractor(SerializerBuilder::create()->build()); - /** @var ExtractionContextInterface $context */ - $context = $this->getMockForAbstractClass(ExtractionContextInterface::class); - - static::assertSame($expected, $extractor->canExtract($source, $type, $context)); + static::assertSame( + $expected, + $extractor->canExtract( + $source, + $type, + $context = $this->createMock(ExtractionContextInterface::class) + ) + ); if ($expected) { $extractor->extract($source, $type, $context); diff --git a/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php index 5986cfc13..564a83371 100644 --- a/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php @@ -11,10 +11,14 @@ use Draw\Component\OpenApi\Schema\Operation; use Draw\Component\OpenApi\Schema\PathItem; use Draw\Component\OpenApi\Schema\QueryParameter; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class OperationExtractorTest extends TestCase { + use MockTrait; + private OperationExtractor $phpDocOperationExtractor; protected function setUp(): void @@ -34,15 +38,17 @@ public static function provideTestCanExtract(): iterable ]; } - /** - * @dataProvider provideTestCanExtract - */ + #[DataProvider('provideTestCanExtract')] public function testCanExtract(mixed $source, mixed $type, bool $canBeExtract): void { - /** @var ExtractionContextInterface $context */ - $context = $this->getMockForAbstractClass(ExtractionContextInterface::class); - - static::assertSame($canBeExtract, $this->phpDocOperationExtractor->canExtract($source, $type, $context)); + static::assertSame( + $canBeExtract, + $this->phpDocOperationExtractor->canExtract( + $source, + $type, + $context = $this->createMock(ExtractionContextInterface::class) + ) + ); if ($canBeExtract) { return; diff --git a/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php index 06cb596a7..4e37a65ba 100644 --- a/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php @@ -9,6 +9,7 @@ use Draw\Component\OpenApi\OpenApi; use Draw\Component\OpenApi\Schema\Root; use Draw\Component\OpenApi\Schema\Schema; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class TypeSchemaExtractorTest extends TestCase @@ -53,9 +54,7 @@ public static function provideTestCanExtract(): iterable ]; } - /** - * @dataProvider provideTestCanExtract - */ + #[DataProvider('provideTestCanExtract')] public function testCanExtract(mixed $source, mixed $type, bool $canBeExtract): void { $context = $this->createMock(ExtractionContextInterface::class); diff --git a/packages/open-api/composer.json b/packages/open-api/composer.json index e8fb2aa4a..48e63a1e5 100644 --- a/packages/open-api/composer.json +++ b/packages/open-api/composer.json @@ -4,7 +4,7 @@ "license": "MIT", "type": "library", "require": { - "php": ">=8.1", + "php": ">=8.2", "ext-json": "*", "jms/serializer": "^3.11", "phpdocumentor/reflection-docblock": "^5.2", @@ -20,7 +20,7 @@ "doctrine/common": "^3.1", "doctrine/doctrine-bundle": "^2.5", "doctrine/orm": "^2.11", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "conflict": { "draw/swagger": "*" diff --git a/packages/process/composer.json b/packages/process/composer.json index afc7a4235..cd756b191 100644 --- a/packages/process/composer.json +++ b/packages/process/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "draw/dependency-injection": "^0.11", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php b/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php index 87509b79c..7dacdfab8 100644 --- a/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php +++ b/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php @@ -5,6 +5,7 @@ use Draw\Component\Profiling\Sql\SqlAssertionBuilder; use Draw\Component\Profiling\Sql\SqlMetric; use Draw\Component\Tester\DataTester; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; @@ -25,9 +26,7 @@ public static function provideTestAssertCountEquals(): iterable yield [0, new DataTester((object) ['sql' => new SqlMetric(['query'])]), true]; } - /** - * @dataProvider provideTestAssertCountEquals - */ + #[DataProvider('provideTestAssertCountEquals')] public function testProvideAssertCountEquals(int $expectedCount, DataTester $dataTester, bool $shouldFail): void { $this->assertionBuilder->assertCountEquals($expectedCount); @@ -42,9 +41,7 @@ public static function provideTestAssertCountGreaterThanOrEqual(): \Generator yield [1, new DataTester((object) ['sql' => new SqlMetric([])]), true]; } - /** - * @dataProvider provideTestAssertCountGreaterThanOrEqual - */ + #[DataProvider('provideTestAssertCountGreaterThanOrEqual')] public function testAssertCountGreaterThanOrEqual(int $expectedCount, DataTester $dataTester, bool $shouldFail): void { $this->assertionBuilder->assertCountGreaterThanOrEqual($expectedCount); @@ -59,9 +56,7 @@ public static function provideTestAssertCountLessThanOrEqual(): \Generator yield [0, new DataTester((object) ['sql' => new SqlMetric(['query'])]), true]; } - /** - * @dataProvider provideTestAssertCountLessThanOrEqual - */ + #[DataProvider('provideTestAssertCountLessThanOrEqual')] public function testAssertCountLessThanOrEqual(int $expectedCount, DataTester $dataTester, bool $shouldFail): void { $this->assertionBuilder->assertCountLessThanOrEqual($expectedCount); diff --git a/packages/profiling/Tests/Sql/SqlProfilerTest.php b/packages/profiling/Tests/Sql/SqlProfilerTest.php index b699df6ff..2b8675376 100644 --- a/packages/profiling/Tests/Sql/SqlProfilerTest.php +++ b/packages/profiling/Tests/Sql/SqlProfilerTest.php @@ -5,17 +5,22 @@ use Draw\Component\Profiling\Sql\SqlMetric; use Draw\Component\Profiling\Sql\SqlMetricBuilder; use Draw\Component\Profiling\Sql\SqlProfiler; +use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class SqlProfilerTest extends TestCase { + use MockTrait; + private SqlProfiler&MockObject $profiler; protected function setUp(): void { - $mock = $this->getMockForAbstractClass(SqlProfiler::class); - $this->profiler = $mock; + $this->profiler = $this->createMock(SqlProfiler::class); + $this->profiler + ->method('getType') + ->willReturn(SqlProfiler::PROFILER_TYPE); } public function testGetType(): void @@ -25,10 +30,7 @@ public function testGetType(): void public function testGetMetricBuilder(): void { - $metricBuilder = $this->profiler->getMetricBuilder(); - - static::assertInstanceOf(SqlMetricBuilder::class, $metricBuilder); - static::assertSame($metricBuilder, $this->profiler->getMetricBuilder()); + static::assertInstanceOf(SqlMetricBuilder::class, $this->profiler->getMetricBuilder()); } public function testStop(): void diff --git a/packages/profiling/composer.json b/packages/profiling/composer.json index 7e3649b31..cbb7ffb66 100644 --- a/packages/profiling/composer.json +++ b/packages/profiling/composer.json @@ -17,7 +17,7 @@ ], "require-dev": { "draw/tester": "^0.11", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php b/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php index 44ae1e854..047ab5fb8 100644 --- a/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php +++ b/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php @@ -6,6 +6,7 @@ use Draw\Component\Security\Http\Authenticator\JwtAuthenticator; use Draw\Component\Security\Http\Authenticator\Passport\Badge\JwtPayloadBadge; use Draw\Component\Security\Jwt\JwtEncoder; +use Draw\Component\Security\Tests\Stub\JwtAuthenticatableUserInterface; use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; @@ -39,10 +40,10 @@ class JwtAuthenticatorTest extends TestCase private string $userIdentifierPayloadKey; - private string $userIdentifierGetter; - private TranslatorInterface&MockObject $translator; + private static string $userIdentifierGetter = 'getJwtIdentifier'; + protected function setUp(): void { $this->userProvider = $this->createMock(UserProviderInterface::class); @@ -51,7 +52,7 @@ protected function setUp(): void $this->jwtEncoder = $this->createMock(JwtEncoder::class), $this->userProvider, $this->userIdentifierPayloadKey = uniqid('key'), - $this->userIdentifierGetter = uniqid('get'), + self::$userIdentifierGetter, $this->translator = $this->createMock(TranslatorInterface::class) ); } @@ -92,14 +93,11 @@ public function testSupportsNoToken(): void public function testGenerateToken(): void { - $user = $this->createMockWithExtraMethods( - UserInterface::class, - [$this->userIdentifierGetter] - ); + $user = $this->createMock(JwtAuthenticatableUserInterface::class); $user ->expects(static::once()) - ->method($this->userIdentifierGetter) + ->method(self::$userIdentifierGetter) ->willReturn($userId = uniqid('id')); $this->jwtEncoder @@ -125,14 +123,11 @@ public function testGenerateTokenDefaultNull(): void null ); - $user = $this->createMockWithExtraMethods( - UserInterface::class, - [$this->userIdentifierGetter] - ); + $user = $this->createMock(JwtAuthenticatableUserInterface::class); $user ->expects(static::once()) - ->method($this->userIdentifierGetter) + ->method(self::$userIdentifierGetter) ->willReturn($userId = uniqid('id')); $this->jwtEncoder @@ -151,14 +146,11 @@ public function testGenerateTokenDefaultNull(): void public function testGenerateTokenWithExpiration(): void { - $user = $this->createMockWithExtraMethods( - UserInterface::class, - [$this->userIdentifierGetter] - ); + $user = $this->createMock(JwtAuthenticatableUserInterface::class); $user ->expects(static::once()) - ->method($this->userIdentifierGetter) + ->method(self::$userIdentifierGetter) ->willReturn($userId = uniqid('id')); $this->jwtEncoder @@ -180,14 +172,11 @@ public function testGenerateTokenWithExpiration(): void public function testGenerateTokenWithExtraPayload(): void { - $user = $this->createMockWithExtraMethods( - UserInterface::class, - [$this->userIdentifierGetter] - ); + $user = $this->createMock(JwtAuthenticatableUserInterface::class); $user ->expects(static::once()) - ->method($this->userIdentifierGetter) + ->method(self::$userIdentifierGetter) ->willReturn($userId = uniqid('id')); $extraPayload = [ diff --git a/packages/security/Tests/Stub/JwtAuthenticatableUserInterface.php b/packages/security/Tests/Stub/JwtAuthenticatableUserInterface.php new file mode 100644 index 000000000..77886218e --- /dev/null +++ b/packages/security/Tests/Stub/JwtAuthenticatableUserInterface.php @@ -0,0 +1,12 @@ +=8.1" + "php": ">=8.2" }, "require-dev": { "draw/core": "^0.11", @@ -24,7 +24,7 @@ "draw/messenger": "^0.11", "draw/tester": "^0.11", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/console": "^6.4.0", "symfony/messenger": "^6.4.0", "symfony/security-http": "^6.4.0", diff --git a/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php b/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php index 103594912..1eabeff3e 100644 --- a/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php +++ b/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php @@ -359,9 +359,7 @@ public function getUserIdentifier(): string ]; } - /** - * @dataProvider provideTestOnKernelResponseAddDialogNoInjection - */ + #[DataProvider('provideTestOnKernelResponseAddDialogNoInjection')] public function testOnKernelResponseAddDialogNoInjection( Response $response, ?UserInterface $user = null, diff --git a/packages/sonata-extra-bundle/composer.json b/packages/sonata-extra-bundle/composer.json index 3919b364e..b230b247d 100644 --- a/packages/sonata-extra-bundle/composer.json +++ b/packages/sonata-extra-bundle/composer.json @@ -8,7 +8,7 @@ "sonata" ], "require": { - "php": ">=8.1", + "php": ">=8.2", "draw/dependency-injection": "^0.11", "symfony/framework-bundle": "^6.4.0", "symfony/expression-language": "^6.4.0", @@ -18,7 +18,7 @@ "cweagans/composer-patches": "^1.7", "draw/tester": "^0.11", "draw/security": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "sonata-project/admin-bundle": "^4.8", "sonata-project/doctrine-orm-admin-bundle": "^4.2", "symfony/notifier": "^6.4.0" diff --git a/packages/sonata-import-bundle/Tests/Entity/ImportTest.php b/packages/sonata-import-bundle/Tests/Entity/ImportTest.php index 3641bfdc6..b8d4fb6af 100644 --- a/packages/sonata-import-bundle/Tests/Entity/ImportTest.php +++ b/packages/sonata-import-bundle/Tests/Entity/ImportTest.php @@ -9,6 +9,7 @@ use Doctrine\Persistence\ObjectManager; use Draw\Bundle\SonataImportBundle\Entity\Column; use Draw\Bundle\SonataImportBundle\Entity\Import; +use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\GroupSequenceProviderInterface; @@ -16,6 +17,8 @@ class ImportTest extends TestCase { + use MockTrait; + private Import $entity; protected function setUp(): void @@ -138,7 +141,7 @@ public function testUpdateTimeStamp(): void $this->entity->updateTimestamp( new LifecycleEventArgs( $this->entity, - $this->getMockForAbstractClass(ObjectManager::class) + $this->createMock(ObjectManager::class) ) ); @@ -148,7 +151,7 @@ public function testUpdateTimeStamp(): void $this->entity->updateTimestamp( new PreUpdateEventArgs( $this->entity, - $this->getMockForAbstractClass(EntityManagerInterface::class), + $this->createMock(EntityManagerInterface::class), $changeSet ) ); diff --git a/packages/sonata-import-bundle/composer.json b/packages/sonata-import-bundle/composer.json index 6e3ce5013..67ea1c2ba 100644 --- a/packages/sonata-import-bundle/composer.json +++ b/packages/sonata-import-bundle/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "draw/sonata-extra-bundle": "^0.11", "sonata-project/admin-bundle": "^4.8", "sonata-project/doctrine-orm-admin-bundle": "^4.2", @@ -26,7 +26,7 @@ "require-dev": { "draw/tester": "^0.11", "knplabs/doctrine-behaviors": "*", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.3" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/sonata-integration-bundle/composer.json b/packages/sonata-integration-bundle/composer.json index 1b447da4a..40b44f2c2 100644 --- a/packages/sonata-integration-bundle/composer.json +++ b/packages/sonata-integration-bundle/composer.json @@ -8,7 +8,7 @@ "sonata" ], "require": { - "php": ">=8.1", + "php": ">=8.2", "draw/framework-extra-bundle": "^0.11", "draw/sonata-extra-bundle": "^0.11", "symfony/framework-bundle": "^6.4.0", @@ -24,7 +24,7 @@ "draw/tester": "^0.11", "draw/user-bundle": "^0.11", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "scheb/2fa-bundle": "^6.0", "scheb/2fa-email": "^6.0", "endroid/qr-code": "^5.0", diff --git a/packages/tester-bundle/Tests/bootstrap.php b/packages/tester-bundle/Tests/bootstrap.php new file mode 100644 index 000000000..51add958d --- /dev/null +++ b/packages/tester-bundle/Tests/bootstrap.php @@ -0,0 +1,13 @@ + null); +restore_exception_handler(); +ErrorHandler::register(null); +set_error_handler($phpunitsHandler); diff --git a/packages/tester-bundle/Tests/fixtures/config/routing.yaml b/packages/tester-bundle/Tests/fixtures/config/routing.yaml index 2d9c7bab0..6a1919fd2 100644 --- a/packages/tester-bundle/Tests/fixtures/config/routing.yaml +++ b/packages/tester-bundle/Tests/fixtures/config/routing.yaml @@ -1,4 +1,4 @@ test: resource: '@DrawTesterBundle/Tests/Mock/Controller/TestController.php' - type: 'annotation' + type: 'attribute' format: 'json' diff --git a/packages/tester-bundle/composer.json b/packages/tester-bundle/composer.json index 55d190c07..b9101c0c9 100644 --- a/packages/tester-bundle/composer.json +++ b/packages/tester-bundle/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "draw/profiling": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/messenger": "^6.4.0", "symfony/yaml": "^6.4.0" }, diff --git a/packages/tester-bundle/phpunit.xml.dist b/packages/tester-bundle/phpunit.xml.dist index 08fb1e3fa..8517fc66a 100644 --- a/packages/tester-bundle/phpunit.xml.dist +++ b/packages/tester-bundle/phpunit.xml.dist @@ -11,7 +11,7 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - bootstrap="vendor/autoload.php" + bootstrap="Tests/bootstrap.php" > diff --git a/packages/tester/.phpstorm.meta.php b/packages/tester/.phpstorm.meta.php index 2cc45e81b..4d9d562f2 100644 --- a/packages/tester/.phpstorm.meta.php +++ b/packages/tester/.phpstorm.meta.php @@ -2,12 +2,7 @@ namespace PHPSTORM_META; -override( - \Draw\Component\Tester\MockTrait::createMockWithExtraMethods(), - map(["" => "@"]) -); - override( \Draw\Component\Tester\MockTrait::mockProperty(2), map([""=>"$2"]) -); \ No newline at end of file +); diff --git a/packages/tester/HttpTesterTrait.php b/packages/tester/HttpTesterTrait.php index ab956f056..d55126f0c 100644 --- a/packages/tester/HttpTesterTrait.php +++ b/packages/tester/HttpTesterTrait.php @@ -3,7 +3,11 @@ namespace Draw\Component\Tester; use Draw\Component\Tester\Http\ClientInterface; +use PHPUnit\Framework\Attributes\BeforeClass; +/** + * @deprecated + */ trait HttpTesterTrait { protected static ?ClientInterface $httpTesterClient = null; @@ -17,9 +21,7 @@ public function httpTester(): ClientInterface return static::$httpTesterClient; } - /** - * @beforeClass - */ + #[BeforeClass] public static function clearHttpTesterClient(): void { static::$httpTesterClient = null; diff --git a/packages/tester/MockTrait.php b/packages/tester/MockTrait.php index 9b37af0c5..05ec5f8df 100644 --- a/packages/tester/MockTrait.php +++ b/packages/tester/MockTrait.php @@ -14,25 +14,6 @@ abstract public function getMockBuilder(string $className): MockBuilder; abstract protected function createMock(string $originalClassName): MockObject; - /** - * @template T of object - * - * @phpstan-param class-string $originalClassName - * - * @return MockObject&T - */ - protected function createMockWithExtraMethods(string $originalClassName, array $methods): MockObject - { - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->onlyMethods(get_class_methods($originalClassName)) - ->addMethods($methods) - ->getMock(); - } - /** * @template T of object * diff --git a/packages/tester/Test/DependencyInjection/ConfigurationTestCase.php b/packages/tester/Test/DependencyInjection/ConfigurationTestCase.php index 0c001b3df..209810dd1 100644 --- a/packages/tester/Test/DependencyInjection/ConfigurationTestCase.php +++ b/packages/tester/Test/DependencyInjection/ConfigurationTestCase.php @@ -2,6 +2,7 @@ namespace Draw\Component\Tester\Test\DependencyInjection; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; @@ -22,9 +23,7 @@ protected function setUp(): void $this->configuration = $this->createConfiguration(); } - /** - * @dataProvider provideTestInvalidConfiguration - */ + #[DataProvider('provideTestInvalidConfiguration')] public function testInvalidConfiguration(array $configuration, string $expectedMessage): void { $this->expectException(InvalidConfigurationException::class); diff --git a/packages/tester/Test/DependencyInjection/ExtensionTestCase.php b/packages/tester/Test/DependencyInjection/ExtensionTestCase.php index bbb4e032a..9e1580922 100644 --- a/packages/tester/Test/DependencyInjection/ExtensionTestCase.php +++ b/packages/tester/Test/DependencyInjection/ExtensionTestCase.php @@ -2,6 +2,7 @@ namespace Draw\Component\Tester\Test\DependencyInjection; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; @@ -49,10 +50,9 @@ public static function setUpBeforeClass(): void } /** - * @dataProvider provideTestHasServiceDefinition - * * @param ?string $aliasOf If the id is a alias it's a alias of which service ? */ + #[DataProvider('provideTestHasServiceDefinition')] public function testServiceDefinition(?string $id, ?string $aliasOf = null): void { if (!$id) { diff --git a/packages/tester/Tests/DataTesterTest.php b/packages/tester/Tests/DataTesterTest.php index 8c180c45a..3620ac0bc 100644 --- a/packages/tester/Tests/DataTesterTest.php +++ b/packages/tester/Tests/DataTesterTest.php @@ -3,6 +3,7 @@ namespace Draw\Component\Tester\Tests; use Draw\Component\Tester\DataTester; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\Constraint\IsIdentical; use PHPUnit\Framework\TestCase; @@ -42,9 +43,7 @@ public function testPath(): void static::assertSame('value', $newTester->getData()); } - /** - * @depends testPath - */ + #[Depends('testPath')] public function testChain(): void { $data = new \stdClass(); @@ -83,10 +82,10 @@ function (DataTester $tester) use (&$hasBeenCalled): void { static::assertFalse($hasBeenCalled, 'The path is not readable the callable should not have been called.'); } - /** - * @depends testIfPathIsReadable - * @depends testPath - */ + #[ + Depends('testIfPathIsReadable'), + Depends('testPath'), + ] public function testEach(): void { $users = [ @@ -110,9 +109,7 @@ function (DataTester $tester) use (&$callbackCount): void { static::assertSame(\count($users), $callbackCount); } - /** - * @depends testPath - */ + #[Depends('testPath')] public function testTransform(): void { $tester = new DataTester('{"key":"value"}'); diff --git a/packages/tester/Tests/Http/ClientObserverTest.php b/packages/tester/Tests/Http/ClientObserverTest.php deleted file mode 100644 index 080c540ae..000000000 --- a/packages/tester/Tests/Http/ClientObserverTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getMockForAbstractClass(ClientObserver::class); - - $request = new Request('GET', '/test'); - - /* @var ClientObserver $clientObserver */ - static::assertSame( - $request, - $clientObserver->preSendRequest($request) - ); - } - - public function testPostSendRequest(): void - { - $clientObserver = $this->getMockForAbstractClass(ClientObserver::class); - - $response = new Response(200); - - /* @var ClientObserver $clientObserver */ - static::assertSame( - $response, - $clientObserver->postSendRequest(new Request('GET', '/test'), $response) - ); - } -} diff --git a/packages/tester/Tests/Http/ClientTest.php b/packages/tester/Tests/Http/ClientTest.php index 84955ff6e..10a242cc0 100644 --- a/packages/tester/Tests/Http/ClientTest.php +++ b/packages/tester/Tests/Http/ClientTest.php @@ -10,6 +10,7 @@ use Draw\Component\Tester\Http\TestResponse; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; @@ -45,9 +46,7 @@ public function testConstruct(): Client return $client; } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testGet(Client $client): void { $testResponse = $client->get( @@ -66,9 +65,7 @@ public function testGet(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testHead(Client $client): void { $testResponse = $client->head( @@ -87,9 +84,7 @@ public function testHead(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testPut(Client $client): void { $testResponse = $client->put( @@ -109,9 +104,7 @@ public function testPut(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testPost(Client $client): void { $testResponse = $client->post( @@ -131,9 +124,7 @@ public function testPost(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testDelete(Client $client): void { $testResponse = $client->delete( @@ -152,9 +143,7 @@ public function testDelete(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testOptions(Client $client): void { $testResponse = $client->options( @@ -173,9 +162,7 @@ public function testOptions(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testPatch(Client $client): void { $testResponse = $client->patch( @@ -195,9 +182,7 @@ public function testPatch(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testSend(Client $client): void { $request = new Request( @@ -220,9 +205,7 @@ public function testSend(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testCreateRequest(Client $client): void { $request = $client->createRequest( @@ -243,9 +226,7 @@ public function testCreateRequest(Client $client): void ); } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testRegisterObserver(Client $client): void { $mockClientObserver = $this->createMock(ClientObserverInterface::class); diff --git a/packages/tester/Tests/Http/Cookie/CookieClientObserverTest.php b/packages/tester/Tests/Http/Cookie/CookieClientObserverTest.php index 4b72b78b2..766c513a9 100644 --- a/packages/tester/Tests/Http/Cookie/CookieClientObserverTest.php +++ b/packages/tester/Tests/Http/Cookie/CookieClientObserverTest.php @@ -6,6 +6,7 @@ use Draw\Component\Tester\Http\Cookie\CookieClientObserver; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -21,9 +22,7 @@ public function testConstruct(): CookieClientObserver return $cookieClientObserver; } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testRequestNoCookie(CookieClientObserver $clientObserver): CookieClientObserver { $request = $clientObserver->preSendRequest(new Request('GET', 'http://locahhost/test')); @@ -35,9 +34,7 @@ public function testRequestNoCookie(CookieClientObserver $clientObserver): Cooki return $clientObserver; } - /** - * @depends testRequestNoCookie - */ + #[Depends('testRequestNoCookie')] public function testResponseWithCookie(CookieClientObserver $clientObserver): CookieClientObserver { $response = $clientObserver->postSendRequest( @@ -50,9 +47,7 @@ public function testResponseWithCookie(CookieClientObserver $clientObserver): Co return $clientObserver; } - /** - * @depends testResponseWithCookie - */ + #[Depends('testResponseWithCookie')] public function testRequestWithCookie(CookieClientObserver $clientObserver): CookieClientObserver { $request = $clientObserver->preSendRequest(new Request('GET', 'http://locahhost/test')); @@ -65,9 +60,7 @@ public function testRequestWithCookie(CookieClientObserver $clientObserver): Coo return $clientObserver; } - /** - * @depends testRequestWithCookie - */ + #[Depends('testRequestWithCookie')] public function testRemoveCookie(CookieClientObserver $clientObserver): CookieClientObserver { $response = $clientObserver->postSendRequest( @@ -80,9 +73,7 @@ public function testRemoveCookie(CookieClientObserver $clientObserver): CookieCl return $clientObserver; } - /** - * @depends testRemoveCookie - */ + #[Depends('testRemoveCookie')] public function testRequestCookieRemoved(CookieClientObserver $clientObserver): CookieClientObserver { return $this->testRequestNoCookie($clientObserver); diff --git a/packages/tester/Tests/Http/Cookie/CookieJarTest.php b/packages/tester/Tests/Http/Cookie/CookieJarTest.php index 445e74eeb..c8a2a5760 100644 --- a/packages/tester/Tests/Http/Cookie/CookieJarTest.php +++ b/packages/tester/Tests/Http/Cookie/CookieJarTest.php @@ -6,6 +6,7 @@ use Draw\Component\Tester\Http\Cookie\CookieJar; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class CookieJarTest extends TestCase @@ -239,11 +240,10 @@ public static function provideTestReturnsCookiesMatchingRequests(): array } /** - * @dataProvider provideTestReturnsCookiesMatchingRequests - * * @param string $url * @param string $cookies */ + #[DataProvider('provideTestReturnsCookiesMatchingRequests')] public function testReturnsCookiesMatchingRequests($url, $cookies): void { $bag = [ @@ -350,9 +350,7 @@ public static function provideTestCookiePathWithEmptyCookiePath(): array ]; } - /** - * @dataProvider provideTestCookiePathWithEmptyCookiePath - */ + #[DataProvider('provideTestCookiePathWithEmptyCookiePath')] public function testCookiePathWithEmptyCookiePath(string $uriPath, string $cookiePath): void { $response = new Response( diff --git a/packages/tester/Tests/Http/Cookie/CookieTest.php b/packages/tester/Tests/Http/Cookie/CookieTest.php index 09e7d8e89..fee8ce540 100644 --- a/packages/tester/Tests/Http/Cookie/CookieTest.php +++ b/packages/tester/Tests/Http/Cookie/CookieTest.php @@ -3,6 +3,7 @@ namespace Draw\Component\Tester\Tests\Http\Cookie; use Draw\Component\Tester\Http\Cookie\Cookie; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class CookieTest extends TestCase @@ -137,9 +138,7 @@ public static function pathMatchProvider(): array ]; } - /** - * @dataProvider pathMatchProvider - */ + #[DataProvider('pathMatchProvider')] public function testMatchesPath(string $cookiePath, string $requestPath, bool $isMatch): void { $cookie = new Cookie(); @@ -160,9 +159,7 @@ public static function cookieValidateProvider(): array ]; } - /** - * @dataProvider cookieValidateProvider - */ + #[DataProvider('cookieValidateProvider')] public function testValidatesCookies(string $name, string $value, string $domain, bool|string $result): void { $cookie = new Cookie([ @@ -359,9 +356,7 @@ public static function cookieParserDataProvider(): array ]; } - /** - * @dataProvider cookieParserDataProvider - */ + #[DataProvider('cookieParserDataProvider')] public function testParseCookie(string|array $cookie, array $parsed): void { foreach ((array) $cookie as $v) { diff --git a/packages/tester/Tests/Http/CurlRequestExecutionerTest.php b/packages/tester/Tests/Http/CurlRequestExecutionerTest.php index eccd2db61..f0ccf1782 100644 --- a/packages/tester/Tests/Http/CurlRequestExecutionerTest.php +++ b/packages/tester/Tests/Http/CurlRequestExecutionerTest.php @@ -5,6 +5,7 @@ use Draw\Component\Tester\Http\CurlRequestExecutioner; use Draw\Component\Tester\Http\RequestExecutionerInterface; use GuzzleHttp\Psr7\Request; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; @@ -19,9 +20,7 @@ public function testConstruct(): CurlRequestExecutioner return $curlRequestExecutioner; } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testExecuteRequest(CurlRequestExecutioner $curlRequestExecutioner): void { $request = new Request( diff --git a/packages/tester/Tests/Http/RequestFactoryTest.php b/packages/tester/Tests/Http/RequestFactoryTest.php index 7e04c97cd..27e4474b1 100644 --- a/packages/tester/Tests/Http/RequestFactoryTest.php +++ b/packages/tester/Tests/Http/RequestFactoryTest.php @@ -4,6 +4,7 @@ use Draw\Component\Tester\Http\RequestFactory; use Draw\Component\Tester\Http\RequestFactoryInterface; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; @@ -17,9 +18,7 @@ public function testConstruct(): RequestFactory return $requestFactory; } - /** - * @depends testConstruct - */ + #[Depends('testConstruct')] public function testCreateRequest(RequestFactory $requestFactory): void { $request = $requestFactory->createRequest( diff --git a/packages/tester/Tests/Http/TestResponseTest.php b/packages/tester/Tests/Http/TestResponseTest.php index 01def8179..b9f83b8c9 100644 --- a/packages/tester/Tests/Http/TestResponseTest.php +++ b/packages/tester/Tests/Http/TestResponseTest.php @@ -6,6 +6,7 @@ use Draw\Component\Tester\Http\TestResponse; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; @@ -69,9 +70,7 @@ public static function provideAssertSuccessful(): array ]; } - /** - * @dataProvider provideAssertSuccessful - */ + #[DataProvider('provideAssertSuccessful')] public function testAssertSuccessful(int $statusCode, bool $expectSuccess): void { $testResponse = $this->createTestResponse(new Response($statusCode)); @@ -159,9 +158,7 @@ public static function provideAssertRedirectStatusCode(): array ]; } - /** - * @dataProvider provideAssertRedirectStatusCode - */ + #[DataProvider('provideAssertRedirectStatusCode')] public function testAssertRedirectStatusCode(int $statusCode, bool $expectSuccess): void { $testResponse = $this->createTestResponse(new Response($statusCode)); @@ -216,10 +213,9 @@ public static function provideAssertHeader(): array } /** - * @dataProvider provideAssertHeader - * * @phpstan-param array $headers */ + #[DataProvider('provideAssertHeader')] public function testAssertHeader(string $headerName, mixed $value, array $headers, bool $expectedPass): void { $testResponse = $this->createTestResponse(new Response(200, $headers)); diff --git a/packages/tester/Tests/HttpTesterTraitTest.php b/packages/tester/Tests/HttpTesterTraitTest.php index f8d7cc388..705984d93 100644 --- a/packages/tester/Tests/HttpTesterTraitTest.php +++ b/packages/tester/Tests/HttpTesterTraitTest.php @@ -6,6 +6,7 @@ use Draw\Component\Tester\Http\ClientInterface; use Draw\Component\Tester\Http\CurlRequestExecutioner; use Draw\Component\Tester\HttpTesterTrait; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; class HttpTesterTraitTest extends TestCase @@ -31,9 +32,7 @@ public function testHttpTester(): void static::assertSame($client, $this->httpTester()); } - /** - * @depends testHttpTester - */ + #[Depends('testHttpTester')] public function testClearHttpTesterClient(): void { $this->clearHttpTesterClient(); diff --git a/packages/tester/composer.json b/packages/tester/composer.json index 5aa08a232..5d892c61a 100644 --- a/packages/tester/composer.json +++ b/packages/tester/composer.json @@ -19,7 +19,7 @@ "ext-simplexml": "*", "draw/core": "^0.11", "guzzlehttp/psr7": "^1.8 || ^2.0", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "psr/http-message": "^1.0", "symfony/property-access": "^6.4.0" }, diff --git a/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php b/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php index 821265ab6..63173a4c1 100644 --- a/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php +++ b/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php @@ -11,6 +11,7 @@ use Draw\Bundle\UserBundle\Security\TwoFactorAuthentication\Entity\ConfigurationTrait; use Draw\Bundle\UserBundle\Security\TwoFactorAuthentication\Entity\TwoFactorAuthenticationUserInterface; use Draw\Component\Security\Core\Security; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -253,9 +254,7 @@ public function isForceEnablingTwoFactorAuthentication(): bool ]; } - /** - * @dataProvider provideTestCheckNeedToEnableTwoFactorAuthentication - */ + #[DataProvider('provideTestCheckNeedToEnableTwoFactorAuthentication')] public function testCheckNeedToEnableTwoFactorAuthentication( UserRequestInterceptionEvent $event, bool $allowHandingRequest, diff --git a/packages/user-bundle/composer.json b/packages/user-bundle/composer.json index 9647421c7..1c13b49b2 100644 --- a/packages/user-bundle/composer.json +++ b/packages/user-bundle/composer.json @@ -9,7 +9,7 @@ "user" ], "require": { - "php": ">=8.1", + "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", "doctrine/common": "^3.1", @@ -31,7 +31,7 @@ "draw/tester": "^0.11", "endroid/qr-code": "^5.0", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "scheb/2fa-bundle": "^6.0", "scheb/2fa-totp": "^6.0" }, diff --git a/packages/validator/composer.json b/packages/validator/composer.json index 0d425d1ec..aaf72acd1 100644 --- a/packages/validator/composer.json +++ b/packages/validator/composer.json @@ -17,7 +17,7 @@ "symfony/validator": "^6.4.0" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "doctrine/persistence": "^2.2 || ^3.0", "draw/dependency-injection": "^0.11" }, diff --git a/packages/workflow/composer.json b/packages/workflow/composer.json index aa1197d00..c73493adb 100644 --- a/packages/workflow/composer.json +++ b/packages/workflow/composer.json @@ -21,7 +21,7 @@ "require-dev": { "draw/security": "^0.11", "draw/dependency-injection": "^0.11", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.3", "symfony/security-core": "^6.4.0" }, "minimum-stability": "dev", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ffcb78449..5164e9470 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -35,3 +35,8 @@ parameters: count: 1 path: packages/sonata-integration-bundle/User/Security/AdminLoginAuthenticator.php + - + message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, Closure\\(\\)\\: null given\\.$#" + count: 1 + path: packages/tester-bundle/Tests/bootstrap.php + diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 4b604b9ee..79260eec4 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -11,11 +11,10 @@ parameters: - packages/fixer/Tests/fixtures/* ignoreErrors: - '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Session\\SessionInterface::getFlashBag\(\).#' - - '#Trying to mock an undefined method [a-zA-Z0-9\\_]#' #- '#provideTestArgument\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#provideTestOption\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#getHandledMessages\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#Test::getDefaultConfiguration\(\) return type has no value type specified in iterable type array.#' #- '#Test::getConfiguration\(\) return type has no value type specified in iterable type array.#' #- '#Test::provide[a-zA-Z0-9]*\(\) return type has no value type specified in iterable type (iterable|array).#' - #- '#Method [a-zA-Z0-9\\]*::getForEmails\(\) return type has no value type specified in iterable type (iterable|array).#' \ No newline at end of file + #- '#Method [a-zA-Z0-9\\]*::getForEmails\(\) return type has no value type specified in iterable type (iterable|array).#' diff --git a/phpstan.neon b/phpstan.neon index 0a8fecc07..e52692867 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -13,11 +13,10 @@ parameters: - packages/fixer/Tests/fixtures/* ignoreErrors: - '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Session\\SessionInterface::getFlashBag\(\).#' - - '#Trying to mock an undefined method [a-zA-Z0-9\\_]#' #- '#provideTestArgument\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#provideTestOption\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#getHandledMessages\(\) return type has no value type specified in iterable type (iterable|array).#' #- '#Test::getDefaultConfiguration\(\) return type has no value type specified in iterable type array.#' #- '#Test::getConfiguration\(\) return type has no value type specified in iterable type array.#' #- '#Test::provide[a-zA-Z0-9]*\(\) return type has no value type specified in iterable type (iterable|array).#' - #- '#Method [a-zA-Z0-9\\]*::getForEmails\(\) return type has no value type specified in iterable type (iterable|array).#' \ No newline at end of file + #- '#Method [a-zA-Z0-9\\]*::getForEmails\(\) return type has no value type specified in iterable type (iterable|array).#' diff --git a/tests/Controller/Api/UsersControllerTest.php b/tests/Controller/Api/UsersControllerTest.php index ed9040425..35b43cc31 100644 --- a/tests/Controller/Api/UsersControllerTest.php +++ b/tests/Controller/Api/UsersControllerTest.php @@ -9,6 +9,7 @@ use Monolog\Level; use PHPUnit\Framework\Attributes\AfterClass; use PHPUnit\Framework\Attributes\BeforeClass; +use PHPUnit\Framework\Attributes\Depends; use Symfony\Component\HttpFoundation\Response; class UsersControllerTest extends TestCase @@ -62,9 +63,7 @@ public function testUsersCreateAction(): object return $data; } - /** - * @depends testUsersCreateAction - */ + #[Depends('testUsersCreateAction')] public function testUsersEditAction(object $user): void { $this->httpTester() @@ -79,9 +78,7 @@ public function testUsersEditAction(object $user): void ->path('tags')->assertSame([]); } - /** - * @depends testUsersCreateAction - */ + #[Depends('testUsersCreateAction')] public function testSetTagsAction(object $user): void { $this->httpTester() @@ -98,9 +95,7 @@ public function testSetTagsAction(object $user): void ->assertSame(1); } - /** - * @depends testUsersCreateAction - */ + #[Depends('testUsersCreateAction')] public function testSendResetPasswordEmail(object $user): void { $this->httpTester() @@ -125,9 +120,7 @@ public function testSendResetPasswordEmail(object $user): void ); } - /** - * @depends testUsersCreateAction - */ + #[Depends('testUsersCreateAction')] public function testUsersDeleteAction(object $user): void { $this->httpTester() diff --git a/tests/Controller/PingActionTest.php b/tests/Controller/PingActionTest.php index da6dcfe04..08c47f948 100644 --- a/tests/Controller/PingActionTest.php +++ b/tests/Controller/PingActionTest.php @@ -5,6 +5,7 @@ use Draw\Bundle\TesterBundle\PHPUnit\Extension\SetUpAutowire\AutowireClient; use Draw\Bundle\TesterBundle\WebTestCase; use Draw\Component\Tester\PHPUnit\Extension\SetUpAutowire\AutowiredInterface; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Component\HttpFoundation\Response; @@ -35,9 +36,7 @@ public static function provideTestPingWithContext(): iterable yield 'unknown' => ['unknown', Response::HTTP_MULTI_STATUS]; } - /** - * @dataProvider provideTestPingWithContext - */ + #[DataProvider('provideTestPingWithContext')] public function testPingWithContext(string $context, int $statusCode): void { $this->client->request('GET', '/ping/'.$context); diff --git a/tests/Messenger/DoctrineEnvelopeEntityReference/EventListener/PropertyReferenceEncodingListenerTest.php b/tests/Messenger/DoctrineEnvelopeEntityReference/EventListener/PropertyReferenceEncodingListenerTest.php index 1931c9600..42744635b 100644 --- a/tests/Messenger/DoctrineEnvelopeEntityReference/EventListener/PropertyReferenceEncodingListenerTest.php +++ b/tests/Messenger/DoctrineEnvelopeEntityReference/EventListener/PropertyReferenceEncodingListenerTest.php @@ -13,6 +13,7 @@ use Draw\Component\Messenger\SerializerEventDispatcher\Event\PreEncodeEvent; use Draw\Component\Tester\PHPUnit\Extension\SetUpAutowire\AutowiredInterface; use Draw\Contracts\Messenger\EnvelopeFinderInterface; +use PHPUnit\Framework\Attributes\Depends; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; @@ -89,9 +90,7 @@ function (PostEncodeEvent $event) use ($user): void { static::assertTrue($this->postEncodeEventCalled); } - /** - * @depends testSend - */ + #[Depends('testSend')] public function testLoad(): void { $envelope = $this->envelopeFinder->findByTags([self::$email])[0]; diff --git a/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php b/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php index bf62f8f10..89e85c850 100644 --- a/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php +++ b/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php @@ -7,6 +7,7 @@ use Draw\Bundle\TesterBundle\PHPUnit\Extension\SetUpAutowire\AutowireService; use Draw\Component\Tester\PHPUnit\Extension\SetUpAutowire\AutowiredInterface; use Draw\Component\Validator\Constraints\ValueIsNotUsed; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -15,9 +16,7 @@ class ValueIsNotUsedValidatorTest extends KernelTestCase implements AutowiredInt #[AutowireService] protected ValidatorInterface $validator; - /** - * @dataProvider provideTestValidate - */ + #[DataProvider('provideTestValidate')] public function testValidate(mixed $value, string $entityClass, string $field, bool $expectError): void { $violations = $this->validator