diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28d64bc69a..6c15bb25aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -249,7 +249,7 @@ jobs: DB: ${{steps.database-type.outputs.db}} if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 }} run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error + phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --stop-on-error - name: Slow tests env: @@ -378,7 +378,7 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error + phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --stop-on-error # Other database types, namely sqlite3 and mssql other-tests: @@ -491,7 +491,7 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --verbose --stop-on-error + phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error # Test with IIS & PostgreSQL on Windows windows-tests: @@ -606,8 +606,8 @@ jobs: - name: Run unit tests if: ${{ matrix.type == 'unit' }} run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional,slow + phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --stop-on-error --exclude-group functional,slow - name: Run functional tests if: ${{ matrix.type == 'functional' }} run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional + phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --stop-on-error --group functional diff --git a/phpBB/composer.json b/phpBB/composer.json index 1bc456f32f..7dfe52b322 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -65,7 +65,7 @@ "laravel/homestead": "~14.4", "misantron/dbunit": "~5.0", "phing/phing": "~2.4", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^10.0", "squizlabs/php_codesniffer": "~3.4", "symfony/browser-kit": "^6.3", "symfony/css-selector": "^6.3", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index dad535bf0b..eed819db81 100644 --- a/phpBB/composer.lock +++ b/phpBB/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": "39f3a7c03ba85a8c7892e5c076372eb0", + "content-hash": "9f600f681e6bb2efaa5a7c6a445e09bf", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -6869,76 +6869,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -7279,16 +7209,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", "shasum": "" }, "require": { @@ -7327,7 +7257,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" }, "funding": [ { @@ -7335,7 +7265,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-07-05T12:25:42+00:00" }, { "name": "netresearch/jsonmapper", @@ -7898,16 +7828,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { @@ -7915,18 +7845,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -7935,7 +7865,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -7964,7 +7894,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/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -7972,32 +7902,32 @@ "type": "github" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -8024,7 +7954,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -8032,28 +7963,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -8061,7 +7992,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -8087,7 +8018,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -8095,32 +8026,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -8146,7 +8077,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -8154,32 +8086,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -8205,7 +8137,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -8213,54 +8145,52 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "10.5.48", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "6e0a2bc39f6fae7617989d690d76c48e6d2eb541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e0a2bc39f6fae7617989d690d76c48e6d2eb541", + "reference": "6e0a2bc39f6fae7617989d690d76c48e6d2eb541", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.3", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.3", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -8268,7 +8198,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -8300,7 +8230,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.48" }, "funding": [ { @@ -8311,12 +8241,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-07-11T04:07:17+00:00" }, { "name": "psalm/plugin-symfony", @@ -8385,28 +8323,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -8429,7 +8367,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -8437,32 +8376,32 @@ "type": "github" } ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -8485,7 +8424,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -8493,32 +8432,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -8540,7 +8479,7 @@ "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/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -8548,34 +8487,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -8614,7 +8555,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3" }, "funding": [ { @@ -8622,33 +8564,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2024-10-18T14:56:07+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -8671,7 +8613,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -8679,33 +8622,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -8737,7 +8680,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -8745,27 +8689,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -8773,7 +8717,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -8792,7 +8736,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -8800,7 +8744,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -8808,34 +8753,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -8877,7 +8822,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -8885,38 +8831,35 @@ "type": "github" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -8935,13 +8878,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -8949,33 +8893,33 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -8998,7 +8942,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -9006,34 +8951,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -9055,7 +9000,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -9063,32 +9008,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -9110,7 +9055,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -9118,32 +9063,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -9173,7 +9118,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -9181,86 +9126,32 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -9283,7 +9174,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -9291,29 +9182,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -9336,7 +9227,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -9344,7 +9235,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "spatie/array-to-xml", diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php index 46e7edffd2..59595a9c60 100644 --- a/phpBB/phpbb/di/container_builder.php +++ b/phpBB/phpbb/di/container_builder.php @@ -573,7 +573,7 @@ class container_builder } $config_data = $this->config_php_file->get_all(); - if (!empty($config_data)) + if (!empty($config_data) && !empty($config_data['dbms'])) { if ($this->dbal_connection === null) { @@ -592,6 +592,10 @@ class container_builder } $this->container->set('dbal.conn.driver', $this->dbal_connection); } + else + { + return; + } } /** diff --git a/tests/attachment/manager_test.php b/tests/attachment/manager_test.php index 8fcea043eb..4270c75695 100644 --- a/tests/attachment/manager_test.php +++ b/tests/attachment/manager_test.php @@ -21,15 +21,15 @@ class phpbb_attachment_manager_test extends \phpbb_test_case { $this->delete = $this->getMockBuilder('\phpbb\attachment\delete') ->disableOriginalConstructor() - ->setMethods(['delete', 'unlink_attachment']) + ->onlyMethods(['delete', 'unlink_attachment']) ->getMock(); $this->resync = $this->getMockBuilder('\phpbb\attachment\resync') ->disableOriginalConstructor() - ->setMethods(['resync']) + ->onlyMethods(['resync']) ->getMock(); $this->upload = $this->getMockBuilder('\phpbb\attachment\upload') ->disableOriginalConstructor() - ->setMethods(['upload']) + ->onlyMethods(['upload']) ->getMock(); } diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index 609ee99536..5b7aa6bacf 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -365,7 +365,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case public function test_image_upload($is_image, $plupload_active, $config_data, $expected) { $filespec = $this->getMockBuilder('\phpbb\files\filespec_storage') - ->setMethods(array( + ->onlyMethods(array( 'init_error', 'is_image', 'move_file', diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 2fcb5b8484..f291751575 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -74,8 +74,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case ->will($this->returnValue(true)); $this->request->expects($this->exactly(2)) ->method('server') - ->withConsecutive(['PHP_AUTH_USER'], ['PHP_AUTH_PW']) - ->will($this->onConsecutiveCalls($this->returnValue('foobar'), $this->returnValue('example'))); + ->willReturnCallback(fn(string $arg) => match(true) { + $arg === 'PHP_AUTH_USER' => 'foobar', + $arg === 'PHP_AUTH_PW' => 'example', + }); $expected = array( 'status' => LOGIN_SUCCESS, @@ -102,8 +104,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case ->will($this->returnValue(true)); $this->request->expects($this->exactly(2)) ->method('server') - ->withConsecutive(['PHP_AUTH_USER'], ['PHP_AUTH_PW']) - ->will($this->onConsecutiveCalls($this->returnValue('foobar'), $this->returnValue('example'))); + ->willReturnCallback(fn(string $arg) => match(true) { + $arg === 'PHP_AUTH_USER' => 'foobar', + $arg === 'PHP_AUTH_PW' => 'example', + }); $expected = array( 'user_id' => 1, diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 576950374e..7c5453f13f 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -12,6 +12,7 @@ */ require_once __DIR__ . '/driver/foobar.php'; +require_once __DIR__ . '/driver/barfoo.php'; class phpbb_avatar_manager_test extends \phpbb_database_test_case { @@ -62,15 +63,15 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case // $this->avatar_foobar will be needed later on $this->avatar_foobar = $this->getMockBuilder('\phpbb\avatar\driver\foobar') - ->setMethods(array('get_name')) + ->onlyMethods(array('get_name')) ->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)) ->getMock(); $this->avatar_foobar->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.foobar')); - // barfoo driver can't be mocked with constructor arguments $this->avatar_barfoo = $this->getMockBuilder('\phpbb\avatar\driver\barfoo') - ->setMethods(array('get_name', 'get_config_name')) + ->onlyMethods(array('get_name', 'get_config_name')) + ->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)) ->getMock(); $this->avatar_barfoo->expects($this->any()) ->method('get_name') @@ -89,14 +90,14 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case if ($driver !== 'upload') { $cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver) - ->setMethods(array('get_name')) + ->onlyMethods(array('get_name')) ->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)) ->getMock(); } else { $cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver) - ->setMethods(array('get_name')) + ->onlyMethods(array('get_name')) ->setConstructorArgs(array($this->config, $phpbb_root_path, $phpEx, $storage, $path_helper, $routing_helper, $dispatcher, $files_factory, $php_ini)) ->getMock(); } @@ -302,7 +303,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case global $phpbb_root_path, $phpEx; $user = $this->getMockBuilder('\phpbb\user') - ->setMethods(array()) + ->onlyMethods(['lang']) ->setConstructorArgs(array(new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime')) ->getMock(); $lang_array = array( diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 7556dd8c90..9efef937a4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -14,13 +14,14 @@ define('IN_PHPBB', true); define('PHPBB_ENVIRONMENT', 'test'); +global $phpbb_class_loader, $phpbb_class_loader_mock, $phpbb_class_loader_ext, $phpbb_class_loader_tests; +global $phpbb_root_path, $phpEx, $table_prefix; + $phpbb_root_path = 'phpBB/'; $phpEx = 'php'; - -global $table_prefix; -require_once $phpbb_root_path . 'includes/startup.php'; - $table_prefix = 'phpbb_'; + +require_once $phpbb_root_path . 'includes/startup.php'; require_once $phpbb_root_path . 'includes/constants.php'; require_once $phpbb_root_path . 'phpbb/class_loader.' . $phpEx; require_once $phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx; diff --git a/tests/cache/memcached_test.php b/tests/cache/memcached_driver_test.php similarity index 100% rename from tests/cache/memcached_test.php rename to tests/cache/memcached_driver_test.php diff --git a/tests/captcha/turnstile_test.php b/tests/captcha/turnstile_test.php index 995a5fdc72..8d3c995810 100644 --- a/tests/captcha/turnstile_test.php +++ b/tests/captcha/turnstile_test.php @@ -454,7 +454,7 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case ->expects($matcher) ->method('assign_vars') ->willReturnCallback(function ($template_data) use ($matcher, $expected) { - $callNr = $matcher->getInvocationCount(); + $callNr = $matcher->numberOfInvocations(); $this->assertEquals($expected[$callNr], $template_data); }); diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index cdda4fb886..2bd884127e 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -76,7 +76,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case )); $mock_router = $this->getMockBuilder('\phpbb\routing\router') - ->setMethods(array('setContext', 'generate')) + ->onlyMethods(array('setContext', 'generate')) ->disableOriginalConstructor() ->getMock(); $mock_router->method('setContext') diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index 90fa2a9fd0..9ba01d217f 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -53,7 +53,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case )); $mock_router = $this->getMockBuilder('\phpbb\routing\router') - ->setMethods(array('setContext', 'generate')) + ->onlyMethods(array('setContext', 'generate')) ->disableOriginalConstructor() ->getMock(); $mock_router->method('setContext') @@ -132,7 +132,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case )); $mock_router = $this->getMockBuilder('\phpbb\routing\router') - ->setMethods(array('setContext', 'generate')) + ->onlyMethods(array('setContext', 'generate')) ->disableOriginalConstructor() ->getMock(); $mock_router->method('setContext') @@ -180,7 +180,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case )); $mock_router = $this->getMockBuilder('\phpbb\routing\router') - ->setMethods(array('setContext', 'generate')) + ->onlyMethods(array('setContext', 'generate')) ->disableOriginalConstructor() ->getMock(); $mock_router->method('setContext') diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index fb2618787e..0a3aab5422 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -62,7 +62,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base return $response; }; $helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\QuestionHelper') - ->setMethods(['ask']) + ->onlyMethods(['ask']) ->disableOriginalConstructor() ->getMock(); $helper->expects($this->any()) diff --git a/tests/console/user/delete_id_test.php b/tests/console/user/delete_ids_test.php similarity index 100% rename from tests/console/user/delete_id_test.php rename to tests/console/user/delete_ids_test.php diff --git a/tests/controller/helper_route_root_test.php b/tests/controller/helper_route_root_test.php index 496027961e..5162201aaa 100644 --- a/tests/controller/helper_route_root_test.php +++ b/tests/controller/helper_route_root_test.php @@ -13,7 +13,7 @@ require_once __DIR__ . '/common_helper_route.php'; -class phpbb_controller_helper_route_test extends phpbb_controller_common_helper_route +class phpbb_controller_helper_route_root_test extends phpbb_controller_common_helper_route { protected function get_phpbb_root_path() { diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 45736e82fe..01483f5c88 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -84,7 +84,7 @@ class phpbb_cron_manager_test extends \phpbb_test_case )); $mock_router = $this->getMockBuilder('\phpbb\routing\router') - ->setMethods(array('setContext', 'generate')) + ->onlyMethods(array('setContext', 'generate')) ->disableOriginalConstructor() ->getMock(); $mock_router->method('setContext') diff --git a/tests/cron/wrapper_test.php b/tests/cron/wrapper_test.php index 95b2a7fa67..315761ca9d 100644 --- a/tests/cron/wrapper_test.php +++ b/tests/cron/wrapper_test.php @@ -111,7 +111,8 @@ class phpbb_cron_wrapper_test extends phpbb_template_template_test_case { $this->task = $this->getMockBuilder(\phpbb\cron\task\task::class) ->disableOriginalConstructor() - ->setMethods(['get_name', 'run', 'is_runnable', 'should_run', 'some_method']) + ->onlyMethods(['get_name', 'run', 'is_runnable', 'should_run']) + ->addMethods(['some_method']) ->getMock(); $this->routing_helper = $this->createMock(\phpbb\routing\helper::class); diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php index 9e53954d86..d1ec75470a 100644 --- a/tests/dbal/connect_test.php +++ b/tests/dbal/connect_test.php @@ -31,15 +31,23 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case // Failure to connect results in a trigger_error call in dbal. // phpunit converts triggered errors to exceptions. // In particular there should be no fatals here. - try + + + if ($db->get_sql_layer() === 'mysqli') { - $db->sql_connect($config['dbhost'], 'phpbbogus', 'phpbbogus', 'phpbbogus', $config['dbport']); - $this->assertFalse(true); + $this->setExpectedTriggerError(E_WARNING); } - catch (Exception $e) + else if ($db->get_sql_layer() !== 'sqlite3') { - // should have a legitimate message - $this->assertNotEmpty($e->getMessage()); + $this->setExpectedTriggerError(E_USER_ERROR); + } + + // For SQLite3, connection will be successful anyway as phpBB driver uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE flags + $result = $db->sql_connect($config['dbhost'], 'phpbbogus', 'phpbbogus', 'phpbbogus', $config['dbport']); + + if ($db->get_sql_layer() === 'sqlite3') + { + $this->assertTrue($result); } } } diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 5bd0705daa..f6c108cdae 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -404,11 +404,19 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case ->will($this->returnValue(true)); // drop tables - $db_tools->expects($this->exactly(2))->method('schema_drop_table') - ->withConsecutive( - [$this->isInstanceOf(Schema::class), 'dropped_table_1', true], - [$this->isInstanceOf(Schema::class), 'dropped_table_2', true] - ); + $matcher = $this->exactly(2); + $db_tools->expects($matcher)->method('schema_drop_table') + ->willReturnCallback(function() use ($matcher) { + $args = func_get_args(); + $schema = array_shift($args); + $this->assertInstanceOf(\Doctrine\DBAL\Schema\Schema::class, $schema); + match($matcher->numberOfInvocations()) + { + 1 => $this->assertEquals($args, ['dropped_table_1', true]), + 2 => $this->assertEquals($args, ['dropped_table_2', true]), + }; + } + ); $db_tools->perform_schema_changes(array( 'drop_tables' => array( @@ -432,11 +440,18 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case ->will($this->returnValue(true)); // drop columns - $db_tools->expects($this->exactly(2))->method('schema_column_remove') - ->withConsecutive( - [$this->isInstanceOf(Schema::class), 'existing_table', 'dropped_column_1', true], - [$this->isInstanceOf(Schema::class), 'existing_table', 'dropped_column_2', true] - ); + $matcher = $this->exactly(2); + $db_tools->expects($matcher)->method('schema_column_remove') + ->willReturnCallback(function() use ($matcher) { + $args = func_get_args(); + $schema = array_shift($args); + $this->assertInstanceOf(\Doctrine\DBAL\Schema\Schema::class, $schema); + match($matcher->numberOfInvocations()) { + 1 => $this->assertEquals($args, ['existing_table', 'dropped_column_1', true]), + 2 => $this->assertEquals($args, ['existing_table', 'dropped_column_2', true]), + }; + } + ); $db_tools->perform_schema_changes(array( 'drop_columns' => array( diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index 7d8e07560c..36ff57a43d 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -15,7 +15,7 @@ namespace { require_once __DIR__ . '/fixtures/ext/vendor/enabled_4/di/extension.php'; - class phpbb_di_container_test extends \phpbb_test_case + class phpbb_di_create_container_test extends \phpbb_test_case { protected $config_php; @@ -73,7 +73,8 @@ namespace // Checks the construction of a dumped container $container = $this->builder->get_container(); - $this->assertInstanceOf('phpbb_cache_container', $container); + $this->assertEquals('phpbb_cache_container', $container::class); + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Container', $container); $this->assertTrue($container->isCompiled()); } @@ -100,7 +101,8 @@ namespace // Checks the construction of a dumped container $container = $this->builder->get_container(); - $this->assertNotInstanceOf('phpbb_cache_container', $container); + $this->assertNotEquals('phpbb_cache_container', $container::class); + $this->assertEquals('Symfony\Component\DependencyInjection\ContainerBuilder', $container::class); $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); $this->assertTrue($container->isCompiled()); } diff --git a/tests/di/fixtures/config.php b/tests/di/fixtures/config.php index 1e9207d924..956001ef58 100644 --- a/tests/di/fixtures/config.php +++ b/tests/di/fixtures/config.php @@ -1,7 +1,7 @@ db->sql_escape($value); + } + ); $sql = 'SELECT * FROM phpbb_forums WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']); @@ -245,6 +250,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case if (!empty($data['topics'])) { + array_walk($data['topics'], function(&$value, $key) + { + $value = $this->db->sql_escape($value); + } + ); $sql = 'SELECT * FROM phpbb_topics WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']); @@ -262,6 +272,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $post_ids = array(); if (!empty($data['posts'])) { + array_walk($data['posts'], function(&$value, $key) + { + $value = $this->db->sql_escape($value); + } + ); $sql = 'SELECT * FROM phpbb_posts WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']); @@ -276,7 +291,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case } $this->db->sql_freeresult($result); - if (isset($data['attachments'])) + if (isset($data['attachments']) && !empty($post_ids)) { $sql = 'SELECT * FROM phpbb_attachments diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 7e02e62fc4..a225cf3f56 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -23,16 +23,10 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case protected function setUp(): void { parent::setUp(); - $this->purge_cache(); - } - public function __construct($name = null, array $data = array(), $dataName = '') - { - parent::__construct($name, $data, $dataName); - - $this->backupStaticAttributesExcludeList += [ + $this->setBackupStaticPropertiesExcludeList([ 'phpbb_functional_feed_test' => ['init_values'], - ]; + ]); $this->purge_cache(); } diff --git a/tests/functional/ucp_allow_pm_test.php b/tests/functional/ucp_allow_pm_test.php index 6c275ad916..3cdc1d0af6 100644 --- a/tests/functional/ucp_allow_pm_test.php +++ b/tests/functional/ucp_allow_pm_test.php @@ -18,13 +18,13 @@ class phpbb_functional_ucp_allow_pm_test extends phpbb_functional_test_case { protected static $data = array(); - public function __construct() + protected function setUp(): void { - parent::__construct(); + parent::setUp(); - $this->backupStaticAttributesExcludeList += [ + $this->setBackupStaticPropertiesExcludeList([ 'phpbb_functional_ucp_allow_pm_test' => ['data'], - ]; + ]); } // user A sends a PM to user B where B accepts PM diff --git a/tests/functional/visibility_unapproved_posts_test.php b/tests/functional/visibility_unapproved_posts_test.php index 51e5641788..7c14b10a90 100644 --- a/tests/functional/visibility_unapproved_posts_test.php +++ b/tests/functional/visibility_unapproved_posts_test.php @@ -14,7 +14,7 @@ /** * @group functional */ -class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_case +class phpbb_functional_visibility_unapproved_posts_test extends phpbb_functional_test_case { protected $data = []; diff --git a/tests/functions/parse_cfg_file_test.php b/tests/functions/parse_cfg_file_test.php index 017a931f28..22c7c17f68 100644 --- a/tests/functions/parse_cfg_file_test.php +++ b/tests/functions/parse_cfg_file_test.php @@ -11,7 +11,7 @@ * */ -class phpbb_functions_parse_cfg_file extends phpbb_test_case +class phpbb_functions_parse_cfg_file_test extends phpbb_test_case { public function parse_cfg_file_data() { diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index fc52f91347..7c0327eaf6 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/../../phpBB/includes/functions_user.php'; require_once __DIR__ . '/../mock/cache.php'; require_once __DIR__ . '/validate_data_helper.php'; -class phpbb_functions_validate_data_test extends phpbb_database_test_case +class phpbb_functions_validate_username_test extends phpbb_database_test_case { protected $db; protected $cache; diff --git a/tests/functions_acp/build_select_test.php b/tests/functions_acp/build_select_test.php index e59f25e977..3f061a18c8 100644 --- a/tests/functions_acp/build_select_test.php +++ b/tests/functions_acp/build_select_test.php @@ -13,7 +13,7 @@ require_once __DIR__ . '/../../phpBB/includes/functions_acp.php'; -class phpbb_functions_acp_built_select_test extends phpbb_test_case +class phpbb_functions_acp_build_select_test extends phpbb_test_case { protected function setUp(): void { diff --git a/tests/functions_content/get_context_test.php b/tests/functions_content/get_context_test.php index f2865f31ee..3c9dcf3c8d 100644 --- a/tests/functions_content/get_context_test.php +++ b/tests/functions_content/get_context_test.php @@ -124,97 +124,97 @@ class phpbb_functions_content_get_context_test extends TestCase public function data_get_context_unicode(): array { return [ - 'text contains words and length greater than text' => [ + 'text contains words and length greater than text unicode' => [ 'text' => 'Это пример текста, содержащего разнообразные слова, включая пример, текст и слова.', 'words' => ['пример', 'слова'], 'length' => 100, 'expected' => 'Это пример текста, содержащего разнообразные слова, включая пример, текст и слова.', ], - 'text contains words and length less than text' => [ + 'text contains words and length less than text unicode' => [ 'text' => 'Это пример текста, содержащего разнообразные слова, включая шаблон, текст и слова.', 'words' => ['пример', 'слова'], 'length' => 50, 'expected' => 'Это пример текста, содержащего разнообразные слова ...', ], - 'text does not contain words' => [ + 'text does not contain words unicode' => [ 'text' => 'Это пример текста, содержащего разнообразные слова, но ни одно из них не совпадает с искомыми.', 'words' => ['nonexistent'], 'length' => 50, 'expected' => 'Это пример текста, содержащего разнообразные слова ...', ], - 'desired length equal to text length' => [ + 'desired length equal to text length unicode' => [ 'text' => 'Текст точной длины.', 'words' => ['Текст', 'точной'], 'length' => 19, 'expected' => 'Текст точной длины.', ], - 'text with html entities' => [ + 'text with html entities unicode' => [ 'text' => 'Это пример текста, содержащего & и < и > лексемы.', 'words' => ['пример', 'содержащего'], 'length' => 40, 'expected' => 'Это пример текста, содержащего & и < и ...', ], - 'text with html entities and contains last word' => [ + 'text with html entities and contains last word unicode' => [ 'text' => 'Это пример текста, содержащего & и < и > лексемы.', 'words' => ['пример', 'лексемы'], 'length' => 40, 'expected' => 'Это пример текста ... и < и > лексемы.', ], - 'text with multiple spaces and special characters' => [ + 'text with multiple spaces and special characters unicode' => [ 'text' => 'Это пример текста, содержащего разнообразные слова.', 'words' => ['пример', 'разнообразные'], 'length' => 50, 'expected' => 'Это пример текста, содержащего разнообразные слова.', ], - 'empty text' => [ + 'empty text unicode' => [ 'text' => '', 'words' => ['пример', 'слова'], 'length' => 50, 'expected' => '', ], - 'empty words array' => [ + 'empty words array unicode' => [ 'text' => 'Это пример текста, содержащего разнообразные слова.', 'words' => [], 'length' => 50, 'expected' => 'Это пример текста, содержащего разнообразные слова.', ], - 'zero length' => [ + 'zero length unicode' => [ 'text' => 'Это пример текста.', 'words' => ['пример'], 'length' => 0, 'expected' => 'Это пример текста.', ], - 'negative length' => [ + 'negative length unicode' => [ 'text' => 'Это пример текста.', 'words' => ['sample'], 'length' => -10, 'expected' => 'Это пример текста.', ], - 'ellipses_beginning' => [ + 'ellipses_beginning unicode' => [ 'text' => 'раз раз раз раз раз раз раз раз два', 'words' => ['два'], 'length' => 10, 'expected' => '... раз раз два', ], - 'ellipsis_end' => [ + 'ellipsis_end unicode' => [ 'text' => 'два раз раз раз раз раз раз раз раз', 'words' => ['два'], 'length' => 10, 'expected' => 'два раз раз ...', ], - 'ellipsis_middle' => [ + 'ellipsis_middle unicode' => [ 'text' => 'раз слово1 раз раз раз раз раз раз раз раз раз слово2 раз', 'words' => ['слово1', 'слово2'], 'length' => 15, 'expected' => '... слово1 ... слово2 ...', ], - 'ellipsis_middle2' => [ + 'ellipsis_middle2 unicode' => [ 'text' => 'слово1 foo foo foo foo foo foo foo foo foo слово2', 'words' => ['слово1', 'слово2'], 'length' => 10, 'expected' => 'слово1 ... слово2', ], - 'fruits_spanish' => [ + 'fruits_spanish unicode' => [ 'text' => 'Manzana,plátano,naranja,fresa,mango,uva,piña,pera,kiwi,cereza,sandía,melón,papaya,arándano,durazno', 'words' => ['piña'], 'length' => 20, diff --git a/tests/group/helper_test_case.php b/tests/group/helper_test_case.php index f42dd13fa0..1514c616a9 100644 --- a/tests/group/helper_test_case.php +++ b/tests/group/helper_test_case.php @@ -101,7 +101,7 @@ class phpbb_group_helper_test_case extends phpbb_test_case // Set up path helper $path_helper = $this->getMockBuilder('\phpbb\path_helper') ->disableOriginalConstructor() - ->setMethods(array()) + ->onlyMethods(['get_phpbb_root_path', 'get_php_ext', 'update_web_root_path']) ->getMock(); $path_helper->method('get_phpbb_root_path') ->willReturn($phpbb_root_path); diff --git a/tests/help/manager_test.php b/tests/help/manager_test.php index 02695806b6..e079d1e535 100644 --- a/tests/help/manager_test.php +++ b/tests/help/manager_test.php @@ -78,18 +78,20 @@ class phpbb_help_manager_test extends phpbb_test_case $this->language->expects($this->exactly(count($questions)*2 + 1)) ->method('lang') - ->withConsecutive([$block_name], ...$question_ary) - ->will($this->onConsecutiveCalls(strtoupper($block_name), ...$question_ary_upper)); + ->willReturnCallback(fn(string $arg) => strtoupper($arg)); - $this->template->expects($this->exactly(count($questions) + 1)) + $matcher = $this->exactly(count($questions) + 1); + $this->template->expects($matcher) ->method('assign_block_vars') - ->withConsecutive( - ['faq_block', [ - 'BLOCK_TITLE' => strtoupper($block_name), - 'SWITCH_COLUMN' => $switch_expected, - ]], - ...$template_call_args - ); + ->willReturnCallback(function ($arg1, $arg2) use ($matcher, $block_name, $switch_expected, $template_call_args) { + $callNr = $matcher->numberOfInvocations(); + match (true) { + $callNr == 1 => $this->assertEquals([$arg1, $arg2], ['faq_block', [ + 'BLOCK_TITLE' => strtoupper($block_name), + 'SWITCH_COLUMN' => $switch_expected, + ]]), + $callNr > 1 => $this->assertEquals([$arg1, $arg2], $template_call_args[$callNr - 2]), + };}); $this->manager->add_block($block_name, $switch, $questions); @@ -114,11 +116,7 @@ class phpbb_help_manager_test extends phpbb_test_case { $this->language->expects($this->exactly(2)) ->method('lang') - ->withConsecutive( - [$question], - [$answer] - ) - ->will($this->onConsecutiveCalls(strtoupper($question), strtoupper($answer))); + ->willReturnCallback(fn(string $arg) => strtoupper($arg)); $this->template->expects($this->once()) ->method('assign_block_vars') @@ -137,22 +135,23 @@ class phpbb_help_manager_test extends phpbb_test_case $this->language->expects($this->exactly(2)) ->method('lang') - ->withConsecutive([$block_name[0]], [$block_name[1]]) - ->will($this->onConsecutiveCalls(strtoupper($block_name[0]), strtoupper($block_name[1]))); + ->willReturnCallback(fn(string $arg) => strtoupper($arg)); - $this->template->expects($this->exactly(2)) + $matcher = $this->exactly(2); + $this->template->expects($matcher) ->method('assign_block_vars') - ->withConsecutive( - ['faq_block', [ - 'BLOCK_TITLE' => strtoupper($block_name[0]), - 'SWITCH_COLUMN' => $switch_expected[0], - ]], - ['faq_block', [ - 'BLOCK_TITLE' => strtoupper($block_name[1]), - 'SWITCH_COLUMN' => $switch_expected[1], - ]] - - ); + ->willReturnCallback(function ($arg1, $arg2) use ($matcher, $block_name, $switch_expected) { + $callNr = $matcher->numberOfInvocations(); + match (true) { + $callNr == 1 => $this->assertEquals([$arg1, $arg2], ['faq_block', [ + 'BLOCK_TITLE' => strtoupper($block_name[0]), + 'SWITCH_COLUMN' => $switch_expected[0], + ]]), + $callNr == 2 => $this->assertEquals([$arg1, $arg2], ['faq_block', [ + 'BLOCK_TITLE' => strtoupper($block_name[1]), + 'SWITCH_COLUMN' => $switch_expected[1], + ]]), + };}); $this->manager->add_block($block_name[0], true); $this->assertTrue($this->manager->switched_column()); diff --git a/tests/installer/database_helper_test.php b/tests/installer/database_helper_test.php index 03c9152a5b..8fbf3bcc85 100644 --- a/tests/installer/database_helper_test.php +++ b/tests/installer/database_helper_test.php @@ -57,7 +57,7 @@ class phpbb_installer_database_helper_test extends phpbb_test_case public function test_validate_table_prefix($expected, $test_string) { $db_helper_mock = $this->getMockBuilder('\phpbb\install\helper\database') - ->setMethods(array('get_available_dbms')) + ->onlyMethods(array('get_available_dbms')) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/installer/installer_config_test.php b/tests/installer/installer_config_test.php index 9b08dc3b26..5e19a9d640 100644 --- a/tests/installer/installer_config_test.php +++ b/tests/installer/installer_config_test.php @@ -25,9 +25,9 @@ class phpbb_installer_config_test extends phpbb_test_case $phpbb_root_path = __DIR__ . './../../phpBB/'; $filesystem = $this->createMock('\phpbb\filesystem\filesystem'); $php_ini = $this->getMockBuilder('\bantu\IniGetWrapper\IniGetWrapper') - ->setMethods(array('getInt', 'getBytes')) + ->onlyMethods(array('getNumeric', 'getBytes')) ->getMock(); - $php_ini->method('getInt') + $php_ini->method('getNumeric') ->willReturn(-1); $php_ini->method('getBytes') ->willReturn(-1); diff --git a/tests/mention/controller_test.php b/tests/mention/controller_test.php index 664ab2bc92..803b2d2b6a 100644 --- a/tests/mention/controller_test.php +++ b/tests/mention/controller_test.php @@ -546,13 +546,13 @@ class phpbb_mention_controller_test extends phpbb_database_test_case { $this->request->expects($this->atLeast(2)) ->method('variable') - ->withConsecutive( - ['keyword', '', true], - ['topic_id', 0]) - ->willReturnOnConsecutiveCalls( - $keyword, - $topic_id - ); + ->willReturnCallback(function() use ($keyword, $topic_id) { + $args = func_get_args(); + return match($args) { + ['keyword', '', true, \phpbb\request\request_interface::REQUEST] => $keyword, + ['topic_id', 0, false, \phpbb\request\request_interface::REQUEST] => $topic_id, + };}); + $data = json_decode($this->controller->handle()->getContent(), true); $this->assertEquals($expected_result, $data); } diff --git a/tests/notification/notification_method_email_test.php b/tests/notification/notification_method_email_test.php index 6400c8bb1d..0984967304 100644 --- a/tests/notification/notification_method_email_test.php +++ b/tests/notification/notification_method_email_test.php @@ -120,7 +120,7 @@ class notification_method_email_test extends phpbb_tests_notification_base $phpbb_container->getParameter('tables.notification_emails'), $phpbb_container->get('messenger.method_collection') ]) - ->setMethods(['notify_using_messenger']) + ->onlyMethods(['notify_using_messenger']) ->getMock(); $notification_method_email = $this->notification_method_email; diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 51da57c278..a84dc0d079 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -11,7 +11,7 @@ * */ -class phpbb_passwords_helper_test extends \phpbb_test_case +class phpbb_passwords_drivers_test extends \phpbb_test_case { /** @var array */ protected $passwords_drivers = []; diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php index 5c41b33b97..dc89e1ca92 100644 --- a/tests/path_helper/path_helper_test.php +++ b/tests/path_helper/path_helper_test.php @@ -112,7 +112,7 @@ class phpbb_path_helper_test extends phpbb_test_case 'php', 'adm/' ]) - ->setMethods(['get_web_root_path']) + ->onlyMethods(['get_web_root_path']) ->getMock(); $path_helper->method('get_web_root_path') ->willReturn('/var/www/phpbb/app.php/'); @@ -257,7 +257,7 @@ class phpbb_path_helper_test extends phpbb_test_case 'php', 'adm/' ]) - ->setMethods(['get_web_root_path']) + ->onlyMethods(['get_web_root_path']) ->getMock(); $path_helper->method('get_web_root_path') ->willReturn('/var/www/phpbb/'); @@ -462,7 +462,7 @@ class phpbb_path_helper_test extends phpbb_test_case { $symfony_request = $this->getMockBuilder('\phpbb\symfony_request') ->setConstructorArgs([new phpbb_mock_request()]) - ->setMethods(['get', 'getSchemeAndHttpHost', 'getBasePath', 'getPathInfo']) + ->onlyMethods(['get', 'getSchemeAndHttpHost', 'getBasePath', 'getPathInfo']) ->getMock(); $symfony_request->method('getSchemeAndHttpHost') ->willReturn('http://www.phpbb.com'); @@ -630,7 +630,7 @@ class phpbb_path_helper_test extends phpbb_test_case { $symfony_request = $this->getMockBuilder('\phpbb\symfony_request') ->setConstructorArgs([new phpbb_mock_request()]) - ->setMethods(['getScriptName']) + ->onlyMethods(['getScriptName']) ->getMock(); $symfony_request->method('getScriptName') ->willReturn($script_name); diff --git a/tests/plupload/plupload_test.php b/tests/plupload/plupload_test.php index 206029d8b8..6080220c32 100644 --- a/tests/plupload/plupload_test.php +++ b/tests/plupload/plupload_test.php @@ -113,7 +113,7 @@ class phpbb_plupload_test extends phpbb_test_case $config = new \phpbb\config\config([]); $ini_wrapper = $this->getMockBuilder('\bantu\IniGetWrapper\IniGetWrapper') - ->setMethods(['getBytes']) + ->onlyMethods(['getBytes']) ->getMock(); $ini_wrapper->method('getBytes') ->will($this->returnValueMap([ diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index cfdec04eda..6736fc6732 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -33,12 +33,12 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case ->will($this->returnCallback(array($this, 'return_callback_implode'))); $lang = $this->getMockBuilder('\phpbb\profilefields\lang_helper') - ->setMethods(array('get_options_lang', 'is_set', 'get')) + ->onlyMethods(array('load_option_lang', 'is_set', 'get')) ->setConstructorArgs(array($db, LANG_TABLE)) ->getMock(); $lang->expects($this->any()) - ->method('get_options_lang'); + ->method('load_option_lang'); $lang->expects($this->any()) ->method('is_set') diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index 8919fbb6a4..e19364a459 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -35,12 +35,12 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case $template = $this->createMock('\phpbb\template\template'); $lang = $this->getMockBuilder('\phpbb\profilefields\lang_helper') - ->setMethods(array('get_options_lang', 'is_set', 'get')) + ->onlyMethods(array('load_option_lang', 'is_set', 'get')) ->setConstructorArgs(array($db, LANG_TABLE)) ->getMock(); $lang->expects($this->any()) - ->method('get_options_lang'); + ->method('load_option_lang'); $lang->expects($this->any()) ->method('is_set') diff --git a/tests/session/session_key_test.php b/tests/session/session_login_keys_test.php similarity index 100% rename from tests/session/session_key_test.php rename to tests/session/session_login_keys_test.php diff --git a/tests/template/asset_test.php b/tests/template/asset_test.php index 8467732bda..0588312c0d 100644 --- a/tests/template/asset_test.php +++ b/tests/template/asset_test.php @@ -35,7 +35,7 @@ class phpbb_template_asset_test extends phpbb_test_case { $path_helper = $this->getMockBuilder('\phpbb\path_helper') ->disableOriginalConstructor() - ->setMethods(array()) + ->onlyMethods(['get_phpbb_root_path']) ->getMock(); $path_helper->method('get_phpbb_root_path') diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index 085caae330..e71c8f9ef8 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -38,7 +38,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $user->data['user_id'] = 2; $auth = $this->getMockBuilder('phpbb\auth\auth') ->disableOriginalConstructor() - ->setMethods(['acl_get']) + ->onlyMethods(['acl_get']) ->getMock(); $auth->method('acl_get') ->willReturn(true); diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 76e77add44..6da764adfb 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -34,25 +34,6 @@ abstract class phpbb_database_test_case extends TestCase */ private $db_connections_doctrine; - public function __construct($name = NULL, array $data = [], $dataName = '') - { - parent::__construct($name, $data, $dataName); - - $this->backupStaticAttributesExcludeList += [ - 'SebastianBergmann\CodeCoverage\CodeCoverage' => ['instance'], - 'SebastianBergmann\CodeCoverage\Filter' => ['instance'], - 'SebastianBergmann\CodeCoverage\Util' => ['ignoredLines', 'templateMethods'], - 'SebastianBergmann\Timer\Timer' => ['startTimes'], - 'PHP_Token_Stream' => ['customTokens'], - 'PHP_Token_Stream_CachingFactory' => ['cache'], - - 'phpbb_database_test_case' => ['already_connected'], - ]; - - $this->db_connections = []; - $this->db_connections_doctrine = []; - } - /** * @return array List of extensions that should be set up */ @@ -135,6 +116,20 @@ abstract class phpbb_database_test_case extends TestCase { parent::setUp(); + $this->setBackupStaticPropertiesExcludeList([ + 'SebastianBergmann\CodeCoverage\CodeCoverage' => ['instance'], + 'SebastianBergmann\CodeCoverage\Filter' => ['instance'], + 'SebastianBergmann\CodeCoverage\Util' => ['ignoredLines', 'templateMethods'], + 'SebastianBergmann\Timer\Timer' => ['startTimes'], + 'PHP_Token_Stream' => ['customTokens'], + 'PHP_Token_Stream_CachingFactory' => ['cache'], + + 'phpbb_database_test_case' => ['already_connected'], + ]); + + $this->db_connections = []; + $this->db_connections_doctrine = []; + // Resynchronise tables if a fixture was loaded if (isset($this->fixture_xml_data)) { diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index ebe7c15f81..9e7e0e4679 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -87,6 +87,10 @@ class phpbb_functional_test_case extends phpbb_test_case { parent::setUp(); + $this->setBackupStaticPropertiesExcludeList([ + 'phpbb_functional_test_case' => ['config', 'already_installed'], + ]); + if (!self::$install_success) { $this->fail('Installing phpBB has failed.'); @@ -97,6 +101,9 @@ class phpbb_functional_test_case extends phpbb_test_case self::$cookieJar = new CookieJar; // Force native client on windows platform self::$http_client = strtolower(substr(PHP_OS, 0, 3)) === 'win' ? new NativeHttpClient() : HttpClient::create(); + self::$http_client->withOptions([ + 'timeout' => 60, + ]); self::$client = new HttpBrowser(self::$http_client, null, self::$cookieJar); // Clear the language array so that things @@ -216,15 +223,6 @@ class phpbb_functional_test_case extends phpbb_test_case { } - public function __construct($name = NULL, array $data = [], $dataName = '') - { - parent::__construct($name, $data, $dataName); - - $this->backupStaticAttributesExcludeList += [ - 'phpbb_functional_test_case' => ['config', 'already_installed'], - ]; - } - /** * @return \phpbb\db\driver\driver_interface */ @@ -307,7 +305,7 @@ class phpbb_functional_test_case extends phpbb_test_case $container->set('event_dispatcher', $phpbb_dispatcher); $cache = $this->getMockBuilder('\phpbb\cache\service') ->setConstructorArgs([$this->get_cache_driver(), $config, $this->db, $phpbb_dispatcher, $phpbb_root_path, $phpEx]) - ->setMethods(['deferred_purge']) + ->onlyMethods(['deferred_purge']) ->getMock(); $cache->method('deferred_purge') ->willReturnCallback([$cache, 'purge']); @@ -550,7 +548,15 @@ class phpbb_functional_test_case extends phpbb_test_case $iohandler->set_input('script_path', $parseURL['path']); $iohandler->set_input('submit_server', 'submit'); - $installer->run(); + try + { + $installer->run(); + } + catch (\Throwable $e) + { + // Do nothing but catch the exception as PHPUnit here throws + // "PHPUnit\Event\Code\NoTestCaseObjectOnCallStackException: Cannot find TestCase object on call stack" + } copy($config_file, $config_file_test); @@ -568,7 +574,10 @@ class phpbb_functional_test_case extends phpbb_test_case } global $phpbb_container; - $phpbb_container->reset(); + if (!empty($phpbb_container)) + { + $phpbb_container->reset(); + } // Purge cache to remove cached files $phpbb_container = new phpbb_mock_container_builder(); diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php index 11f9020e4f..8c4bf5c1d7 100644 --- a/tests/test_framework/phpbb_test_case.php +++ b/tests/test_framework/phpbb_test_case.php @@ -17,11 +17,9 @@ class phpbb_test_case extends TestCase { protected $test_case_helpers; - public function __construct($name = NULL, array $data = array(), $dataName = '') + protected function setUp(): void { - parent::__construct($name, $data, $dataName); - - $this->backupStaticAttributesExcludeList += [ + $this->setBackupStaticPropertiesExcludeList([ 'SebastianBergmann\CodeCoverage\CodeCoverage' => ['instance'], 'SebastianBergmann\CodeCoverage\Filter' => ['instance'], 'SebastianBergmann\CodeCoverage\Util' => ['ignoredLines', 'templateMethods'], @@ -30,7 +28,7 @@ class phpbb_test_case extends TestCase 'PHP_Token_Stream_CachingFactory' => ['cache'], 'phpbb_database_test_case' => ['already_connected', 'last_post_timestamp'], - ]; + ]); } public function get_test_case_helpers() diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index d3adcceedd..bd5ffc5505 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -434,7 +434,7 @@ class phpbb_test_case_helpers ->disallowMockingUnknownTypes() ->getMock(); $mb = $this->test_case->getMockBuilder('phpbb\\textformatter\\data_access'); - $mb->setMethods(array('get_bbcodes', 'get_censored_words', 'get_smilies', 'get_styles')); + $mb->onlyMethods(array('get_bbcodes', 'get_censored_words', 'get_smilies', 'get_styles')); $mb->setConstructorArgs(array( $db_driver, 'phpbb_bbcodes', @@ -488,7 +488,7 @@ class phpbb_test_case_helpers { $path_helper = $this->test_case->getMockBuilder('phpbb\\path_helper') ->disableOriginalConstructor() - ->setMethods(array('get_web_root_path')) + ->onlyMethods(array('get_web_root_path')) ->getMock(); $path_helper->expects($this->test_case->any()) ->method('get_web_root_path') @@ -578,7 +578,7 @@ class phpbb_test_case_helpers $user = $this->test_case->getMockBuilder('\phpbb\user') ->setConstructorArgs(array($lang, '\phpbb\datetime')) - ->setMethods(array('format_date')) + ->onlyMethods(array('format_date')) ->getMock(); $user->expects($this->test_case->any()) ->method('format_date') diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 5300b4c52d..b62a21106e 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -296,14 +296,19 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case public function test_configure_events() { $this->dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); + $matcher = $this->exactly(2); $this->dispatcher - ->expects($this->exactly(2)) + ->expects($matcher) ->method('trigger_event') - ->withConsecutive( - ['core.text_formatter_s9e_configure_before', $this->callback(array($this, 'configure_event_callback'))], - ['core.text_formatter_s9e_configure_after', $this->callback(array($this, 'configure_event_callback'))] - ) - ->will($this->returnArgument(1)); + ->willReturnCallback(function($event, $vars) use ($matcher) { + $callNr = $matcher->numberOfInvocations(); + match($callNr) { + 1 => $this->assertEquals('core.text_formatter_s9e_configure_before', $event), + 2 => $this->assertEquals('core.text_formatter_s9e_configure_after', $event), + }; + $this->assertTrue($this->configure_event_callback($vars)); + return $vars; + }); $this->get_factory()->get_configurator(); } diff --git a/tests/text_formatter/s9e/parser_test.php b/tests/text_formatter/s9e/parser_test.php index ef9a1184ee..ab48f1d20e 100644 --- a/tests/text_formatter/s9e/parser_test.php +++ b/tests/text_formatter/s9e/parser_test.php @@ -101,20 +101,19 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case public function test_options($adapter_method, $adapter_arg, $concrete_method, $concrete_arg) { $mock = $this->getMockBuilder('s9e\\TextFormatter\\Parser') - ->setMethods([$concrete_method]) + ->onlyMethods([$concrete_method]) ->disableOriginalConstructor() ->getMock(); $concrete_args = (array) $concrete_arg; - array_walk($concrete_args, function(&$value) - { - $value = (array) $value; - } - ); - $mock->expects($this->exactly(count($concrete_args))) + $matcher = $this->exactly(count($concrete_args)); + $mock->expects($matcher) ->method($concrete_method) - ->withConsecutive(...$concrete_args); - + ->willReturnCallback(function ($arg) use ($concrete_args, $matcher) { + $callNr = $matcher->numberOfInvocations(); + $this->assertEquals($arg, $concrete_args[$callNr - 1]); + }); + $cache = new phpbb_mock_cache; $cache->put('_foo_parser', $mock); @@ -219,15 +218,22 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case $dispatcher ); + $matcher = $this->exactly(2); $dispatcher - ->expects($this->exactly(2)) + ->expects($matcher) ->method('trigger_event') - ->withConsecutive( - ['core.text_formatter_s9e_parse_before', $this->callback(array($this, 'parse_before_event_callback'))], - ['core.text_formatter_s9e_parse_after', $this->callback(array($this, 'parse_after_event_callback'))] - ) - ->will($this->returnArgument(1)); - + ->willReturnCallback(function($event, $vars) use ($matcher) { + $callNr = $matcher->numberOfInvocations(); + match($callNr) { + 1 => $this->assertEquals('core.text_formatter_s9e_parse_before', $event), + 2 => $this->assertEquals('core.text_formatter_s9e_parse_after', $event), + }; + match($callNr) { + 1 => $this->assertTrue($this->parse_before_event_callback($vars)), + 2 => $this->assertTrue($this->parse_after_event_callback($vars)), + }; + return $vars; + }); $parser->parse('...'); } diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php index 51f4f923b4..d495bf5191 100644 --- a/tests/text_formatter/s9e/renderer_test.php +++ b/tests/text_formatter/s9e/renderer_test.php @@ -421,15 +421,22 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $dispatcher ); + $matcher = $this->exactly(2); $dispatcher - ->expects($this->exactly(2)) + ->expects($matcher) ->method('trigger_event') - ->withConsecutive( - ['core.text_formatter_s9e_render_before', $this->callback(array($this, 'render_before_event_callback'))], - ['core.text_formatter_s9e_render_after', $this->callback(array($this, 'render_after_event_callback'))] - ) - ->will($this->returnArgument(1)); - + ->willReturnCallback(function($event, $vars) use ($matcher) { + $callNr = $matcher->numberOfInvocations(); + match($callNr) { + 1 => $this->assertEquals('core.text_formatter_s9e_render_before', $event), + 2 => $this->assertEquals('core.text_formatter_s9e_render_after', $event), + }; + match($callNr) { + 1 => $this->assertTrue($this->render_before_event_callback($vars)), + 2 => $this->assertTrue($this->render_after_event_callback($vars)), + }; + return $vars; + }); $renderer->render('...'); } diff --git a/tests/tree/nestedset_forum_insert_delete_test.php b/tests/tree/nestedset_forum_add_remove_test.php similarity index 100% rename from tests/tree/nestedset_forum_insert_delete_test.php rename to tests/tree/nestedset_forum_add_remove_test.php diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php index e9c5a22cf0..b138ff4aff 100644 --- a/tests/version/version_fetch_test.php +++ b/tests/version/version_fetch_test.php @@ -14,7 +14,7 @@ /* * @group slow */ -class phpbb_version_helper_fetch_test extends phpbb_test_case +class phpbb_version_fetch_test extends phpbb_test_case { protected $cache, $version_helper; diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php index 1c616bc1fd..73ea472df1 100644 --- a/tests/version/version_helper_remote_test.php +++ b/tests/version/version_helper_remote_test.php @@ -41,7 +41,7 @@ class version_helper_remote_test extends \phpbb_test_case $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $db = new \phpbb\db\driver\factory($container); $this->cache = $this->getMockBuilder('\phpbb\cache\service') - ->setMethods(array('get')) + ->addMethods(array('get')) ->setConstructorArgs(array(new \phpbb\cache\driver\dummy(), $config, $db, $phpbb_dispatcher, '../../', 'php')) ->getMock(); diff --git a/tests/version/version_test.php b/tests/version/version_helper_test.php similarity index 99% rename from tests/version/version_test.php rename to tests/version/version_helper_test.php index f162d12d44..9a44173314 100644 --- a/tests/version/version_test.php +++ b/tests/version/version_helper_test.php @@ -208,7 +208,7 @@ class phpbb_version_helper_test extends phpbb_test_case $version_helper = $this ->getMockBuilder('\phpbb\version_helper') - ->setMethods(array( + ->onlyMethods(array( 'get_versions_matching_stability', )) ->setConstructorArgs(array( @@ -324,7 +324,7 @@ class phpbb_version_helper_test extends phpbb_test_case $version_helper = $this ->getMockBuilder('\phpbb\version_helper') - ->setMethods(array( + ->onlyMethods(array( 'get_versions_matching_stability', )) ->setConstructorArgs(array( @@ -581,7 +581,7 @@ class phpbb_version_helper_test extends phpbb_test_case $version_helper = $this ->getMockBuilder('\phpbb\version_helper') - ->setMethods(array( + ->onlyMethods(array( 'get_versions_matching_stability', )) ->setConstructorArgs(array( @@ -958,7 +958,7 @@ class phpbb_version_helper_test extends phpbb_test_case $version_helper = $this ->getMockBuilder('\phpbb\version_helper') - ->setMethods(array( + ->onlyMethods(array( 'get_versions_matching_stability', )) ->setConstructorArgs(array(