diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml new file mode 100644 index 00000000..be75fd3d --- /dev/null +++ b/.github/workflows/phpunit-tests.yml @@ -0,0 +1,70 @@ +name: Ci suite +on: [push, pull_request] +jobs: + symfony: + name: PHPUnit tests (PHP ${{ matrix.php-version }} - Postgres ${{ matrix.postgres-version }}) + runs-on: ubuntu-latest + + # Docs: https://docs.github.com/en/actions/using-containerized-services + services: + postgres: + image: postgres:${{ matrix.postgres-version }} + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432/tcp + options: --health-cmd pg_isready --health-interval 1s --health-timeout 3s --health-retries 3 + strategy: + fail-fast: false + matrix: + php-version: ['7.4', '8.0'] + postgres-version: ['11.20-alpine', '13.11-alpine', '15.3-alpine'] + steps: + - name: Checkout + uses: actions/checkout@v3 + + # Docs: https://github.com/shivammathur/setup-php + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: phpunit-bridge + extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql + coverage: xdebug + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + # Without this step `git add .` command will result in exit code 128. + # This ensures the comitter info is set, for now prefil with some exiting + # variables in GitHub actions. + + - name: Set committer info + id: committer-info + run: | + git config --global user.email ${GITHUB_ACTOR_ID}+actor_id@noreply.github.com + git config --global user.name $GITHUB_ACTOR + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Run Migration + run: | + php bin/console doctrine:migrations:migrate + php bin/console messenger:setup-transports + env: + DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8 + + - name: Run tests + run: php vendor/bin/phpunit --coverage-text + env: + DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8 diff --git a/composer.json b/composer.json index 36b353cf..b232f566 100644 --- a/composer.json +++ b/composer.json @@ -193,6 +193,10 @@ "bin/console lint:twig templates --show-deprecations", "rm -rf var/cache/prod", "bin/console cache:warmup --env=prod" - ] + ], + "auto-scripts": { + "cache:clear": "symfony-cmd", + "assets:install %PUBLIC_DIR%": "symfony-cmd" + } } } diff --git a/docker-compose.yml b/docker-compose.yml index 79090114..4e9dda6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ x-restart-policy: &restart_policy services: database: << : *restart_policy - image: postgres:11.7-alpine + image: postgres:11.20-alpine logging: driver: none environment: diff --git a/symfony.lock b/symfony.lock index a604aa03..95362d59 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,178 +1,72 @@ { - "async-aws/core": { - "version": "1.9.0" - }, - "async-aws/ses": { - "version": "1.4.0" - }, - "aws/aws-crt-php": { - "version": "v1.0.2" - }, - "aws/aws-sdk-php": { - "version": "3.158.21" - }, - "bitbucket/client": { - "version": "v2.1.1" - }, - "brick/math": { - "version": "0.8.14" - }, - "buddy-works/buddy-works-php-api": { - "version": "1.3.0" - }, - "buddy-works/oauth2-client": { - "version": "0.1.0" - }, - "cbschuld/browser.php": { - "version": "1.9.4" - }, - "clue/mq-react": { - "version": "v1.2.0" - }, - "clue/stream-filter": { - "version": "v1.4.1" - }, - "coduo/php-matcher": { - "version": "4.0.0" - }, - "coduo/php-to-string": { - "version": "3.0.0" - }, - "composer/ca-bundle": { - "version": "1.2.6" - }, - "composer/composer": { - "version": "1.10-dev" - }, - "composer/semver": { - "version": "1.5.0" - }, - "composer/spdx-licenses": { - "version": "1.5.2" - }, - "composer/xdebug-handler": { - "version": "1.4.0" - }, "dama/doctrine-test-bundle": { - "version": "4.0", + "version": "7.1", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "4.0", - "ref": "56eaa387b5e48ebcc7c95a893b47dfa1ad51449c" + "ref": "2c920f73a217f30bd4a37833c91071f4d3dc1ecd" }, "files": [ "config/packages/test/dama_doctrine_test_bundle.yaml" ] }, "doctrine/annotations": { - "version": "1.0", + "version": "1.13", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "1.0", - "ref": "cb4152ebcadbe620ea2261da1a1c5a9b8cea7672" + "ref": "a2759dd6123694c8d901d0ec80006e044c2e6457" }, "files": [ "config/routes/annotations.yaml" ] }, - "doctrine/cache": { - "version": "1.10.0" - }, - "doctrine/collections": { - "version": "1.6.4" - }, - "doctrine/common": { - "version": "2.12.0" - }, - "doctrine/data-fixtures": { - "version": "1.4.2" - }, - "doctrine/dbal": { - "version": "v2.10.1" - }, - "doctrine/deprecations": { - "version": "v0.5.3" - }, "doctrine/doctrine-bundle": { - "version": "2.0", + "version": "2.7", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "2.0", - "ref": "a9f2463b9f73efe74482f831f03a204a41328555" + "branch": "main", + "version": "2.4", + "ref": "013b823e7fee65890b23e40f31e6667a1ac519ac" }, "files": [ "config/packages/doctrine.yaml", - "config/packages/prod/doctrine.yaml", "src/Entity/.gitignore", "src/Repository/.gitignore" ] }, "doctrine/doctrine-fixtures-bundle": { - "version": "3.0", + "version": "3.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "3.0", - "ref": "fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3" + "ref": "1f5514cfa15b947298df4d771e694e578d4c204d" }, "files": [ "src/DataFixtures/AppFixtures.php" ] }, "doctrine/doctrine-migrations-bundle": { - "version": "1.2", + "version": "3.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.2", - "ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1" + "branch": "main", + "version": "3.1", + "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33" }, "files": [ "config/packages/doctrine_migrations.yaml", - "src/Migrations/.gitignore" + "migrations/.gitignore" ] }, - "doctrine/event-manager": { - "version": "1.1.0" - }, - "doctrine/inflector": { - "version": "1.3.1" - }, - "doctrine/instantiator": { - "version": "1.3.0" - }, - "doctrine/lexer": { - "version": "1.2.0" - }, - "doctrine/migrations": { - "version": "2.2.1" - }, - "doctrine/orm": { - "version": "v2.7.0" - }, - "doctrine/persistence": { - "version": "1.3.5" - }, - "doctrine/sql-formatter": { - "version": "1.1.1" - }, - "egulias/email-validator": { - "version": "2.1.15" - }, - "ekino/phpstan-banned-code": { - "version": "v0.3.1" - }, - "evenement/evenement": { - "version": "v3.0.1" - }, "excelwebzone/recaptcha-bundle": { "version": "1.5", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.5", "ref": "fd4da7bc71749db65bc83abf5d164bfa9c839cf4" }, @@ -181,141 +75,72 @@ "config/packages/ewz_recaptcha.yaml" ] }, - "fakerphp/faker": { - "version": "v1.13.0" - }, - "fig/http-message-util": { - "version": "1.1.5" - }, "friendsofphp/php-cs-fixer": { - "version": "2.2", + "version": "3.11", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "2.2", - "ref": "cc05ab6abf6894bddb9bbd6a252459010ebe040b" + "branch": "main", + "version": "3.0", + "ref": "be2103eb4a20942e28a6dd87736669b757132435" }, "files": [ - ".php_cs.dist" + ".php-cs-fixer.dist.php" ] }, - "friendsofphp/proxy-manager-lts": { - "version": "v1.0.3" - }, "google/recaptcha": { - "version": "1.1", + "version": "1.2", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.1", - "ref": "d087df3e087f50da3955f2def05079380da5894b" + "ref": "e5a4aa21f2e98d7440ae9aab6b56e307f99dd084" }, "files": [ "config/packages/google_recaptcha.yaml" ] }, - "guzzlehttp/guzzle": { - "version": "6.5.2" - }, - "guzzlehttp/promises": { - "version": "v1.3.1" - }, - "guzzlehttp/psr7": { - "version": "1.6.1" - }, - "http-interop/http-factory-guzzle": { - "version": "1.0.0" - }, - "jean85/pretty-package-versions": { - "version": "1.2" - }, - "johnkary/phpunit-speedtrap": { - "version": "v3.2.0" - }, - "justinrainbow/json-schema": { - "version": "5.2.9" - }, "knplabs/github-api": { - "version": "2.6", + "version": "3.8", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "2.6", "ref": "a7d5781e4a8e84f1c238c43e4c9bb806f01d8a3f" - } + }, + "files": [ + "config/packages/github_api.yaml" + ] }, "knpuniversity/oauth2-client-bundle": { - "version": "1.20", + "version": "2.10", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.20", - "ref": "80acc9223a205cbf5d9828fd616c82a374d281dd" + "ref": "1ff300d8c030f55c99219cc55050b97a695af3f6" }, "files": [ "config/packages/knpu_oauth2_client.yaml" ] }, - "laminas/laminas-code": { - "version": "3.4.1" - }, - "league/commonmark": { - "version": "1.5.5" - }, - "league/flysystem": { - "version": "1.0.69" - }, - "league/flysystem-aws-s3-v3": { - "version": "1.0.29" - }, "league/flysystem-bundle": { - "version": "1.0", + "version": "1.6", "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "repo": "github.com/symfony/recipes", + "branch": "main", "version": "1.0", - "ref": "8ad3ded1f39fedce098e43259741f42092a1010e" + "ref": "913dc3d7a5a1af0d2b044c5ac3a16e2f851d7380" }, "files": [ "config/packages/flysystem.yaml", "var/storage/.gitignore" ] }, - "league/flysystem-cached-adapter": { - "version": "1.1.0" - }, - "league/flysystem-memory": { - "version": "1.0.2" - }, - "league/mime-type-detection": { - "version": "1.4.0" - }, - "league/oauth2-client": { - "version": "2.4.1" - }, - "league/oauth2-github": { - "version": "2.0.0" - }, - "m4tthumphrey/php-gitlab-api": { - "version": "9.17.0" - }, - "monolog/monolog": { - "version": "2.0.2" - }, - "mtdowling/jmespath.php": { - "version": "2.6.0" - }, - "munusphp/munus": { - "version": "0.1.0" - }, - "myclabs/deep-copy": { - "version": "1.9.4" - }, "nelmio/api-doc-bundle": { - "version": "3.0", + "version": "4.10", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "3.0", "ref": "c8e0c38e1a280ab9e37587a8fa32b251d5bc1c94" }, @@ -325,169 +150,57 @@ ] }, "nelmio/cors-bundle": { - "version": "1.5", + "version": "2.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "1.5", - "ref": "6388de23860284db9acce0a7a5d9d13153bcb571" + "ref": "6bea22e6c564fba3a1391615cada1437d0bde39c" }, "files": [ "config/packages/nelmio_cors.yaml" ] }, - "nikic/php-parser": { - "version": "v4.3.0" - }, "nyholm/psr7": { "version": "1.5", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "1.0", - "ref": "0cd4d2d0e7f646fda75f9944f747a56e6ed13d4c" + "ref": "4a8c0345442dcca1d8a2c65633dcf0285dd5a5a2" }, "files": [ "config/packages/nyholm_psr7.yaml" ] }, - "omines/oauth2-gitlab": { - "version": "3.2.0" - }, - "phar-io/manifest": { - "version": "1.0.3" - }, - "phar-io/version": { - "version": "2.0.1" - }, - "php-cs-fixer/diff": { - "version": "v1.3.0" - }, - "php-http/cache-plugin": { - "version": "1.7.0" - }, - "php-http/client-common": { - "version": "2.1.0" - }, - "php-http/discovery": { - "version": "1.7.4" - }, - "php-http/httplug": { - "version": "2.1.0" - }, - "php-http/message": { - "version": "1.8.0" - }, - "php-http/message-factory": { - "version": "v1.0.2" - }, - "php-http/multipart-stream-builder": { - "version": "1.1.0" - }, - "php-http/promise": { - "version": "v1.0.0" - }, - "phpdocumentor/reflection-common": { - "version": "2.0.0" - }, - "phpdocumentor/reflection-docblock": { - "version": "4.3.4" - }, - "phpdocumentor/type-resolver": { - "version": "1.0.1" - }, - "phpspec/prophecy": { - "version": "1.10.1" - }, - "phpspec/prophecy-phpunit": { - "version": "v2.0.1" - }, - "phpstan/extension-installer": { - "version": "1.0.3" - }, "phpstan/phpstan": { - "version": "0.12.4" - }, - "phpstan/phpstan-deprecation-rules": { - "version": "0.12.2" - }, - "phpstan/phpstan-doctrine": { - "version": "0.12.9" - }, - "phpstan/phpstan-phpunit": { - "version": "0.12.5" - }, - "phpstan/phpstan-strict-rules": { - "version": "0.12.2" - }, - "phpstan/phpstan-symfony": { - "version": "0.12.3" - }, - "phpunit/php-code-coverage": { - "version": "7.0.10" - }, - "phpunit/php-file-iterator": { - "version": "2.0.2" - }, - "phpunit/php-invoker": { - "version": "3.1.1" - }, - "phpunit/php-text-template": { - "version": "1.2.1" - }, - "phpunit/php-timer": { - "version": "2.1.2" + "version": "1.8", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "d74d4d719d5f53856c9c13544aa22d44144b1819" + } }, "phpunit/phpunit": { - "version": "4.7", + "version": "9.5", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.7", - "ref": "f1546d78502f904f37f7b47a42b1444cbf1d3423" + "branch": "main", + "version": "9.3", + "ref": "fc344d3f99d9a518245ef3c88176d0c3467ae1a6" }, "files": [ ".env.test", "phpunit.xml.dist", - "config/bootstrap.php", - "tests/.gitignore" + "tests/bootstrap.php" ] }, - "psr/cache": { - "version": "1.0.1" - }, - "psr/container": { - "version": "1.0.0" - }, - "psr/event-dispatcher": { - "version": "1.0.0" - }, - "psr/http-client": { - "version": "1.0.0" - }, - "psr/http-factory": { - "version": "1.0.1" - }, - "psr/http-message": { - "version": "1.0.1" - }, - "psr/log": { - "version": "1.1.2" - }, - "ralouphie/getallheaders": { - "version": "3.0.3" - }, - "ramsey/collection": { - "version": "1.0.1" - }, - "ramsey/uuid": { - "version": "3.9.2" - }, "ramsey/uuid-doctrine": { - "version": "1.3", + "version": "1.8", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.3", "ref": "471aed0fbf5620b8d7f92b7a5ebbbf6c0945c27a" }, @@ -495,95 +208,11 @@ "config/packages/ramsey_uuid_doctrine.yaml" ] }, - "react/cache": { - "version": "v1.0.0" - }, - "react/dns": { - "version": "v1.3.0" - }, - "react/event-loop": { - "version": "v1.1.1" - }, - "react/http": { - "version": "v1.0.0" - }, - "react/promise": { - "version": "v2.8.0" - }, - "react/promise-stream": { - "version": "v1.2.0" - }, - "react/promise-timer": { - "version": "v1.6.0" - }, - "react/socket": { - "version": "v1.5.0" - }, - "react/stream": { - "version": "v1.1.1" - }, - "ringcentral/psr7": { - "version": "1.3.0" - }, - "sebastian/cli-parser": { - "version": "1.0.1" - }, - "sebastian/code-unit": { - "version": "1.0.7" - }, - "sebastian/code-unit-reverse-lookup": { - "version": "1.0.1" - }, - "sebastian/comparator": { - "version": "3.0.2" - }, - "sebastian/complexity": { - "version": "2.0.1" - }, - "sebastian/diff": { - "version": "3.0.2" - }, - "sebastian/environment": { - "version": "4.2.3" - }, - "sebastian/exporter": { - "version": "3.1.2" - }, - "sebastian/global-state": { - "version": "3.0.0" - }, - "sebastian/lines-of-code": { - "version": "1.0.1" - }, - "sebastian/object-enumerator": { - "version": "3.0.3" - }, - "sebastian/object-reflector": { - "version": "1.1.1" - }, - "sebastian/recursion-context": { - "version": "3.0.0" - }, - "sebastian/resource-operations": { - "version": "2.0.1" - }, - "sebastian/type": { - "version": "1.1.3" - }, - "sebastian/version": { - "version": "2.0.1" - }, - "seld/jsonlint": { - "version": "1.7.2" - }, - "seld/phar-utils": { - "version": "1.0.2" - }, "sensio/framework-extra-bundle": { - "version": "5.2", + "version": "6.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "5.2", "ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b" }, @@ -591,370 +220,191 @@ "config/packages/sensio_framework_extra.yaml" ] }, - "sentry/sdk": { - "version": "2.1.0" - }, - "sentry/sentry": { - "version": "2.3.1" - }, "sentry/sentry-symfony": { - "version": "3.0", + "version": "4.3", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", - "version": "3.0", - "ref": "9746f0823302d7980e5273ef7a69ef3f5ac80914" + "branch": "main", + "version": "4.0", + "ref": "27b184582b31a79a21f461df82fd8a0eaba658ff" }, "files": [ "config/packages/sentry.yaml" ] }, - "stevenmaguire/oauth2-bitbucket": { - "version": "3.0.0" - }, "symfony/amazon-mailer": { - "version": "4.4", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "4.4", "ref": "9648db3ecae5c8a6b1a5f74715d3907124348815" } }, - "symfony/amqp-messenger": { - "version": "v5.1.3" - }, - "symfony/asset": { - "version": "v5.0.2" - }, - "symfony/browser-kit": { - "version": "v5.0.2" - }, - "symfony/cache": { - "version": "v5.0.2" - }, - "symfony/cache-contracts": { - "version": "v2.0.1" - }, - "symfony/config": { - "version": "v5.0.2" - }, "symfony/console": { - "version": "4.4", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.4", - "ref": "fead3ab2e80622c61d13dac0d21a3430a45efae8" + "branch": "main", + "version": "5.3", + "ref": "da0c8be8157600ad34f10ff0c9cc91232522e047" }, "files": [ - "bin/console", - "config/bootstrap.php" + "bin/console" ] }, - "symfony/dependency-injection": { - "version": "v5.0.2" - }, - "symfony/deprecation-contracts": { - "version": "v2.1.3" - }, - "symfony/doctrine-bridge": { - "version": "v5.0.2" - }, - "symfony/doctrine-messenger": { - "version": "v5.1.3" - }, - "symfony/dom-crawler": { - "version": "v5.0.2" - }, - "symfony/dotenv": { - "version": "v5.0.2" - }, - "symfony/error-handler": { - "version": "v5.0.2" - }, - "symfony/event-dispatcher": { - "version": "v5.0.2" - }, - "symfony/event-dispatcher-contracts": { - "version": "v2.0.1" - }, - "symfony/filesystem": { - "version": "v5.0.2" - }, - "symfony/finder": { - "version": "v5.0.2" - }, "symfony/flex": { - "version": "1.0", + "version": "2.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "1.0", - "ref": "c0eeb50665f0f77226616b6038a9b06c03752d8e" + "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" }, "files": [ ".env" ] }, - "symfony/form": { - "version": "v5.0.2" - }, "symfony/framework-bundle": { - "version": "4.4", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.4", - "ref": "23ecaccc551fe2f74baf613811ae529eb07762fa" + "branch": "main", + "version": "5.4", + "ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb" }, "files": [ - "config/bootstrap.php", "config/packages/cache.yaml", "config/packages/framework.yaml", - "config/packages/test/framework.yaml", - "config/routes/dev/framework.yaml", + "config/preload.php", + "config/routes/framework.yaml", "config/services.yaml", "public/index.php", "src/Controller/.gitignore", "src/Kernel.php" ] }, - "symfony/http-client": { - "version": "v5.0.4" - }, - "symfony/http-client-contracts": { - "version": "v2.0.1" - }, - "symfony/http-foundation": { - "version": "v5.0.2" - }, - "symfony/http-kernel": { - "version": "v5.0.2" - }, - "symfony/intl": { - "version": "v5.3.0" - }, "symfony/lock": { - "version": "v5.0.7" + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.2", + "ref": "8e937ff2b4735d110af1770f242c1107fdab4c8e" + }, + "files": [ + "config/packages/lock.yaml" + ] }, "symfony/mailer": { - "version": "4.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "4.3", - "ref": "15658c2a0176cda2e7dba66276a2030b52bd81b2" + "ref": "2bf89438209656b85b9a49238c4467bff1b1f939" }, "files": [ "config/packages/mailer.yaml" ] }, "symfony/maker-bundle": { - "version": "1.0", + "version": "1.47", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "1.0", "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" } }, "symfony/messenger": { - "version": "4.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.3", - "ref": "8a2675c061737658bed85102e9241c752620e575" + "branch": "main", + "version": "5.4", + "ref": "8bd5f27013fb1d7217191c548e340f0bdb11912c" }, "files": [ "config/packages/messenger.yaml" ] }, - "symfony/mime": { - "version": "v5.0.2" - }, - "symfony/monolog-bridge": { - "version": "v5.0.2" - }, "symfony/monolog-bundle": { - "version": "3.3", + "version": "3.8", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "222b46a1bb02cd04bbc59700adec2f44f1a644b7" + "branch": "main", + "version": "3.7", + "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" }, "files": [ - "config/packages/dev/monolog.yaml", - "config/packages/prod/monolog.yaml", - "config/packages/test/monolog.yaml" + "config/packages/monolog.yaml" ] }, - "symfony/options-resolver": { - "version": "v5.0.2" - }, - "symfony/password-hasher": { - "version": "v5.3.0" - }, - "symfony/polyfill-intl-grapheme": { - "version": "v1.18.1" - }, - "symfony/polyfill-intl-icu": { - "version": "v1.13.1" - }, - "symfony/polyfill-intl-idn": { - "version": "v1.13.1" - }, - "symfony/polyfill-intl-normalizer": { - "version": "v1.18.1" - }, - "symfony/polyfill-mbstring": { - "version": "v1.13.1" - }, - "symfony/polyfill-php73": { - "version": "v1.13.1" - }, - "symfony/polyfill-php80": { - "version": "v1.17.1" - }, - "symfony/polyfill-php81": { - "version": "v1.23.0" - }, - "symfony/polyfill-uuid": { - "version": "v1.14.0" - }, - "symfony/process": { - "version": "v5.0.2" - }, - "symfony/property-access": { - "version": "v5.0.2" - }, - "symfony/property-info": { - "version": "v5.1.3" - }, - "symfony/psr-http-message-bridge": { - "version": "v2.1.2" - }, - "symfony/redis-messenger": { - "version": "v5.1.3" - }, "symfony/routing": { - "version": "4.2", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.2", - "ref": "683dcb08707ba8d41b7e34adb0344bfd68d248a7" + "branch": "main", + "version": "5.3", + "ref": "85de1d8ae45b284c3c84b668171d2615049e698f" }, "files": [ - "config/packages/prod/routing.yaml", "config/packages/routing.yaml", "config/routes.yaml" ] }, "symfony/security-bundle": { - "version": "4.4", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.4", - "ref": "30efd98dd3b4ead6e9ad4713b1efc43bbe94bf77" + "branch": "main", + "version": "5.3", + "ref": "98f1f2b0d635908c2b40f3675da2d23b1a069d30" }, "files": [ "config/packages/security.yaml" ] }, - "symfony/security-core": { - "version": "v5.0.2" - }, - "symfony/security-csrf": { - "version": "v5.0.2" - }, - "symfony/security-guard": { - "version": "v5.0.2" - }, - "symfony/security-http": { - "version": "v5.0.2" - }, - "symfony/service-contracts": { - "version": "v2.0.1" - }, - "symfony/stopwatch": { - "version": "v5.0.2" - }, - "symfony/string": { - "version": "v5.1.3" - }, - "symfony/translation-contracts": { - "version": "v2.0.1" - }, - "symfony/twig-bridge": { - "version": "v5.0.2" - }, "symfony/twig-bundle": { - "version": "5.0", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.0", - "ref": "fab9149bbaa4d5eca054ed93f9e1b66cc500895d" + "branch": "main", + "version": "5.4", + "ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387" }, "files": [ - "config/packages/test/twig.yaml", "config/packages/twig.yaml", "templates/base.html.twig" ] }, "symfony/validator": { - "version": "4.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.3", - "ref": "d902da3e4952f18d3bf05aab29512eb61cabd869" + "branch": "main", + "version": "5.3", + "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" }, "files": [ - "config/packages/test/validator.yaml", "config/packages/validator.yaml" ] }, - "symfony/var-dumper": { - "version": "v5.0.2" - }, - "symfony/var-exporter": { - "version": "v5.0.2" - }, "symfony/web-profiler-bundle": { - "version": "3.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" + "branch": "main", + "version": "5.3", + "ref": "24bbc3d84ef2f427f82104f766014e799eefcc3e" }, "files": [ - "config/packages/dev/web_profiler.yaml", - "config/packages/test/web_profiler.yaml", - "config/routes/dev/web_profiler.yaml" + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" ] }, - "symfony/yaml": { - "version": "v5.0.2" - }, - "theseer/tokenizer": { - "version": "1.1.3" - }, "twig/extra-bundle": { - "version": "v3.0.1" - }, - "twig/twig": { - "version": "v3.0.1" - }, - "webmozart/assert": { - "version": "1.6.0" - }, - "zircote/swagger-php": { - "version": "2.0.16" + "version": "v3.4.0" } } diff --git a/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php b/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php index cc1b420b..f2f41372 100644 --- a/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php +++ b/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php @@ -69,7 +69,7 @@ public function testSynchronizeError(): void { $this->synchronizer->synchronize($package = PackageMother::withOrganization('artifact', '/non/exist/path', 'buddy')); - self::assertEquals('Error: RecursiveDirectoryIterator::__construct(/non/exist/path): Failed to open directory: No such file or directory', $this->getProperty($package, 'lastSyncError')); + self::assertMatchesRegularExpression('/Error: RecursiveDirectoryIterator::__construct\(\/non\/exist\/path\): (F|f)ailed to open (dir|directory): No such file or directory/', $this->getProperty($package, 'lastSyncError')); } public function testSynchronizePackageFromArtifacts(): void diff --git a/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php b/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php index 7d9032e3..84936488 100644 --- a/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php +++ b/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php @@ -6,6 +6,7 @@ use Buddy\Repman\Service\Security\SecurityChecker\SensioLabsSecurityChecker; use PHPUnit\Framework\TestCase; +use RuntimeException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Process; @@ -42,7 +43,7 @@ public function testInvalidLockFile(): void public function testMissingDatabase(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Advisories database does not exist'); $this->checker = new SensioLabsSecurityChecker(sys_get_temp_dir().'/bogus-security-advisories', ''); @@ -156,7 +157,7 @@ private function createAdvisoriesDatabaseRepo(): void $commands = [ ['git', 'add', '-A'], - ['git', '-c', 'commit.gpgsign=false', 'commit', '-a', '-m', 'Add repo'] + ['git', '-c', 'commit.gpgsign=false', 'commit', '-a', '-m', 'Add repo'], ]; foreach ($commands as $command) { @@ -169,12 +170,7 @@ private function runCommand(array $command, int $expectedCode = 0): void { ($proc = new Process($command, $this->repoDir))->run(); if ($proc->getExitCode() !== $expectedCode) { - throw new \RuntimeException(sprintf( - 'Commands \'%s\' failed with exit code %d%s', - $proc->getCommandLine(), - $proc->getExitCode(), - PHP_EOL . $proc->getOutput(), - )); + throw new RuntimeException(sprintf('Commands \'%s\' failed with exit code %d%s', $proc->getCommandLine(), $proc->getExitCode(), PHP_EOL.$proc->getOutput())); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 00000000..469dccee --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,11 @@ +bootEnv(dirname(__DIR__).'/.env'); +}