From 368913fded88ec4203c2c7053a0fa93dad6ba67f Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Wed, 12 Aug 2026 22:42:29 -0300 Subject: [PATCH 1/8] Migra a suite para PHPUnit 13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPUnit 13 exige PHP >= 8.4.1 e endurece a API de test doubles. Três frentes quebravam a suite: - TestCase::any() virou hard-deprecation (removida na 14). Os 121 sites que só configuravam retorno viraram stub simples ($mock->method()), via RemoveExpectAnyFromMockRector. Os 14 que também usavam with() foram revistos à mão, virando atLeastOnce()/once()/never() conforme o corpo do teste. - Os doubles apoiados em CakeStubTrait (CakeRequest/CakeResponse) não expõem o atalho method() do PHPUnit: CakeRequest declara um method() real, que é justamente a razão de esses casos usarem um stub escrito à mão em vez de um mock gerado. Para eles ficou expects() com o novo matcher anyInvocation(), que exprime "zero ou mais" sem passar pela API deprecada. - Um método dublado aceita uma única configuração de with(), o que inviabiliza o encadeamento at(N)->method()->with(). O shim at() passou a receber as expectativas de argumento e as verifica em invokedDo(), onde o nome do método já casou; 314 sites convertidos. O CI perde o leg de PHP 8.3 — o framework continua declarando >=8.3, mas o PHPUnit 13 não instala nessa versão. Suite: 3976 testes, 0 falhas, 0 deprecations do PHPUnit. --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- composer.lock | 685 ++++++++++++------ .../Case/Console/Command/SchemaShellTest.php | 10 +- .../Command/Task/ControllerTaskTest.php | 52 +- .../Console/Command/Task/DbConfigTaskTest.php | 7 +- .../Console/Command/Task/ExtractTaskTest.php | 8 +- .../Console/Command/Task/FixtureTaskTest.php | 64 +- .../Console/Command/Task/ModelTaskTest.php | 115 ++- .../Console/Command/Task/PluginTaskTest.php | 22 +- .../Console/Command/Task/TemplateTaskTest.php | 2 +- .../Console/Command/Task/TestTaskTest.php | 20 +- .../Console/Command/Task/ViewTaskTest.php | 155 ++-- .../Test/Case/Console/ConsoleOutputTest.php | 9 +- lib/Cake/Test/Case/Console/ShellTest.php | 4 +- .../Component/Auth/ActionsAuthorizeTest.php | 2 +- .../Auth/ControllerAuthorizeTest.php | 2 +- .../Component/Auth/CrudAuthorizeTest.php | 2 +- .../Component/AuthComponentTest.php | 10 +- .../Component/PaginatorComponentTest.php | 30 +- .../Component/RequestHandlerComponentTest.php | 45 +- .../Component/SecurityComponentTest.php | 2 +- .../Test/Case/Controller/ControllerTest.php | 32 +- .../Test/Case/Error/ExceptionRendererTest.php | 8 +- .../Test/Case/Event/CakeEventManagerTest.php | 21 +- .../Test/Case/Log/Engine/SyslogLogTest.php | 4 +- .../Model/Behavior/TranslateBehaviorTest.php | 4 +- .../Case/Model/Datasource/DataSourceTest.php | 6 +- .../Model/Datasource/Database/MysqlTest.php | 81 +-- .../Datasource/Database/PostgresTest.php | 12 +- .../Case/Model/Datasource/DboSourceTest.php | 24 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 2 +- .../Validator/CakeValidationRuleTest.php | 2 +- .../Test/Case/Network/CakeResponseTest.php | 368 +++++----- .../Case/Network/Email/MailTransportTest.php | 2 +- .../Case/Network/Email/SmtpTransportTest.php | 90 +-- .../Test/Case/Network/Http/HttpSocketTest.php | 178 ++--- .../Case/TestSuite/ControllerTestCaseTest.php | 2 +- .../Fixture/CakeFixtureManagerTest.php | 3 +- .../Case/Utility/ObjectCollectionTest.php | 6 +- .../Test/Case/View/Helper/HtmlHelperTest.php | 55 +- .../Test/Case/View/Helper/JsHelperTest.php | 36 +- lib/Cake/Test/Case/View/MediaViewTest.php | 2 +- lib/Cake/Test/Case/View/ViewTest.php | 56 +- lib/Cake/TestSuite/CakeTestCase.php | 63 +- lib/Cake/TestSuite/ControllerTestCase.php | 10 +- phpunit.xml | 2 +- 47 files changed, 1191 insertions(+), 1128 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1018b98..eb58215 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.4', '8.5'] db: ['sqlite', 'mysql'] steps: - uses: niden/actions-memcached@v7 diff --git a/composer.json b/composer.json index 07d3fb7..3d1a9de 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "rector/rector": "^0.12.5", - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "config": { "vendor-dir": "vendors/", diff --git a/composer.lock b/composer.lock index 89117e8..affb419 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2029bac8c297867db747d4637e87388e", + "content-hash": "8dff65c7beb68fe94b463f6b8c0a4b0c", "packages": [], "packages-dev": [ { "name": "myclabs/deep-copy", - "version": "1.13.4", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", - "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.0" }, "conflict": { "doctrine/collections": "<1.6.8", @@ -57,32 +57,31 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/mnapoli", + "type": "github" } ], - "time": "2025-08-01T08:46:24+00:00" + "time": "2026-08-11T10:17:44+00:00" }, { "name": "nikic/php-parser", - "version": "v5.7.0", + "version": "v5.8.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "shasum": "" }, "require": { - "ext-ctype": "*", "ext-json": "*", "ext-tokenizer": "*", "php": ">=7.4" @@ -121,9 +120,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" }, - "time": "2025-12-06T11:56:16+00:00" + "time": "2026-07-04T14:30:18+00:00" }, { "name": "phar-io/manifest", @@ -303,33 +302,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "12.5.6", + "version": "14.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "876099a072646c7745f673d7aeab5382c4439691" + "reference": "060a5c93e81afb01e97dbe8930a5d0c9bd46e54e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/876099a072646c7745f673d7aeab5382c4439691", - "reference": "876099a072646c7745f673d7aeab5382c4439691", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/060a5c93e81afb01e97dbe8930a5d0c9bd46e54e", + "reference": "060a5c93e81afb01e97dbe8930a5d0c9bd46e54e", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^5.7.0", - "php": ">=8.3", - "phpunit/php-text-template": "^5.0", - "sebastian/complexity": "^5.0", - "sebastian/environment": "^8.0.3", - "sebastian/lines-of-code": "^4.0", - "sebastian/version": "^6.0", + "nikic/php-parser": "^5.8.0", + "php": ">=8.4", + "phpunit/php-text-template": "^6.0", + "sebastian/complexity": "^6.0", + "sebastian/environment": "^9.3.2", + "sebastian/git-state": "^1.0", + "sebastian/lines-of-code": "^5.0.2", + "sebastian/version": "^7.0", "theseer/tokenizer": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.1" + "phpunit/phpunit": "^13.3" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -338,7 +339,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5.x-dev" + "dev-main": "14.3.x-dev" } }, "autoload": { @@ -367,7 +368,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/12.5.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.3.0" }, "funding": [ { @@ -387,32 +388,32 @@ "type": "tidelift" } ], - "time": "2026-04-15T08:23:17+00:00" + "time": "2026-08-07T07:24:15+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "6.0.1", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5" + "reference": "3ccaa29123548190af12fee7af078dcd7f3ddfab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3ccaa29123548190af12fee7af078dcd7f3ddfab", + "reference": "3ccaa29123548190af12fee7af078dcd7f3ddfab", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -440,7 +441,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.1" }, "funding": [ { @@ -460,28 +461,28 @@ "type": "tidelift" } ], - "time": "2026-02-02T14:04:18+00:00" + "time": "2026-08-10T06:43:12+00:00" }, { "name": "phpunit/php-invoker", - "version": "6.0.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "suggest": { "ext-pcntl": "*" @@ -489,7 +490,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -516,40 +517,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" }, "funding": [ { "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/php-invoker", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:58+00:00" + "time": "2026-02-06T04:34:47+00:00" }, { "name": "phpunit/php-text-template", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" + "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", - "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/a47af19f93f76aa3368303d752aa5272ca3299f4", + "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -576,40 +589,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.0" }, "funding": [ { "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/php-text-template", + "type": "tidelift" } ], - "time": "2025-02-07T04:59:16+00:00" + "time": "2026-02-06T04:36:37+00:00" }, { "name": "phpunit/php-timer", - "version": "8.0.0", + "version": "9.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -636,56 +661,70 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" + "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" }, "funding": [ { "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/php-timer", + "type": "tidelift" } ], - "time": "2025-02-07T04:59:38+00:00" + "time": "2026-02-06T04:37:53+00:00" }, { "name": "phpunit/phpunit", - "version": "12.5.25", + "version": "13.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333" + "reference": "346fcba6ce7ab89bb1b0675feac6bc29c0f7711b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/792c2980442dfce319226b88fa845b8b6de3b333", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/346fcba6ce7ab89bb1b0675feac6bc29c0f7711b", + "reference": "346fcba6ce7ab89bb1b0675feac6bc29c0f7711b", "shasum": "" }, "require": { "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=8.3", - "phpunit/php-code-coverage": "^12.5.6", - "phpunit/php-file-iterator": "^6.0.1", - "phpunit/php-invoker": "^6.0.0", - "phpunit/php-text-template": "^5.0.0", - "phpunit/php-timer": "^8.0.0", - "sebastian/cli-parser": "^4.2.0", - "sebastian/comparator": "^7.1.6", - "sebastian/diff": "^7.0.0", - "sebastian/environment": "^8.1.0", - "sebastian/exporter": "^7.0.2", - "sebastian/global-state": "^8.0.2", - "sebastian/object-enumerator": "^7.0.0", - "sebastian/recursion-context": "^7.0.1", - "sebastian/type": "^6.0.3", - "sebastian/version": "^6.0.0", + "php": ">=8.4.1", + "phpunit/php-code-coverage": "^14.3", + "phpunit/php-file-iterator": "^7.0.0", + "phpunit/php-invoker": "^7.0.0", + "phpunit/php-text-template": "^6.0.0", + "phpunit/php-timer": "^9.0.0", + "sebastian/cli-parser": "^5.0.1", + "sebastian/comparator": "^8.4", + "sebastian/diff": "^9.0", + "sebastian/environment": "^9.3.2", + "sebastian/exporter": "^8.2.1", + "sebastian/file-filter": "^1.0", + "sebastian/git-state": "^1.0", + "sebastian/global-state": "^9.0.1", + "sebastian/object-enumerator": "^8.0.0", + "sebastian/recursion-context": "^8.0.1", + "sebastian/type": "^7.0.1", + "sebastian/version": "^7.0.0", "staabm/side-effects-detector": "^1.0.5" }, "bin": [ @@ -694,7 +733,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5-dev" + "dev-main": "13.3-dev" } }, "autoload": { @@ -726,7 +765,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.25" + "source": "https://github.com/sebastianbergmann/phpunit/tree/13.3.0" }, "funding": [ { @@ -734,7 +773,7 @@ "type": "other" } ], - "time": "2026-05-13T03:56:57+00:00" + "time": "2026-08-07T07:37:01+00:00" }, { "name": "rector/rector", @@ -798,28 +837,28 @@ }, { "name": "sebastian/cli-parser", - "version": "4.2.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04" + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.2-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -843,7 +882,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" }, "funding": [ { @@ -863,31 +902,31 @@ "type": "tidelift" } ], - "time": "2025-09-14T09:36:45+00:00" + "time": "2026-08-01T04:27:14+00:00" }, { "name": "sebastian/comparator", - "version": "7.1.6", + "version": "8.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "c769009dee98f494e0edc3fd4f4087501688f11e" + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c769009dee98f494e0edc3fd4f4087501688f11e", - "reference": "c769009dee98f494e0edc3fd4f4087501688f11e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/diff": "^7.0", - "sebastian/exporter": "^7.0" + "php": ">=8.4", + "sebastian/diff": "^9.0", + "sebastian/exporter": "^8.2" }, "require-dev": { - "phpunit/phpunit": "^12.2" + "phpunit/phpunit": "^13.3" }, "suggest": { "ext-bcmath": "For comparing BcMath\\Number objects" @@ -895,7 +934,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "7.1-dev" + "dev-main": "8.4-dev" } }, "autoload": { @@ -935,7 +974,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" }, "funding": [ { @@ -955,33 +994,33 @@ "type": "tidelift" } ], - "time": "2026-04-14T08:23:15+00:00" + "time": "2026-08-07T07:23:13+00:00" }, { "name": "sebastian/complexity", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" + "reference": "c5651c795c98093480df79350cb050813fc7a2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", + "reference": "c5651c795c98093480df79350cb050813fc7a2f3", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1005,41 +1044,53 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" }, "funding": [ { "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/sebastian/complexity", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:25+00:00" + "time": "2026-02-06T04:41:32+00:00" }, { "name": "sebastian/diff", - "version": "7.0.0", + "version": "9.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + "reference": "a3fb6a298a265ff487a91bbea46e03cd01dbb226" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a3fb6a298a265ff487a91bbea46e03cd01dbb226", + "reference": "a3fb6a298a265ff487a91bbea46e03cd01dbb226", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0", - "symfony/process": "^7.2" + "phpunit/phpunit": "^13.2", + "symfony/process": "^7.4.13" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -1072,35 +1123,47 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/diff/tree/9.0.0" }, "funding": [ { "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/sebastian/diff", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:46+00:00" + "time": "2026-06-05T03:04:51+00:00" }, { "name": "sebastian/environment", - "version": "8.1.0", + "version": "9.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b121608b28a13f721e76ffbbd386d08eff58f3f6" + "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b121608b28a13f721e76ffbbd386d08eff58f3f6", - "reference": "b121608b28a13f721e76ffbbd386d08eff58f3f6", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", + "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.1.11" }, "suggest": { "ext-posix": "*" @@ -1108,7 +1171,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "8.1-dev" + "dev-main": "9.3-dev" } }, "autoload": { @@ -1136,7 +1199,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/8.1.0" + "source": "https://github.com/sebastianbergmann/environment/tree/9.3.2" }, "funding": [ { @@ -1156,34 +1219,34 @@ "type": "tidelift" } ], - "time": "2026-04-15T12:13:01+00:00" + "time": "2026-05-25T13:41:38+00:00" }, { "name": "sebastian/exporter", - "version": "7.0.2", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "016951ae10980765e4e7aee491eb288c64e505b7" + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/016951ae10980765e4e7aee491eb288c64e505b7", - "reference": "016951ae10980765e4e7aee491eb288c64e505b7", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/recursion-context": "^7.0" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.2-dev" } }, "autoload": { @@ -1226,7 +1289,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.2" + "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" }, "funding": [ { @@ -1246,35 +1309,173 @@ "type": "tidelift" } ], - "time": "2025-09-24T06:16:11+00:00" + "time": "2026-08-07T07:22:06+00:00" + }, + { + "name": "sebastian/file-filter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/file-filter.git", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for filtering files", + "homepage": "https://github.com/sebastianbergmann/file-filter", + "support": { + "issues": "https://github.com/sebastianbergmann/file-filter/issues", + "security": "https://github.com/sebastianbergmann/file-filter/security/policy", + "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" + }, + "funding": [ + { + "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/sebastian/file-filter", + "type": "tidelift" + } + ], + "time": "2026-04-22T07:20:04+00:00" + }, + { + "name": "sebastian/git-state", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/git-state.git", + "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/792a952e0eba55b6960a48aeceb9f371aad1f76b", + "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for describing the state of a Git checkout", + "homepage": "https://github.com/sebastianbergmann/git-state", + "support": { + "issues": "https://github.com/sebastianbergmann/git-state/issues", + "security": "https://github.com/sebastianbergmann/git-state/security/policy", + "source": "https://github.com/sebastianbergmann/git-state/tree/1.0.0" + }, + "funding": [ + { + "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/sebastian/git-state", + "type": "tidelift" + } + ], + "time": "2026-03-21T12:54:28+00:00" }, { "name": "sebastian/global-state", - "version": "8.0.2", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "ef1377171613d09edd25b7816f05be8313f9115d" + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ef1377171613d09edd25b7816f05be8313f9115d", - "reference": "ef1377171613d09edd25b7816f05be8313f9115d", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.1.13" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -1300,7 +1501,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" }, "funding": [ { @@ -1320,33 +1521,33 @@ "type": "tidelift" } ], - "time": "2025-08-29T11:29:25+00:00" + "time": "2026-06-01T15:11:33+00:00" }, { "name": "sebastian/lines-of-code", - "version": "4.0.0", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f" + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f", - "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", "shasum": "" }, "require": { - "nikic/php-parser": "^5.0", - "php": ">=8.3" + "nikic/php-parser": "^5.8.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1370,42 +1571,54 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.0" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" }, "funding": [ { "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/sebastian/lines-of-code", + "type": "tidelift" } ], - "time": "2025-02-07T04:57:28+00:00" + "time": "2026-07-09T08:42:34+00:00" }, { "name": "sebastian/object-enumerator", - "version": "7.0.0", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" + "reference": "b39ab125fd9a7434b0ecbc4202eebce11a98cfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/b39ab125fd9a7434b0ecbc4202eebce11a98cfc5", + "reference": "b39ab125fd9a7434b0ecbc4202eebce11a98cfc5", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -1428,40 +1641,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.0.0" }, "funding": [ { "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/sebastian/object-enumerator", + "type": "tidelift" } ], - "time": "2025-02-07T04:57:48+00:00" + "time": "2026-02-06T04:46:36+00:00" }, { "name": "sebastian/object-reflector", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a" + "reference": "3ca042c2c60b0eab094f8a1b6a7093f4d4c72200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/3ca042c2c60b0eab094f8a1b6a7093f4d4c72200", + "reference": "3ca042c2c60b0eab094f8a1b6a7093f4d4c72200", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1484,40 +1709,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.0.0" }, "funding": [ { "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/sebastian/object-reflector", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:17+00:00" + "time": "2026-02-06T04:47:13+00:00" }, { "name": "sebastian/recursion-context", - "version": "7.0.1", + "version": "8.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -1548,7 +1785,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" }, "funding": [ { @@ -1568,32 +1805,32 @@ "type": "tidelift" } ], - "time": "2025-08-13T04:44:59+00:00" + "time": "2026-08-03T05:58:12+00:00" }, { "name": "sebastian/type", - "version": "6.0.3", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "e549163b9760b8f71f191651d22acf32d56d6d4d" + "reference": "bd1df467864cb95140414059a535b2d906173fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/e549163b9760b8f71f191651d22acf32d56d6d4d", - "reference": "e549163b9760b8f71f191651d22acf32d56d6d4d", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", + "reference": "bd1df467864cb95140414059a535b2d906173fcf", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1617,7 +1854,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/6.0.3" + "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" }, "funding": [ { @@ -1637,29 +1874,29 @@ "type": "tidelift" } ], - "time": "2025-08-09T06:57:12+00:00" + "time": "2026-08-10T08:00:57+00:00" }, { "name": "sebastian/version", - "version": "6.0.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" + "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", - "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ad37a5552c8e2b88572249fdc19b6da7792e021b", + "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1683,15 +1920,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/version/tree/7.0.0" }, "funding": [ { "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/sebastian/version", + "type": "tidelift" } ], - "time": "2025-02-07T05:00:38+00:00" + "time": "2026-02-06T04:52:52+00:00" }, { "name": "staabm/side-effects-detector", @@ -1802,7 +2051,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.1,<8.6" + "php": ">=8.3,<8.6" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index ed56337..1edf9b8 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -462,7 +462,7 @@ public function testCreateNoArgs() { ); $this->Shell->args = array('i18n'); $this->Shell->startup(); - $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); + $this->Shell->method('in')->will($this->returnValue('y')); $this->Shell->create(); $db = ConnectionManager::getDataSource('test'); @@ -493,7 +493,7 @@ public function testCreateWithTableArgs() { ); $this->Shell->args = array('I18n', 'i18n'); $this->Shell->startup(); - $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); + $this->Shell->method('in')->will($this->returnValue('y')); $this->Shell->create(); $db = ConnectionManager::getDataSource('test'); @@ -523,7 +523,7 @@ public function testUpdateWithTable() { ); $this->Shell->args = array('SchemaShellTest', 'articles'); $this->Shell->startup(); - $this->Shell->expects($this->any()) + $this->Shell ->method('in') ->will($this->returnValue('y')); $this->Shell->expects($this->once()) @@ -551,7 +551,7 @@ public function testUpdateWithTableCreate() { ); $this->Shell->args = array('SchemaShellTest', 'newone'); $this->Shell->startup(); - $this->Shell->expects($this->any()) + $this->Shell ->method('in') ->will($this->returnValue('y')); $this->Shell->expects($this->once()) @@ -688,7 +688,7 @@ public function testPluginDotSyntaxWithCreate() { ); $this->Shell->args = array('TestPlugin.TestPluginApp'); $this->Shell->startup(); - $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); + $this->Shell->method('in')->will($this->returnValue('y')); $this->Shell->create(); $db = ConnectionManager::getDataSource('test'); diff --git a/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php index 7b52b07..af23fc3 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php @@ -125,10 +125,10 @@ public function testListAll() { $this->Task->connection = 'test'; $this->Task->interactive = true; - $this->Task->expects($this->at(2))->method('out')->with(' 1. BakeArticles'); - $this->Task->expects($this->at(3))->method('out')->with(' 2. BakeArticlesBakeTags'); - $this->Task->expects($this->at(4))->method('out')->with(' 3. BakeComments'); - $this->Task->expects($this->at(5))->method('out')->with(' 4. BakeTags'); + $this->Task->expects($this->at(2, array(' 1. BakeArticles')))->method('out'); + $this->Task->expects($this->at(3, array(' 2. BakeArticlesBakeTags')))->method('out'); + $this->Task->expects($this->at(4, array(' 3. BakeComments')))->method('out'); + $this->Task->expects($this->at(5, array(' 4. BakeTags')))->method('out'); $expected = array('BakeArticles', 'BakeArticlesBakeTags', 'BakeComments', 'BakeTags'); $result = $this->Task->listAll('test'); @@ -152,7 +152,7 @@ public function testGetNameValidIndex() { $this->markTestSkipped('Additional tables detected.'); } $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in')->will( + $this->Task->method('in')->will( $this->onConsecutiveCalls(3, 1) ); @@ -173,7 +173,7 @@ public function testGetNameValidIndex() { public function testGetNameInvalidIndex() { $this->Task->interactive = true; $invalidIndex = count($this->Task->listAll('test')) + 1; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls($invalidIndex, 'q')); $this->Task->expects($this->once())->method('err'); @@ -188,7 +188,7 @@ public function testGetNameInvalidIndex() { * @return void */ public function testDoHelpersNo() { - $this->Task->expects($this->any())->method('in')->will($this->returnValue('n')); + $this->Task->method('in')->will($this->returnValue('n')); $result = $this->Task->doHelpers(); $this->assertSame(array(), $result); } @@ -225,7 +225,7 @@ public function testDoHelpersTrailingCommas() { * @return void */ public function testDoComponentsNo() { - $this->Task->expects($this->any())->method('in')->will($this->returnValue('n')); + $this->Task->method('in')->will($this->returnValue('n')); $result = $this->Task->doComponents(); $this->assertSame(array('Paginator'), $result); } @@ -269,9 +269,9 @@ public function testConfirmController() { $helpers = array('Js', 'Time'); $components = array('Acl', 'Auth'); - $this->Task->expects($this->at(4))->method('out')->with("Controller Name:\n\t$controller"); - $this->Task->expects($this->at(5))->method('out')->with("Helpers:\n\tJs, Time"); - $this->Task->expects($this->at(6))->method('out')->with("Components:\n\tAcl, Auth"); + $this->Task->expects($this->at(4, array("Controller Name:\n\t$controller")))->method('out'); + $this->Task->expects($this->at(5, array("Helpers:\n\tJs, Time")))->method('out'); + $this->Task->expects($this->at(6, array("Components:\n\tAcl, Auth")))->method('out'); $this->Task->confirmController($controller, $scaffold, $helpers, $components); } @@ -283,7 +283,7 @@ public function testConfirmController() { public function testBake() { $helpers = array('Js', 'Time'); $components = array('Acl', 'Auth'); - $this->Task->expects($this->any())->method('createFile')->will($this->returnValue(true)); + $this->Task->method('createFile')->will($this->returnValue(true)); $result = $this->Task->bake('Articles', null, $helpers, $components); $expected = file_get_contents(CAKE . 'Test' . DS . 'bake_compare' . DS . 'Controller' . DS . 'NoActions.ctp'); @@ -310,14 +310,10 @@ public function testBakeWithPlugin() { CakePlugin::load('ControllerTest', array('path' => APP . 'Plugin' . DS . 'ControllerTest' . DS)); $path = APP . 'Plugin' . DS . 'ControllerTest' . DS . 'Controller' . DS . 'ArticlesController.php'; - $this->Task->expects($this->at(1))->method('createFile')->with( - $path, - new \PHPUnit\Framework\Constraint\IsAnything() - ); - $this->Task->expects($this->at(3))->method('createFile')->with( - $path, - $this->stringContains('ArticlesController extends ControllerTestAppController') - )->will($this->returnValue(true)); + $this->Task->expects($this->at(1, array($path, + new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); + $this->Task->expects($this->at(3, array($path, + $this->stringContains('ArticlesController extends ControllerTestAppController'))))->method('createFile')->will($this->returnValue(true)); $this->Task->bake('Articles', '--actions--', array(), array(), array()); @@ -393,7 +389,7 @@ public function testInteractive() { $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( '1', 'y', // build interactive @@ -429,7 +425,7 @@ public function testInteractiveAdminMethodsNotInteractive() { $this->Task->interactive = true; $this->Task->path = '/my/path/'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( '1', 'y', // build interactive @@ -442,7 +438,7 @@ public function testInteractiveAdminMethodsNotInteractive() { 'y' // looks good? )); - $this->Task->Project->expects($this->any()) + $this->Task->Project ->method('getPrefix') ->will($this->returnValue('admin_')); @@ -471,7 +467,7 @@ public function testExecuteIntoAll() { $this->Task->path = '/my/path/'; $this->Task->args = array('all'); - $this->Task->expects($this->any())->method('_checkUnitTest')->will($this->returnValue(true)); + $this->Task->method('_checkUnitTest')->will($this->returnValue(true)); $this->Task->Test->expects($this->once())->method('bake'); $filename = '/my/path/BakeArticlesController.php'; @@ -499,10 +495,10 @@ public function testExecuteIntoAllAdmin() { $this->Task->args = array('all'); $this->Task->params['admin'] = true; - $this->Task->Project->expects($this->any()) + $this->Task->Project ->method('getPrefix') ->will($this->returnValue('admin_')); - $this->Task->expects($this->any()) + $this->Task ->method('_checkUnitTest') ->will($this->returnValue(true)); $this->Task->Test->expects($this->once())->method('bake'); @@ -589,7 +585,7 @@ public function testExecuteWithPublicParam() { * @return void */ public function testExecuteWithControllerAndBoth() { - $this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_')); + $this->Task->Project->method('getPrefix')->will($this->returnValue('admin_')); $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; $this->Task->args = array('BakeArticles'); @@ -608,7 +604,7 @@ public function testExecuteWithControllerAndBoth() { * @return void */ public function testExecuteWithControllerAndAdmin() { - $this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_')); + $this->Task->Project->method('getPrefix')->will($this->returnValue('admin_')); $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; $this->Task->args = array('BakeArticles'); diff --git a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php index ec3f736..63d0601 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php @@ -63,7 +63,7 @@ public function tearDown(): void { * @return void */ public function testGetConfig() { - $this->Task->expects($this->any()) + $this->Task ->method('in') ->will($this->returnValue('test')); @@ -110,8 +110,7 @@ public function testExecuteIntoInteractive() { $this->Task->expects($this->at(12))->method('in')->will($this->returnValue('n')); //encoding $this->Task->expects($this->at(13))->method('in')->will($this->returnValue('y')); //looks good $this->Task->expects($this->at(14))->method('in')->will($this->returnValue('n')); //another - $this->Task->expects($this->at(15))->method('bake') - ->with(array( + $this->Task->expects($this->at(15, array(array( array( 'name' => 'default', 'datasource' => 'mysql', @@ -125,7 +124,7 @@ public function testExecuteIntoInteractive() { 'port' => '', 'schema' => null ) - )); + ))))->method('bake'); $this->Task->execute(); } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index a970d8f..88d979c 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -77,7 +77,7 @@ public function testExecute() { $this->Task->params['output'] = $this->path . DS; $this->Task->params['extract-core'] = 'no'; $this->Task->expects($this->never())->method('err'); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->returnValue('y')); $this->Task->expects($this->never())->method('_stop'); @@ -204,7 +204,7 @@ public function testExtractCategory() { $this->Task->params['extract-core'] = 'no'; $this->Task->params['merge'] = 'no'; $this->Task->expects($this->never())->method('err'); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->returnValue('y')); $this->Task->expects($this->never())->method('_stop'); @@ -236,7 +236,7 @@ public function testExtractWithoutLocations() { $this->Task->params['no-location'] = true; $this->Task->expects($this->never())->method('err'); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->returnValue('y')); $this->Task->expects($this->never())->method('_stop'); @@ -262,7 +262,7 @@ public function testExtractWithExclude() { $this->Task->params['exclude'] = 'Pages,Layouts'; $this->Task->params['extract-core'] = 'no'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->returnValue('y')); $this->Task->execute(); diff --git a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php index fedf27f..6fa4d63 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php @@ -204,8 +204,8 @@ public function testImportRecordsFromDatabaseWithConditionsPoo() { $this->Task->interactive = true; $this->Task->expects($this->at(0))->method('in') ->will($this->returnValue('WHERE 1=1')); - $this->Task->expects($this->at(1))->method('in') - ->with($this->anything(), $this->anything(), '3') + $this->Task->expects($this->at(1, array($this->anything(), $this->anything(), '3')))->method('in') + ->will($this->returnValue('2')); $this->Task->connection = 'test'; @@ -275,12 +275,11 @@ public function testExecuteWithImportSchema() { $this->Task->expects($this->never()) ->method('in'); - $this->Task->expects($this->at(0)) - ->method('createFile') - ->with($filename, $this->logicalAnd( + $this->Task->expects($this->at(0, array($filename, $this->logicalAnd( $this->stringContains('class ArticleFixture'), $this->stringContains("\$import = array('model' => 'Article'") - )); + )))) + ->method('createFile'); $this->Task->execute(); } @@ -303,12 +302,11 @@ public function testExecuteWithImportRecords() { $this->Task->expects($this->never()) ->method('in'); - $this->Task->expects($this->at(0)) - ->method('createFile') - ->with($filename, $this->logicalAnd( + $this->Task->expects($this->at(0, array($filename, $this->logicalAnd( $this->stringContains('class ArticleFixture'), $this->stringContains("\$import = array('model' => 'Article', 'connection' => 'test')") - )); + )))) + ->method('createFile'); $this->Task->execute(); } @@ -324,8 +322,7 @@ public function testExecuteWithNamedModel() { $this->Task->args = array('article'); $filename = '/my/path/ArticleFixture.php'; - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains('class ArticleFixture')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('class ArticleFixture'))))->method('createFile'); $this->Task->execute(); } @@ -339,19 +336,17 @@ public function testExecuteIntoAll() { $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); - $this->Task->Model->expects($this->any()) + $this->Task->Model ->method('listAll') ->will($this->returnValue(array('articles', 'comments'))); $filename = '/my/path/ArticleFixture.php'; - $this->Task->expects($this->at(0)) - ->method('createFile') - ->with($filename, $this->stringContains('class ArticleFixture')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('class ArticleFixture')))) + ->method('createFile'); $filename = '/my/path/CommentFixture.php'; - $this->Task->expects($this->at(1)) - ->method('createFile') - ->with($filename, $this->stringContains('class CommentFixture')); + $this->Task->expects($this->at(1, array($filename, $this->stringContains('class CommentFixture')))) + ->method('createFile'); $this->Task->execute(); } @@ -367,16 +362,14 @@ public function testAllWithCountAndRecordsFlags() { $this->Task->args = array('all'); $this->Task->params = array('count' => 10, 'records' => true); - $this->Task->Model->expects($this->any())->method('listAll') + $this->Task->Model->method('listAll') ->will($this->returnValue(array('Articles', 'comments'))); $filename = '/my/path/ArticleFixture.php'; - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains("'title' => 'Third Article'")); + $this->Task->expects($this->at(0, array($filename, $this->stringContains("'title' => 'Third Article'"))))->method('createFile'); $filename = '/my/path/CommentFixture.php'; - $this->Task->expects($this->at(1))->method('createFile') - ->with($filename, $this->stringContains("'comment' => 'First Comment for First Article'")); + $this->Task->expects($this->at(1, array($filename, $this->stringContains("'comment' => 'First Comment for First Article'"))))->method('createFile'); $this->Task->expects($this->exactly(2))->method('createFile'); $this->Task->all(); @@ -393,16 +386,14 @@ public function testAllWithSchemaImport() { $this->Task->args = array('all'); $this->Task->params = array('schema' => true); - $this->Task->Model->expects($this->any())->method('listAll') + $this->Task->Model->method('listAll') ->will($this->returnValue(array('Articles', 'comments'))); $filename = '/my/path/ArticleFixture.php'; - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains('public $import = array(\'model\' => \'Article\'')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('public $import = array(\'model\' => \'Article\''))))->method('createFile'); $filename = '/my/path/CommentFixture.php'; - $this->Task->expects($this->at(1))->method('createFile') - ->with($filename, $this->stringContains('public $import = array(\'model\' => \'Comment\'')); + $this->Task->expects($this->at(1, array($filename, $this->stringContains('public $import = array(\'model\' => \'Comment\''))))->method('createFile'); $this->Task->expects($this->exactly(2))->method('createFile'); $this->Task->all(); @@ -417,9 +408,9 @@ public function testExecuteInteractive() { $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; - $this->Task->expects($this->any())->method('in')->will($this->returnValue('y')); - $this->Task->Model->expects($this->any())->method('getName')->will($this->returnValue('Article')); - $this->Task->Model->expects($this->any())->method('getTable') + $this->Task->method('in')->will($this->returnValue('y')); + $this->Task->Model->method('getName')->will($this->returnValue('Article')); + $this->Task->Model->expects($this->atLeastOnce())->method('getTable') ->with('Article') ->will($this->returnValue('articles')); @@ -494,11 +485,9 @@ public function testGenerateFixtureFile() { $this->Task->path = '/my/path/'; $filename = '/my/path/ArticleFixture.php'; - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains('ArticleFixture')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('ArticleFixture'))))->method('createFile'); - $this->Task->expects($this->at(1))->method('createFile') - ->with($filename, $this->stringContains('Task->expects($this->at(1, array($filename, $this->stringContains('method('createFile'); $this->Task->generateFixtureFile('Article', array()); $this->Task->generateFixtureFile('Article', array()); @@ -517,8 +506,7 @@ public function testGeneratePluginFixtureFile() { //fake plugin path CakePlugin::load('TestFixture', array('path' => APP . 'Plugin' . DS . 'TestFixture' . DS)); - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains('class Article')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('class Article'))))->method('createFile'); $this->Task->generateFixtureFile('Article', array()); CakePlugin::unload(); diff --git a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php index 1331ada..b4cc0dc 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php @@ -155,7 +155,7 @@ public function testGetNameQuit() { */ public function testGetNameValidOption() { $listing = $this->Task->listAll('test'); - $this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(1, 4)); + $this->Task->method('in')->will($this->onConsecutiveCalls(1, 4)); $result = $this->Task->getName('test'); $this->assertEquals(Inflector::classify($listing[0]), $result); @@ -171,7 +171,7 @@ public function testGetNameValidOption() { */ public function testGetNameWithOutOfBoundsOption() { $invalidIndex = count($this->Task->listAll('test')) + 1; - $this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls($invalidIndex, 1)); + $this->Task->method('in')->will($this->onConsecutiveCalls($invalidIndex, 1)); $this->Task->expects($this->once())->method('err'); $this->Task->getName('test'); @@ -195,7 +195,7 @@ public function testGetTableName() { * @return void */ public function testGetTableNameCustom() { - $this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls('n', 'my_table')); + $this->Task->method('in')->will($this->onConsecutiveCalls('n', 'my_table')); $result = $this->Task->getTable('BakeArticle', 'test'); $expected = 'my_table'; $this->assertEquals($expected, $result); @@ -220,7 +220,7 @@ public function testGetTableOddTableInteractive() { $this->Task->interactive = true; $this->Task->expects($this->once())->method('getAllTables')->will($this->returnValue(array('articles', 'bake_odd'))); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( 2 // bake_odd )); @@ -315,7 +315,7 @@ public function testFieldValidationGuessing() { public function testInteractiveFieldValidation() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('26', 'y', '18', 'n')); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); @@ -333,11 +333,10 @@ public function testInteractiveFieldValidationWithBogusResponse() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('999999', '26', 'n')); - $this->Task->expects($this->at(10))->method('out') - ->with($this->stringContains('make a valid')); + $this->Task->expects($this->at(10))->method('out'); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); $expected = array('notBlank' => 'notBlank'); @@ -352,7 +351,7 @@ public function testInteractiveFieldValidationWithBogusResponse() { public function testInteractiveFieldValidationWithRegexp() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('/^[a-z]{0,9}$/', 'n')); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); @@ -368,7 +367,7 @@ public function testInteractiveFieldValidationWithRegexp() { public function testSkippingChoiceInteractiveFieldValidation() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('26', 'y', 's')); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); @@ -384,7 +383,7 @@ public function testSkippingChoiceInteractiveFieldValidation() { public function testSkippingAnotherInteractiveFieldValidation() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('26', 's')); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); @@ -399,13 +398,13 @@ public function testSkippingAnotherInteractiveFieldValidation() { * @return void */ public function testInteractiveDoValidationWithSkipping() { - $this->Task->expects($this->any()) + $this->Task ->method('in') ->will($this->onConsecutiveCalls('37', '26', 'n', '10', 's')); $this->Task->interactive = true; $Model = $this->getMock('Model'); $Model->primaryKey = 'id'; - $Model->expects($this->any()) + $Model ->method('schema') ->will($this->returnValue(array( 'id' => array( @@ -462,7 +461,7 @@ public function testInteractiveDoValidationWithSkipping() { public function testNonInteractiveDoValidation() { $Model = $this->getMock('Model'); $Model->primaryKey = 'id'; - $Model->expects($this->any()) + $Model ->method('schema') ->will($this->returnValue(array( 'id' => array( @@ -564,7 +563,7 @@ public function testFindDisplayName() { 'id' => array(), 'tagname' => array(), 'body' => array(), 'created' => array(), 'modified' => array() ); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('y', 2)); $result = $this->Task->findDisplayField($fields); @@ -742,7 +741,7 @@ public function testDoActsAs() { public function testBakeFixture() { $this->Task->plugin = 'TestPlugin'; $this->Task->interactive = true; - $this->Task->Fixture->expects($this->at(0))->method('bake')->with('BakeArticle', 'bake_articles'); + $this->Task->Fixture->expects($this->at(0, array('BakeArticle', 'bake_articles')))->method('bake'); $this->Task->bakeFixture('BakeArticle', 'bake_articles'); $this->assertEquals($this->Task->plugin, $this->Task->Fixture->plugin); @@ -758,7 +757,7 @@ public function testBakeFixture() { public function testBakeTest() { $this->Task->plugin = 'TestPlugin'; $this->Task->interactive = true; - $this->Task->Test->expects($this->at(0))->method('bake')->with('Model', 'BakeArticle'); + $this->Task->Test->expects($this->at(0, array('Model', 'BakeArticle')))->method('bake'); $this->Task->bakeTest('BakeArticle'); $this->assertEquals($this->Task->plugin, $this->Task->Test->plugin); @@ -798,7 +797,7 @@ public function testConfirmAssociations() { ); $model = new Model(array('ds' => 'test', 'name' => 'CategoryThread')); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('n', 'y', 'n', 'n', 'n', 'n')); $result = $this->Task->confirmAssociations($model, $associations); @@ -818,14 +817,14 @@ public function testInOptions() { $this->_useMockedOut(); $options = array('one', 'two', 'three'); - $this->Task->expects($this->at(0))->method('out')->with('1. one'); - $this->Task->expects($this->at(1))->method('out')->with('2. two'); - $this->Task->expects($this->at(2))->method('out')->with('3. three'); + $this->Task->expects($this->at(0, array('1. one')))->method('out'); + $this->Task->expects($this->at(1, array('2. two')))->method('out'); + $this->Task->expects($this->at(2, array('3. three')))->method('out'); $this->Task->expects($this->at(3))->method('in')->will($this->returnValue(10)); - $this->Task->expects($this->at(4))->method('out')->with('1. one'); - $this->Task->expects($this->at(5))->method('out')->with('2. two'); - $this->Task->expects($this->at(6))->method('out')->with('3. three'); + $this->Task->expects($this->at(4, array('1. one')))->method('out'); + $this->Task->expects($this->at(5, array('2. two')))->method('out'); + $this->Task->expects($this->at(6, array('3. three')))->method('out'); $this->Task->expects($this->at(7))->method('in')->will($this->returnValue(2)); $result = $this->Task->inOptions($options, 'Pick a number'); $this->assertEquals(1, $result); @@ -1014,8 +1013,7 @@ public function testExecuteWithNamedModelVariations($name) { $this->Task->args = array($name); $filename = '/my/path/BakeArticle.php'; - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains('class BakeArticle extends AppModel')); + $this->Task->expects($this->at(0, array($filename, $this->stringContains('class BakeArticle extends AppModel'))))->method('createFile'); $this->Task->execute(); } @@ -1031,8 +1029,7 @@ public function testExecuteWithNamedModelHasManyCreated() { $filename = '/my/path/BakeArticle.php'; $this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(1)); - $this->Task->expects($this->at(0))->method('createFile') - ->with($filename, $this->stringContains("'BakeComment' => array(")); + $this->Task->expects($this->at(0, array($filename, $this->stringContains("'BakeComment' => array("))))->method('createFile'); $this->Task->execute(); } @@ -1057,36 +1054,28 @@ public function testExecuteIntoAll() { $this->Task->Test->expects($this->exactly(6))->method('bake'); $filename = '/my/path/BakeArticle.php'; - $this->Task->expects($this->at(1))->method('createFile') - ->with($filename, $this->stringContains('class BakeArticle')); + $this->Task->expects($this->at(1, array($filename, $this->stringContains('class BakeArticle'))))->method('createFile'); $filename = '/my/path/BakeArticlesBakeTag.php'; - $this->Task->expects($this->at(2))->method('createFile') - ->with($filename, $this->stringContains('class BakeArticlesBakeTag')); + $this->Task->expects($this->at(2, array($filename, $this->stringContains('class BakeArticlesBakeTag'))))->method('createFile'); $filename = '/my/path/BakeComment.php'; - $this->Task->expects($this->at(3))->method('createFile') - ->with($filename, $this->stringContains('class BakeComment')); + $this->Task->expects($this->at(3, array($filename, $this->stringContains('class BakeComment'))))->method('createFile'); $filename = '/my/path/BakeComment.php'; - $this->Task->expects($this->at(3))->method('createFile') - ->with($filename, $this->stringContains('public $primaryKey = \'otherid\';')); + $this->Task->expects($this->at(3, array($filename, $this->stringContains('public $primaryKey = \'otherid\';'))))->method('createFile'); $filename = '/my/path/BakeTag.php'; - $this->Task->expects($this->at(4))->method('createFile') - ->with($filename, $this->stringContains('class BakeTag')); + $this->Task->expects($this->at(4, array($filename, $this->stringContains('class BakeTag'))))->method('createFile'); $filename = '/my/path/BakeTag.php'; - $this->Task->expects($this->at(4))->method('createFile') - ->with($filename, $this->logicalNot($this->stringContains('public $primaryKey'))); + $this->Task->expects($this->at(4, array($filename, $this->logicalNot($this->stringContains('public $primaryKey')))))->method('createFile'); $filename = '/my/path/CategoryThread.php'; - $this->Task->expects($this->at(5))->method('createFile') - ->with($filename, $this->stringContains('class CategoryThread')); + $this->Task->expects($this->at(5, array($filename, $this->stringContains('class CategoryThread'))))->method('createFile'); $filename = '/my/path/NumberTree.php'; - $this->Task->expects($this->at(6))->method('createFile') - ->with($filename, $this->stringContains('class NumberTree')); + $this->Task->expects($this->at(6, array($filename, $this->stringContains('class NumberTree'))))->method('createFile'); $this->Task->execute(); @@ -1115,7 +1104,7 @@ public function testExecuteIntoAllOddTables() { $this->Task->expects($this->once())->method('getAllTables')->will($this->returnValue(array('bake_odd'))); $object = new Model(array('name' => 'BakeOdd', 'table' => 'bake_odd', 'ds' => 'test')); $this->Task->expects($this->once())->method('_getModelObject')->with('BakeOdd', 'bake_odd')->will($this->returnValue($object)); - $this->Task->expects($this->at(3))->method('bake')->with($object, false)->will($this->returnValue(true)); + $this->Task->expects($this->at(3, array($object, false)))->method('bake')->will($this->returnValue(true)); $this->Task->expects($this->once())->method('bakeFixture')->with('BakeOdd', 'bake_odd'); $this->Task->execute(); @@ -1141,11 +1130,10 @@ public function testExecuteIntoAllOddTables() { $filename = '/my/path/BakeOdd.php'; $this->Task->expects($this->once())->method('createFile') - ->with($filename, $this->stringContains('class BakeOdd')); - - $filename = '/my/path/BakeOdd.php'; - $this->Task->expects($this->once())->method('createFile') - ->with($filename, $this->stringContains('public $useTable = \'bake_odd\'')); + ->with($filename, $this->logicalAnd( + $this->stringContains('class BakeOdd'), + $this->stringContains('public $useTable = \'bake_odd\'') + )); $this->Task->execute(); } @@ -1197,11 +1185,10 @@ public function testExecuteIntoBakeOddTables() { $filename = '/my/path/BakeOdd.php'; $this->Task->expects($this->once())->method('createFile') - ->with($filename, $this->stringContains('class BakeOdd')); - - $filename = '/my/path/BakeOdd.php'; - $this->Task->expects($this->once())->method('createFile') - ->with($filename, $this->stringContains('public $useTable = \'bake_odd\'')); + ->with($filename, $this->logicalAnd( + $this->stringContains('class BakeOdd'), + $this->stringContains('public $useTable = \'bake_odd\'') + )); $this->Task->execute(); } @@ -1227,20 +1214,16 @@ public function testSkipTablesAndAll() { $this->Task->Test->expects($this->exactly(4))->method('bake'); $filename = '/my/path/BakeArticle.php'; - $this->Task->expects($this->at(1))->method('createFile') - ->with($filename, $this->stringContains('class BakeArticle')); + $this->Task->expects($this->at(1, array($filename, $this->stringContains('class BakeArticle'))))->method('createFile'); $filename = '/my/path/BakeArticlesBakeTag.php'; - $this->Task->expects($this->at(2))->method('createFile') - ->with($filename, $this->stringContains('class BakeArticlesBakeTag')); + $this->Task->expects($this->at(2, array($filename, $this->stringContains('class BakeArticlesBakeTag'))))->method('createFile'); $filename = '/my/path/BakeComment.php'; - $this->Task->expects($this->at(3))->method('createFile') - ->with($filename, $this->stringContains('class BakeComment')); + $this->Task->expects($this->at(3, array($filename, $this->stringContains('class BakeComment'))))->method('createFile'); $filename = '/my/path/CategoryThread.php'; - $this->Task->expects($this->at(4))->method('createFile') - ->with($filename, $this->stringContains('class CategoryThread')); + $this->Task->expects($this->at(4, array($filename, $this->stringContains('class CategoryThread'))))->method('createFile'); $this->Task->execute(); } @@ -1258,7 +1241,7 @@ public function testExecuteIntoInteractive() { $this->Task->path = '/my/path/'; $this->Task->interactive = true; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( $article, // article 'n', // no validation @@ -1294,7 +1277,7 @@ public function testExecuteWithNonExistantTableName() { $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( 'Foobar', // Or type in the name of the model 'y', // Do you want to use this table @@ -1314,7 +1297,7 @@ public function testForcedExecuteWithNonExistantTableName() { $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls( 'Foobar', // Or type in the name of the model 'y', // Do you want to use this table diff --git a/lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php index 8089d98..ff98f83 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php @@ -90,14 +90,12 @@ public function testBakeFoldersAndFiles() { $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Controller' . DS . 'BakeTestPluginAppController.php'; - $this->Task->expects($this->at(2)) - ->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(2, array($file, new \PHPUnit\Framework\Constraint\IsAnything()))) + ->method('createFile'); $file = $path . DS . 'Model' . DS . 'BakeTestPluginAppModel.php'; - $this->Task->expects($this->at(3)) - ->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(3, array($file, new \PHPUnit\Framework\Constraint\IsAnything()))) + ->method('createFile'); $this->Task->bake('BakeTestPlugin'); @@ -147,12 +145,10 @@ public function testExecuteWithNoArgs() { $path = $this->Task->path . 'TestPlugin'; $file = $path . DS . 'Controller' . DS . 'TestPluginAppController.php'; - $this->Task->expects($this->at(3))->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(3, array($file, new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); $file = $path . DS . 'Model' . DS . 'TestPluginAppModel.php'; - $this->Task->expects($this->at(4))->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(4, array($file, new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); $this->Task->args = array(); $this->Task->execute(); @@ -174,13 +170,11 @@ public function testExecuteWithOneArg() { $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Controller' . DS . 'BakeTestPluginAppController.php'; - $this->Task->expects($this->at(2))->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(2, array($file, new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); $path = $this->Task->path . 'BakeTestPlugin'; $file = $path . DS . 'Model' . DS . 'BakeTestPluginAppModel.php'; - $this->Task->expects($this->at(3))->method('createFile') - ->with($file, new \PHPUnit\Framework\Constraint\IsAnything()); + $this->Task->expects($this->at(3, array($file, new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); $this->Task->args = array('BakeTestPlugin'); diff --git a/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php index 9310ec6..e5cd6c0 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php @@ -129,7 +129,7 @@ public function testGenerate() { ) )); $this->Task->initialize(); - $this->Task->expects($this->any())->method('in')->will($this->returnValue(1)); + $this->Task->method('in')->will($this->returnValue(1)); $result = $this->Task->generate('classes', 'test_object', array('test' => 'foo')); $expected = "I got rendered\nfoo"; diff --git a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php index 8f93ce7..275bf16 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php @@ -234,15 +234,12 @@ public function testFilePathGenerationModelRepeated() { $file = TESTS . 'Case' . DS . 'Model' . DS . 'MyClassTest.php'; - $this->Task->expects($this->at(1))->method('createFile') - ->with($file, $this->anything()); + $this->Task->expects($this->at(1, array($file, $this->anything())))->method('createFile'); - $this->Task->expects($this->at(3))->method('createFile') - ->with($file, $this->anything()); + $this->Task->expects($this->at(3, array($file, $this->anything())))->method('createFile'); $file = TESTS . 'Case' . DS . 'Controller' . DS . 'CommentsControllerTest.php'; - $this->Task->expects($this->at(5))->method('createFile') - ->with($file, $this->anything()); + $this->Task->expects($this->at(5, array($file, $this->anything())))->method('createFile'); $this->Task->bake('Model', 'MyClass'); $this->Task->bake('Model', 'MyClass'); @@ -621,7 +618,7 @@ public function testInteractiveWithPlugin() { $this->Task->plugin = 'TestPlugin'; $path = $testApp . 'TestPlugin' . DS . 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS . 'OtherHelperTest.php'; - $this->Task->expects($this->any()) + $this->Task ->method('in') ->will($this->onConsecutiveCalls( 5, //helper @@ -633,9 +630,8 @@ public function testInteractiveWithPlugin() { ->method('createFile') ->with($path, $this->anything()); - $this->Task->stdout->expects($this->at(21)) - ->method('write') - ->with('1. OtherHelperHelper'); + $this->Task->stdout->expects($this->at(21, array('1. OtherHelperHelper'))) + ->method('write'); $this->Task->execute(); } @@ -714,7 +710,7 @@ public function testExecuteWithTwoArgs() { $this->anything(), $this->stringContains('class TestTaskTagTest extends CakeTestCase') ); - $this->Task->expects($this->any())->method('isLoadableClass')->will($this->returnValue(true)); + $this->Task->method('isLoadableClass')->will($this->returnValue(true)); $this->Task->execute(); } @@ -731,7 +727,7 @@ public function testExecuteWithTwoArgsLowerCase() { $this->anything(), $this->stringContains('class TestTaskTagTest extends CakeTestCase') ); - $this->Task->expects($this->any())->method('isLoadableClass')->will($this->returnValue(true)); + $this->Task->method('isLoadableClass')->will($this->returnValue(true)); $this->Task->execute(); } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php index d7c67a1..1206cf8 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php @@ -290,11 +290,8 @@ public function testGetContentWithAdminAction() { public function testBakeView() { $this->Task->controllerName = 'ViewTaskComments'; - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'view.ctp', - $this->stringContains('View Task Articles') - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'view.ctp', + $this->stringContains('View Task Articles'))))->method('createFile'); $this->Task->bake('view', true); } @@ -307,11 +304,8 @@ public function testBakeView() { public function testBakeEdit() { $this->Task->controllerName = 'ViewTaskComments'; - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'edit.ctp', - new \PHPUnit\Framework\Constraint\IsAnything() - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'edit.ctp', + new \PHPUnit\Framework\Constraint\IsAnything())))->method('createFile'); $this->Task->bake('edit', true); } @@ -324,11 +318,8 @@ public function testBakeIndex() { $this->Task->controllerName = 'ViewTaskComments'; $expected = file_get_contents(CAKE . 'Test' . DS . 'bake_compare' . DS . 'View' . DS . 'index.ctp'); - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $expected - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $expected)))->method('createFile'); $this->Task->bake('index', true); } @@ -377,21 +368,12 @@ public function testBakeWithPlugin() { public function testBakeActions() { $this->Task->controllerName = 'ViewTaskComments'; - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'view.ctp', - $this->stringContains('View Task Comments') - ); - $this->Task->expects($this->at(1))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'edit.ctp', - $this->stringContains('Edit View Task Comment') - ); - $this->Task->expects($this->at(2))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $this->stringContains('ViewTaskComment') - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'view.ctp', + $this->stringContains('View Task Comments'))))->method('createFile'); + $this->Task->expects($this->at(1, array(TMP . 'ViewTaskComments' . DS . 'edit.ctp', + $this->stringContains('Edit View Task Comment'))))->method('createFile'); + $this->Task->expects($this->at(2, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $this->stringContains('ViewTaskComment'))))->method('createFile'); $this->Task->bakeActions(array('view', 'edit', 'index'), array()); } @@ -404,7 +386,7 @@ public function testBakeActions() { public function testCustomAction() { $this->Task->controllerName = 'ViewTaskComments'; - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('', 'my_action', 'y')); $this->Task->expects($this->once())->method('createFile') @@ -427,16 +409,10 @@ public function testExecuteIntoAll() { $this->Task->Controller->expects($this->once())->method('listAll') ->will($this->returnValue(array('view_task_comments'))); - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $this->anything() - ); - $this->Task->expects($this->at(1))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'add.ctp', - $this->anything() - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $this->anything())))->method('createFile'); + $this->Task->expects($this->at(1, array(TMP . 'ViewTaskComments' . DS . 'add.ctp', + $this->anything())))->method('createFile'); $this->Task->expects($this->exactly(2))->method('createFile'); $this->Task->execute(); @@ -488,16 +464,10 @@ public function testExecuteWithActionParam() { public function testExecuteWithController() { $this->Task->args[0] = 'ViewTaskComments'; - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $this->anything() - ); - $this->Task->expects($this->at(1))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'add.ctp', - $this->anything() - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $this->anything())))->method('createFile'); + $this->Task->expects($this->at(1, array(TMP . 'ViewTaskComments' . DS . 'add.ctp', + $this->anything())))->method('createFile'); $this->Task->expects($this->exactly(2))->method('createFile'); $this->Task->execute(); @@ -521,16 +491,10 @@ public static function nameVariations() { public function testExecuteWithControllerVariations($name) { $this->Task->args = array($name); - $this->Task->expects($this->at(0))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $this->anything() - ); - $this->Task->expects($this->at(1))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'add.ctp', - $this->anything() - ); + $this->Task->expects($this->at(0, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $this->anything())))->method('createFile'); + $this->Task->expects($this->at(1, array(TMP . 'ViewTaskComments' . DS . 'add.ctp', + $this->anything())))->method('createFile'); $this->Task->execute(); } @@ -546,17 +510,14 @@ public function testExecuteWithControllerAndAdminFlag() { $this->Task->args[0] = 'ViewTaskArticles'; $this->Task->params['admin'] = 1; - $this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_')); + $this->Task->Project->method('getPrefix')->will($this->returnValue('admin_')); $this->Task->expects($this->exactly(4))->method('createFile'); $views = array('admin_index.ctp', 'admin_add.ctp', 'admin_view.ctp', 'admin_edit.ctp'); foreach ($views as $i => $view) { - $this->Task->expects($this->at($i))->method('createFile') - ->with( - TMP . 'ViewTaskArticles' . DS . $view, - $this->anything() - ); + $this->Task->expects($this->at($i, array(TMP . 'ViewTaskArticles' . DS . $view, + $this->anything())))->method('createFile'); } $this->Task->execute(); Configure::write('Routing', $_back); @@ -575,32 +536,20 @@ public function testExecuteInteractive() { $this->Task->Controller->expects($this->once())->method('getName') ->will($this->returnValue('ViewTaskComments')); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('y', 'y', 'n')); - $this->Task->expects($this->at(3))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'index.ctp', - $this->stringContains('ViewTaskComment') - ); + $this->Task->expects($this->at(3, array(TMP . 'ViewTaskComments' . DS . 'index.ctp', + $this->stringContains('ViewTaskComment'))))->method('createFile'); - $this->Task->expects($this->at(4))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'view.ctp', - $this->stringContains('ViewTaskComment') - ); + $this->Task->expects($this->at(4, array(TMP . 'ViewTaskComments' . DS . 'view.ctp', + $this->stringContains('ViewTaskComment'))))->method('createFile'); - $this->Task->expects($this->at(5))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'add.ctp', - $this->stringContains('Add View Task Comment') - ); + $this->Task->expects($this->at(5, array(TMP . 'ViewTaskComments' . DS . 'add.ctp', + $this->stringContains('Add View Task Comment'))))->method('createFile'); - $this->Task->expects($this->at(6))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'edit.ctp', - $this->stringContains('Edit View Task Comment') - ); + $this->Task->expects($this->at(6, array(TMP . 'ViewTaskComments' . DS . 'edit.ctp', + $this->stringContains('Edit View Task Comment'))))->method('createFile'); $this->Task->expects($this->exactly(4))->method('createFile'); $this->Task->execute(); @@ -640,32 +589,20 @@ public function testExecuteInteractiveWithAdmin() { $this->Task->Project->expects($this->once())->method('getPrefix') ->will($this->returnValue('admin_')); - $this->Task->expects($this->any())->method('in') + $this->Task->method('in') ->will($this->onConsecutiveCalls('y', 'n', 'y')); - $this->Task->expects($this->at(3))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'admin_index.ctp', - $this->stringContains('ViewTaskComment') - ); + $this->Task->expects($this->at(3, array(TMP . 'ViewTaskComments' . DS . 'admin_index.ctp', + $this->stringContains('ViewTaskComment'))))->method('createFile'); - $this->Task->expects($this->at(4))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'admin_view.ctp', - $this->stringContains('ViewTaskComment') - ); + $this->Task->expects($this->at(4, array(TMP . 'ViewTaskComments' . DS . 'admin_view.ctp', + $this->stringContains('ViewTaskComment'))))->method('createFile'); - $this->Task->expects($this->at(5))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'admin_add.ctp', - $this->stringContains('Add View Task Comment') - ); + $this->Task->expects($this->at(5, array(TMP . 'ViewTaskComments' . DS . 'admin_add.ctp', + $this->stringContains('Add View Task Comment'))))->method('createFile'); - $this->Task->expects($this->at(6))->method('createFile') - ->with( - TMP . 'ViewTaskComments' . DS . 'admin_edit.ctp', - $this->stringContains('Edit View Task Comment') - ); + $this->Task->expects($this->at(6, array(TMP . 'ViewTaskComments' . DS . 'admin_edit.ctp', + $this->stringContains('Edit View Task Comment'))))->method('createFile'); $this->Task->expects($this->exactly(4))->method('createFile'); $this->Task->execute(); diff --git a/lib/Cake/Test/Case/Console/ConsoleOutputTest.php b/lib/Cake/Test/Case/Console/ConsoleOutputTest.php index 1d85714..7b7a3d1 100644 --- a/lib/Cake/Test/Case/Console/ConsoleOutputTest.php +++ b/lib/Cake/Test/Case/Console/ConsoleOutputTest.php @@ -102,14 +102,11 @@ public function testWriteArray() { public function testOverwrite() { $testString = "Text"; - $this->output->expects($this->at(0))->method('_write') - ->with($testString); + $this->output->expects($this->at(0, array($testString)))->method('_write'); - $this->output->expects($this->at(1))->method('_write') - ->with(""); + $this->output->expects($this->at(1, array("")))->method('_write'); - $this->output->expects($this->at(2))->method('_write') - ->with("Overwriting text"); + $this->output->expects($this->at(2, array("Overwriting text")))->method('_write'); $this->output->write($testString, 0); $this->output->overwrite("Overwriting text"); diff --git a/lib/Cake/Test/Case/Console/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php index 6fdb82c..aee9e8f 100644 --- a/lib/Cake/Test/Case/Console/ShellTest.php +++ b/lib/Cake/Test/Case/Console/ShellTest.php @@ -822,12 +822,12 @@ public function testRunCommandHittingTask() { $Shell = $this->getMock('Shell', ['hasTask', 'startup'], [], '', false); $task = $this->getMock('Shell', ['execute', 'runCommand'], [], '', false); - $task->expects($this->any()) + $task->expects($this->once()) ->method('runCommand') ->with('execute', ['one', 'value']); $Shell->expects($this->once())->method('startup'); - $Shell->expects($this->any()) + $Shell ->method('hasTask') ->will($this->returnValue(true)); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php index 6658213..d8579ae 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php @@ -50,7 +50,7 @@ public function setUp(): void { * @return void */ protected function _mockAcl() { - $this->Collection->expects($this->any()) + $this->Collection->expects($this->atLeastOnce()) ->method('load') ->with('Acl') ->will($this->returnValue($this->Acl)); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php index 81ae2fb..36f67cc 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php @@ -37,7 +37,7 @@ public function setUp(): void { parent::setUp(); $this->controller = $this->getMock('Controller', array('isAuthorized'), array(), '', false); $this->components = $this->getMock('ComponentCollection'); - $this->components->expects($this->any()) + $this->components ->method('getController') ->will($this->returnValue($this->controller)); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php index 4ff1d1e..eccb3bb 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php @@ -51,7 +51,7 @@ public function setUp(): void { * @return void */ protected function _mockAcl() { - $this->Components->expects($this->any()) + $this->Components->expects($this->atLeastOnce()) ->method('load') ->with('Acl') ->will($this->returnValue($this->Acl)); diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 24b6da0..d5877bb 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -1312,9 +1312,8 @@ public function testAjaxLoginResponseCode() { Router::setRequestInfo($this->Auth->request); $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); - $this->Controller->response->expects($this->at(0)) - ->method('_sendHeader') - ->with('HTTP/1.1 403 Forbidden', null); + $this->Controller->response->expects($this->at(0, array('HTTP/1.1 403 Forbidden', null))) + ->method('_sendHeader'); $this->Auth->initialize($this->Controller); ob_start(); @@ -1345,9 +1344,8 @@ public function testAjaxLoginResponseCodeNoElement() { Router::setRequestInfo($this->Auth->request); $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); - $this->Controller->response->expects($this->at(0)) - ->method('_sendHeader') - ->with('HTTP/1.1 403 Forbidden', null); + $this->Controller->response->expects($this->at(0, array('HTTP/1.1 403 Forbidden', null))) + ->method('_sendHeader'); $this->Auth->initialize($this->Controller); $this->Auth->startup($this->Controller); diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index b32a1be..756963f 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -527,18 +527,18 @@ public function testPaginateI18nConditionNotTitleWithLimit() { * @return void */ public function testPageParamCasting() { - $this->Controller->Post->expects($this->at(0)) + $this->Controller->Post->expects($this->at(0, array('paginate'))) ->method('hasMethod') - ->with('paginate') + ->will($this->returnValue(false)); $this->Controller->Post->expects($this->at(1)) ->method('find') ->will($this->returnValue(array('stuff'))); - $this->Controller->Post->expects($this->at(2)) + $this->Controller->Post->expects($this->at(2, array('paginateCount'))) ->method('hasMethod') - ->with('paginateCount') + ->will($this->returnValue(false)); $this->Controller->Post->expects($this->at(3)) @@ -1104,7 +1104,7 @@ public function testMergeOptionsMaxLimit() { public function testValidateSortInvalidDirection() { $model = $this->getMock('Model'); $model->alias = 'model'; - $model->expects($this->any())->method('hasField')->will($this->returnValue(true)); + $model->method('hasField')->will($this->returnValue(true)); $options = array('sort' => 'something', 'direction' => 'boogers'); $result = $this->Paginator->validateSort($model, $options); @@ -1183,7 +1183,7 @@ public function testOutOfRangePageNumberAndPageCountZero() { public function testValidateSortWhitelistFailure() { $model = $this->getMock('Model'); $model->alias = 'model'; - $model->expects($this->any())->method('hasField')->will($this->returnValue(true)); + $model->method('hasField')->will($this->returnValue(true)); $options = array('sort' => 'body', 'direction' => 'asc'); $result = $this->Paginator->validateSort($model, $options, array('title', 'id')); @@ -1217,14 +1217,14 @@ public function testValidateSortVirtualField() { $model = $this->getMock('Model'); $model->alias = 'model'; - $model->expects($this->at(0)) + $model->expects($this->at(0, array('something'))) ->method('hasField') - ->with('something') + ->will($this->returnValue(false)); - $model->expects($this->at(1)) + $model->expects($this->at(1, array('something', true))) ->method('hasField') - ->with('something', true) + ->will($this->returnValue(true)); $options = array('sort' => 'something', 'direction' => 'desc'); @@ -1247,9 +1247,9 @@ public function testValidateSortSharedFields() { $model->expects($this->never()) ->method('hasField'); - $model->Child->expects($this->at(0)) + $model->Child->expects($this->at(0, array('something'))) ->method('hasField') - ->with('something') + ->will($this->returnValue(true)); $options = array('sort' => 'Child.something', 'direction' => 'desc'); @@ -1265,7 +1265,7 @@ public function testValidateSortSharedFields() { public function testValidateSortMultiple() { $model = $this->getMock('Model'); $model->alias = 'model'; - $model->expects($this->any())->method('hasField')->will($this->returnValue(true)); + $model->method('hasField')->will($this->returnValue(true)); $options = array( 'order' => array( @@ -1290,7 +1290,7 @@ public function testValidateSortMultiple() { public function testValidateSortNoSort() { $model = $this->getMock('Model'); $model->alias = 'model'; - $model->expects($this->any())->method('hasField')->will($this->returnValue(true)); + $model->method('hasField')->will($this->returnValue(true)); $options = array('direction' => 'asc'); $result = $this->Paginator->validateSort($model, $options, array('title', 'id')); @@ -1310,7 +1310,7 @@ public function testValidateSortNoSort() { public function testValidateSortInvalidAlias() { $model = $this->getMock('Model'); $model->alias = 'Model'; - $model->expects($this->any())->method('hasField')->will($this->returnValue(true)); + $model->method('hasField')->will($this->returnValue(true)); $options = array('sort' => 'Derp.id'); $result = $this->Paginator->validateSort($model, $options); diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index a77f762..00d8bc9 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -330,7 +330,7 @@ public function testInitializeContentTypeAndExtensionMismatch() { Router::parseExtensions('xml'); $this->Controller->request = $this->getMock('CakeRequest'); - $this->Controller->request->expects($this->any()) + $this->Controller->request->expects($this->anyInvocation()) ->method('accepts') ->will($this->returnValue(array('application/json'))); @@ -517,20 +517,17 @@ public function testRenderAs() { */ public function testRenderAsWithAttachment() { $this->RequestHandler->request = $this->getMock('CakeRequest'); - $this->RequestHandler->request->expects($this->any()) + $this->RequestHandler->request->expects($this->anyInvocation()) ->method('parseAccept') ->will($this->returnValue(array('1.0' => array('application/xml')))); $this->RequestHandler->response = $this->getMock('CakeResponse', array('type', 'download', 'charset')); - $this->RequestHandler->response->expects($this->at(0)) - ->method('type') - ->with('application/xml'); - $this->RequestHandler->response->expects($this->at(1)) - ->method('charset') - ->with('UTF-8'); - $this->RequestHandler->response->expects($this->at(2)) - ->method('download') - ->with('myfile.xml'); + $this->RequestHandler->response->expects($this->at(0, array('application/xml'))) + ->method('type'); + $this->RequestHandler->response->expects($this->at(1, array('UTF-8'))) + ->method('charset'); + $this->RequestHandler->response->expects($this->at(2, array('myfile.xml'))) + ->method('download'); $this->RequestHandler->renderAs($this->Controller, 'xml', array('attachment' => 'myfile.xml')); @@ -544,10 +541,8 @@ public function testRenderAsWithAttachment() { */ public function testRespondAs() { $this->RequestHandler->response = $this->getMock('CakeResponse', array('type')); - $this->RequestHandler->response->expects($this->at(0))->method('type') - ->with('application/json'); - $this->RequestHandler->response->expects($this->at(1))->method('type') - ->with('text/xml'); + $this->RequestHandler->response->expects($this->at(0, array('application/json')))->method('type'); + $this->RequestHandler->response->expects($this->at(1, array('text/xml')))->method('type'); $result = $this->RequestHandler->respondAs('json'); $this->assertTrue($result); @@ -730,20 +725,20 @@ public function testRequestProperties() { */ public function testRequestMethod() { $request = $this->getMock('CakeRequest'); - $request->expects($this->at(0))->method('is') - ->with('get') + $request->expects($this->at(0, array('get')))->method('is') + ->will($this->returnValue(true)); - $request->expects($this->at(1))->method('is') - ->with('post') + $request->expects($this->at(1, array('post')))->method('is') + ->will($this->returnValue(false)); - $request->expects($this->at(2))->method('is') - ->with('delete') + $request->expects($this->at(2, array('delete')))->method('is') + ->will($this->returnValue(true)); - $request->expects($this->at(3))->method('is') - ->with('put') + $request->expects($this->at(3, array('put')))->method('is') + ->will($this->returnValue(false)); $this->RequestHandler->request = $request; @@ -856,7 +851,7 @@ public function testAjaxRedirectAsRequestAction() { $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $this->Controller->RequestHandler->request = $this->Controller->request; $this->Controller->RequestHandler->response = $this->Controller->response; - $this->Controller->request->expects($this->any())->method('is')->will($this->returnValue(true)); + $this->Controller->request->expects($this->anyInvocation())->method('is')->will($this->returnValue(true)); $this->Controller->RequestHandler->expects($this->once())->method('_stop'); ob_start(); @@ -885,7 +880,7 @@ public function testAjaxRedirectAsRequestActionStillRenderingLayout() { $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $this->Controller->RequestHandler->request = $this->Controller->request; $this->Controller->RequestHandler->response = $this->Controller->response; - $this->Controller->request->expects($this->any())->method('is')->will($this->returnValue(true)); + $this->Controller->request->expects($this->anyInvocation())->method('is')->will($this->returnValue(true)); $this->Controller->RequestHandler->expects($this->once())->method('_stop'); ob_start(); diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index 9d199dc..5e1b777 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -165,7 +165,7 @@ public function setUp(): void { $request = $this->getMock('CakeRequest', array('here'), array('posts/index', false)); $request->addParams(array('controller' => 'posts', 'action' => 'index')); - $request->expects($this->any()) + $request->expects($this->anyInvocation()) ->method('here') ->will($this->returnValue('/posts/index')); diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index 1e175cc..f97c93b 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -858,8 +858,7 @@ public function testRedirectBeforeRedirectModifyingParamsArrayReturn() { $Controller->response->expects($this->once())->method('header') ->with('Location', 'http://example.com/test/2'); - $Controller->response->expects($this->at(1))->method('statusCode') - ->with(302); + $Controller->response->expects($this->at(1, array(302)))->method('statusCode'); $Controller->expects($this->never())->method('_stop'); $Controller->redirect('https://cakephp.org', 301); @@ -902,9 +901,8 @@ public function testRedirectBeforeRedirectInControllerWithArray() { 'exit' => true ))); - $Controller->response->expects($this->at(0)) - ->method('header') - ->with('Location', 'http://example.org'); + $Controller->response->expects($this->at(0, array('Location', 'http://example.org'))) + ->method('header'); $Controller->expects($this->once())->method('_stop'); $Controller->redirect('https://cakephp.org'); @@ -1010,7 +1008,7 @@ public function testMergeVarsNotGreedy() { public function testReferer() { $request = $this->getMock('CakeRequest'); - $request->expects($this->any())->method('referer') + $request->expects($this->atLeastOnce())->method('referer') ->with(true) ->will($this->returnValue('/posts/index')); @@ -1024,7 +1022,7 @@ public function testReferer() { $request = $this->getMock('CakeRequest'); - $request->expects($this->any())->method('referer') + $request->expects($this->atLeastOnce())->method('referer') ->with(false) ->will($this->returnValue('http://localhost/posts/index')); @@ -1047,7 +1045,7 @@ public function testReferer() { public function testRefererSlash() { $request = $this->getMock('CakeRequest', array('referer')); $request->base = '/base'; - $request->expects($this->any()) + $request->expects($this->anyInvocation()) ->method('referer') ->will($this->returnValue('/')); Router::setRequestInfo($request); @@ -1232,8 +1230,8 @@ public function testPostConditionsDangerous($data) { public function testControllerHttpCodes() { $response = $this->getMock('CakeResponse', array('httpCodes')); $Controller = new Controller(null, $response); - $Controller->response->expects($this->at(0))->method('httpCodes')->with(null); - $Controller->response->expects($this->at(1))->method('httpCodes')->with(100); + $Controller->response->expects($this->at(0, array(null)))->method('httpCodes'); + $Controller->response->expects($this->at(1, array(100)))->method('httpCodes'); $Controller->httpCodes(); $Controller->httpCodes(100); } @@ -1247,24 +1245,18 @@ public function testStartupProcess() { $Controller = $this->getMock('Controller', array('getEventManager')); $eventManager = $this->getMock('CakeEventManager'); - $eventManager->expects($this->at(0))->method('dispatch') - ->with( - $this->logicalAnd( + $eventManager->expects($this->at(0, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $subject) use($Controller) { return $subject->name() == 'Controller.initialize' && $subject->subject() == $Controller; }), - ) - ); - $eventManager->expects($this->at(1))->method('dispatch') - ->with( - $this->logicalAnd( + ))))->method('dispatch'); + $eventManager->expects($this->at(1, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $subject) use($Controller) { return $subject->name() == 'Controller.startup' && $subject->subject() == $Controller; }), - ) - ); + ))))->method('dispatch'); $Controller->expects($this->exactly(2))->method('getEventManager') ->will($this->returnValue($eventManager)); $Controller->startupProcess(); diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index 155c356..ca074a3 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -503,7 +503,7 @@ public function testExceptionResponseHeader() { $ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $ExceptionRenderer->controller->response->header($headers); - $ExceptionRenderer->controller->response->expects($this->at(1))->method('_sendHeader')->with('Allow', 'POST, DELETE'); + $ExceptionRenderer->controller->response->expects($this->at(1, array('Allow', 'POST, DELETE')))->method('_sendHeader'); ob_start(); $ExceptionRenderer->render(); ob_get_clean(); @@ -702,9 +702,9 @@ public function testMissingRenderSafe() { $ExceptionRenderer->controller = $this->getMock('Controller', array('render')); $ExceptionRenderer->controller->helpers = array('Fail', 'Boom'); $ExceptionRenderer->controller->request = $this->getMock('CakeRequest'); - $ExceptionRenderer->controller->expects($this->at(0)) + $ExceptionRenderer->controller->expects($this->at(0, array('missingHelper'))) ->method('render') - ->with('missingHelper') + ->will($this->throwException($exception)); $response = $this->getMock('CakeResponse'); @@ -729,7 +729,7 @@ public function testRenderExceptionInBeforeRender() { $ExceptionRenderer->controller = $this->getMock('Controller', array('beforeRender')); $ExceptionRenderer->controller->request = $this->getMock('CakeRequest'); - $ExceptionRenderer->controller->expects($this->any()) + $ExceptionRenderer->controller ->method('beforeRender') ->will($this->throwException($exception)); diff --git a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php index b18a587..f5e0d8f 100644 --- a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php @@ -241,12 +241,11 @@ public function testDispatchReturnValue() { $manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event'); $event = new CakeEvent('fake.event'); - $listener->expects($this->at(0))->method('listenerFunction') - ->with($event) + $listener->expects($this->at(0, array($event)))->method('listenerFunction') + ->will($this->returnValue('something special')); - $anotherListener->expects($this->at(0)) - ->method('listenerFunction') - ->with($event); + $anotherListener->expects($this->at(0, array($event))) + ->method('listenerFunction'); $manager->dispatch($event); $this->assertEquals('something special', $event->result); } @@ -270,8 +269,8 @@ public function testDispatchFalseStopsEvent() { $manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event'); $event = new CakeEvent('fake.event'); - $listener->expects($this->at(0))->method('listenerFunction') - ->with($event) + $listener->expects($this->at(0, array($event)))->method('listenerFunction') + ->will($this->returnValue(false)); $anotherListener->expects($this->never()) ->method('listenerFunction'); @@ -335,7 +334,7 @@ public function testAttachSubscriber() { $expected = array('listenerFunction'); $this->assertEquals($expected, $listener->callStack); - $listener->expects($this->at(0))->method('secondListenerFunction')->with('data'); + $listener->expects($this->at(0, array('data')))->method('secondListenerFunction'); $event = new CakeEvent('another.event', $this, array('some' => 'data')); $manager->dispatch($event); @@ -412,7 +411,7 @@ public function testStopPropagation() { $listener = new CakeEventTestListener(); CakeEventManager::instance($generalManager); - $generalManager->expects($this->any()) + $generalManager->expects($this->atLeastOnce()) ->method('prioritisedListeners') ->with('fake.event') ->will($this->returnValue(array())); @@ -441,7 +440,7 @@ public function testDispatchPrioritizedWithGlobal() { $event = new CakeEvent('fake.event'); CakeEventManager::instance($generalManager); - $generalManager->expects($this->any()) + $generalManager->expects($this->atLeastOnce()) ->method('prioritisedListeners') ->with('fake.event') ->will($this->returnValue( @@ -473,7 +472,7 @@ public function testDispatchGlobalBeforeLocal() { $event = new CakeEvent('fake.event'); CakeEventManager::instance($generalManager); - $generalManager->expects($this->any()) + $generalManager->expects($this->atLeastOnce()) ->method('prioritisedListeners') ->with('fake.event') ->will($this->returnValue( diff --git a/lib/Cake/Test/Case/Log/Engine/SyslogLogTest.php b/lib/Cake/Test/Case/Log/Engine/SyslogLogTest.php index d25c266..1aec7d9 100644 --- a/lib/Cake/Test/Case/Log/Engine/SyslogLogTest.php +++ b/lib/Cake/Test/Case/Log/Engine/SyslogLogTest.php @@ -64,8 +64,8 @@ public function testWriteOneLine($type, $expected) { */ public function testWriteMultiLine() { $log = $this->getMock('SyslogLog', array('_open', '_write')); - $log->expects($this->at(1))->method('_write')->with(LOG_DEBUG, 'debug: Foo'); - $log->expects($this->at(2))->method('_write')->with(LOG_DEBUG, 'debug: Bar'); + $log->expects($this->at(1, array(LOG_DEBUG, 'debug: Foo')))->method('_write'); + $log->expects($this->at(2, array(LOG_DEBUG, 'debug: Bar')))->method('_write'); $log->expects($this->exactly(2))->method('_write'); $log->write('debug', "Foo\nBar"); } diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index 83a2386..a2b9724 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -760,7 +760,7 @@ public function testSaveAssociatedAtomic() { 'content' => 'Content #4', ) ); - $Mock->expects($this->at(0))->method('save')->with($with, array('atomic' => false)); + $Mock->expects($this->at(0, array($with, array('atomic' => false))))->method('save'); $with = array( 'TranslateTestModel' => array ( @@ -771,7 +771,7 @@ public function testSaveAssociatedAtomic() { 'content' => 'Title #4', ) ); - $Mock->expects($this->at(1))->method('save')->with($with, array('atomic' => false)); + $Mock->expects($this->at(1, array($with, array('atomic' => false))))->method('save'); $TestModel->create(); $TestModel->saveAssociated($data, array('atomic' => false)); diff --git a/lib/Cake/Test/Case/Model/Datasource/DataSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DataSourceTest.php index fdb27b8..b004135 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DataSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DataSourceTest.php @@ -122,7 +122,7 @@ public function setUp(): void { array('getDataSource'), array(array('ds' => $this->sourceName)) ); - $this->Model->expects($this->any()) + $this->Model ->method('getDataSource') ->will($this->returnValue($this->Source)); } @@ -211,7 +211,7 @@ public function testUpdate() { ), ), ); - $this->Source->expects($this->any()) + $this->Source ->method('read') ->will($this->returnValue(array( array($this->Model->alias => array('count' => 1)) @@ -232,7 +232,7 @@ public function testUpdate() { * @return void */ public function testDelete() { - $this->Source->expects($this->any()) + $this->Source ->method('read') ->will($this->returnValue(array( array($this->Model->alias => array('count' => 1)) diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index aeef83e..e3c8863 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -1152,7 +1152,7 @@ public function testFieldDoubleEscaping() { $this->Model = $this->getMock('Article2', array('getDataSource')); $this->Model->alias = 'Article'; - $this->Model->expects($this->any()) + $this->Model ->method('getDataSource') ->will($this->returnValue($test)); @@ -1160,8 +1160,7 @@ public function testFieldDoubleEscaping() { $result = $test->fields($this->Model, null, $this->Model->escapeField()); $this->assertEquals(array('`Article`.`id`'), $result); - $test->expects($this->at(0))->method('execute') - ->with('SELECT `Article`.`id` FROM ' . $test->fullTableName('articles') . ' AS `Article` WHERE 1 = 1'); + $test->expects($this->at(0, array('SELECT `Article`.`id` FROM ' . $test->fullTableName('articles') . ' AS `Article` WHERE 1 = 1')))->method('execute'); $result = $test->read($this->Model, array( 'fields' => $this->Model->escapeField(), @@ -1176,8 +1175,7 @@ public function testFieldDoubleEscaping() { $result = $test->fields($this->Model, null, $this->Model->escapeField()); $this->assertEquals(array('[Article].[id]'), $result); - $test->expects($this->at(0))->method('execute') - ->with('SELECT [Article].[id] FROM ' . $test->fullTableName('articles') . ' AS [Article] WHERE 1 = 1'); + $test->expects($this->at(0, array('SELECT [Article].[id] FROM ' . $test->fullTableName('articles') . ' AS [Article] WHERE 1 = 1')))->method('execute'); $result = $test->read($this->Model, array( 'fields' => $this->Model->escapeField(), 'conditions' => null, @@ -1349,12 +1347,12 @@ public function testReadCustomJoinsAfterGeneratedJoins() { $test->config['database'] = $db; $this->Model = $this->getMock('TestModel9', array('getDataSource')); - $this->Model->expects($this->any()) + $this->Model ->method('getDataSource') ->will($this->returnValue($test)); $this->Model->TestModel8 = $this->getMock('TestModel8', array('getDataSource')); - $this->Model->TestModel8->expects($this->any()) + $this->Model->TestModel8 ->method('getDataSource') ->will($this->returnValue($test)); @@ -1365,8 +1363,7 @@ public function testReadCustomJoinsAfterGeneratedJoins() { "(`TestModel8`.`name` != 'larry' AND `TestModel9`.`test_model8_id` = `TestModel8`.`id`) " . "LEFT JOIN $usersTable AS `User` ON (`TestModel9`.`id` = `User`.`test_id`)"; - $test->expects($this->at(0))->method('execute') - ->with($this->stringContains($search)); + $test->expects($this->at(0, array($this->stringContains($search))))->method('execute'); $test->read($this->Model, array( 'joins' => array( @@ -1392,22 +1389,20 @@ public function testGenerateInnerJoinAssociationQuery() { $test->config['database'] = $db; $this->Model = $this->getMock('TestModel9', array('getDataSource')); - $this->Model->expects($this->any()) + $this->Model ->method('getDataSource') ->will($this->returnValue($test)); $this->Model->TestModel8 = $this->getMock('TestModel8', array('getDataSource')); - $this->Model->TestModel8->expects($this->any()) + $this->Model->TestModel8 ->method('getDataSource') ->will($this->returnValue($test)); $testModel8Table = $this->Model->TestModel8->getDataSource()->fullTableName($this->Model->TestModel8); - $test->expects($this->at(0))->method('execute') - ->with($this->stringContains('`TestModel9` LEFT JOIN ' . $testModel8Table)); + $test->expects($this->at(0, array($this->stringContains('`TestModel9` LEFT JOIN ' . $testModel8Table))))->method('execute'); - $test->expects($this->at(1))->method('execute') - ->with($this->stringContains('TestModel9` INNER JOIN ' . $testModel8Table)); + $test->expects($this->at(1, array($this->stringContains('TestModel9` INNER JOIN ' . $testModel8Table))))->method('execute'); $test->read($this->Model, array('recursive' => 1)); $this->Model->belongsTo['TestModel8']['type'] = 'INNER'; @@ -3424,19 +3419,17 @@ public function testHasAny() { $this->Dbo->config['database'] = $db; $this->Model = $this->getMock('TestModel', array('getDataSource')); - $this->Model->expects($this->any()) + $this->Model ->method('getDataSource') ->will($this->returnValue($this->Dbo)); - $this->Dbo->expects($this->at(0))->method('value') - ->with('harry') + $this->Dbo->expects($this->at(0, array('harry')))->method('value') + ->will($this->returnValue("'harry'")); $modelTable = $this->Dbo->fullTableName($this->Model); - $this->Dbo->expects($this->at(1))->method('execute') - ->with('SELECT COUNT(`TestModel`.`id`) AS count FROM ' . $modelTable . ' AS `TestModel` WHERE `TestModel`.`name` = \'harry\''); - $this->Dbo->expects($this->at(2))->method('execute') - ->with('SELECT COUNT(`TestModel`.`id`) AS count FROM ' . $modelTable . ' AS `TestModel` WHERE 1 = 1'); + $this->Dbo->expects($this->at(1, array('SELECT COUNT(`TestModel`.`id`) AS count FROM ' . $modelTable . ' AS `TestModel` WHERE `TestModel`.`name` = \'harry\'')))->method('execute'); + $this->Dbo->expects($this->at(2, array('SELECT COUNT(`TestModel`.`id`) AS count FROM ' . $modelTable . ' AS `TestModel` WHERE 1 = 1')))->method('execute'); $this->Dbo->hasAny($this->Model, array('TestModel.name' => 'harry')); $this->Dbo->hasAny($this->Model, array()); @@ -4029,18 +4022,15 @@ public function testUpdateStatements() { $this->Dbo = $this->getMock('Mysql', array('execute'), array($test->config)); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("UPDATE `$db`.`articles` SET `field1` = 'value1' WHERE 1 = 1"); + $this->Dbo->expects($this->at(0, array("UPDATE `$db`.`articles` SET `field1` = 'value1' WHERE 1 = 1")))->method('execute'); - $this->Dbo->expects($this->at(1))->method('execute') - ->with("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . + $this->Dbo->expects($this->at(1, array("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . "(`Article`.`user_id` = `User`.`id`)" . - " SET `Article`.`field1` = 2 WHERE 2=2"); + " SET `Article`.`field1` = 2 WHERE 2=2")))->method('execute'); - $this->Dbo->expects($this->at(2))->method('execute') - ->with("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . + $this->Dbo->expects($this->at(2, array("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . "(`Article`.`user_id` = `User`.`id`)" . - " SET `Article`.`field1` = 'value' WHERE `index` = 'val'"); + " SET `Article`.`field1` = 'value' WHERE `index` = 'val'")))->method('execute'); $Article = new Article(); @@ -4061,18 +4051,15 @@ public function testDeleteStatements() { $this->Dbo = $this->getMock('Mysql', array('execute'), array($test->config)); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE FROM `$db`.`articles` WHERE 1 = 1"); + $this->Dbo->expects($this->at(0, array("DELETE FROM `$db`.`articles` WHERE 1 = 1")))->method('execute'); - $this->Dbo->expects($this->at(1))->method('execute') - ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . + $this->Dbo->expects($this->at(1, array("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . "ON (`Article`.`user_id` = `User`.`id`)" . - " WHERE 1 = 1"); + " WHERE 1 = 1")))->method('execute'); - $this->Dbo->expects($this->at(2))->method('execute') - ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . + $this->Dbo->expects($this->at(2, array("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . "ON (`Article`.`user_id` = `User`.`id`)" . - " WHERE 2=2"); + " WHERE 2=2")))->method('execute'); $Article = new Article(); $this->Dbo->delete($Article); @@ -4092,11 +4079,9 @@ public function testDeleteNoComplexCondition() { $this->Dbo = $this->getMock('Mysql', array('execute'), array($test->config)); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` WHERE `id` = 1"); + $this->Dbo->expects($this->at(0, array("DELETE `Article` FROM `$db`.`articles` AS `Article` WHERE `id` = 1")))->method('execute'); - $this->Dbo->expects($this->at(1))->method('execute') - ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` WHERE NOT (`id` = 1)"); + $this->Dbo->expects($this->at(1, array("DELETE `Article` FROM `$db`.`articles` AS `Article` WHERE NOT (`id` = 1)")))->method('execute'); $Article = new Article(); @@ -4119,23 +4104,19 @@ public function testTruncateStatements() { $this->Dbo = $this->getMock('Mysql', array('execute'), array($db->config)); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("TRUNCATE TABLE `$schema`.`articles`"); + $this->Dbo->expects($this->at(0, array("TRUNCATE TABLE `$schema`.`articles`")))->method('execute'); $this->Dbo->truncate($Article); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("TRUNCATE TABLE `$schema`.`articles`"); + $this->Dbo->expects($this->at(0, array("TRUNCATE TABLE `$schema`.`articles`")))->method('execute'); $this->Dbo->truncate('articles'); // #2355: prevent duplicate prefix $this->Dbo->config['prefix'] = 'tbl_'; $Article->tablePrefix = 'tbl_'; - $this->Dbo->expects($this->at(0))->method('execute') - ->with("TRUNCATE TABLE `$schema`.`tbl_articles`"); + $this->Dbo->expects($this->at(0, array("TRUNCATE TABLE `$schema`.`tbl_articles`")))->method('execute'); $this->Dbo->truncate($Article); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("TRUNCATE TABLE `$schema`.`tbl_articles`"); + $this->Dbo->expects($this->at(0, array("TRUNCATE TABLE `$schema`.`tbl_articles`")))->method('execute'); $this->Dbo->truncate('articles'); } diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index ad8f766..9cba02c 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -1027,23 +1027,19 @@ public function testTruncateStatements() { $this->Dbo = $this->getMock('Postgres', array('execute'), array($db->config)); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE FROM \"$schema\".\"articles\""); + $this->Dbo->expects($this->at(0, array("DELETE FROM \"$schema\".\"articles\"")))->method('execute'); $this->Dbo->truncate($Article); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE FROM \"$schema\".\"articles\""); + $this->Dbo->expects($this->at(0, array("DELETE FROM \"$schema\".\"articles\"")))->method('execute'); $this->Dbo->truncate('articles'); // #2355: prevent duplicate prefix $this->Dbo->config['prefix'] = 'tbl_'; $Article->tablePrefix = 'tbl_'; - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE FROM \"$schema\".\"tbl_articles\""); + $this->Dbo->expects($this->at(0, array("DELETE FROM \"$schema\".\"tbl_articles\"")))->method('execute'); $this->Dbo->truncate($Article); - $this->Dbo->expects($this->at(0))->method('execute') - ->with("DELETE FROM \"$schema\".\"tbl_articles\""); + $this->Dbo->expects($this->at(0, array("DELETE FROM \"$schema\".\"tbl_articles\"")))->method('execute'); $this->Dbo->truncate('articles'); } diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 469e9f8..55b96b9 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -1420,7 +1420,7 @@ public function testGetLockingHint() { public function testLastError() { $class = $this->isPHP81() ? 'PDOStatementFake' : 'PDOStatement'; $stmt = $this->getMock($class, array('errorInfo')); - $stmt->expects($this->any()) + $stmt ->method('errorInfo') ->will($this->returnValue(array('', 'something', 'bad'))); @@ -1478,10 +1478,10 @@ public function testTransactionNested() { $db->nestedSupport = true; $conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true)); - $conn->expects($this->at(1))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true)); - $conn->expects($this->at(2))->method('exec')->with($this->equalTo('RELEASE SAVEPOINT LEVEL1'))->will($this->returnValue(true)); - $conn->expects($this->at(3))->method('exec')->with($this->equalTo('SAVEPOINT LEVEL1'))->will($this->returnValue(true)); - $conn->expects($this->at(4))->method('exec')->with($this->equalTo('ROLLBACK TO SAVEPOINT LEVEL1'))->will($this->returnValue(true)); + $conn->expects($this->at(1, array($this->equalTo('SAVEPOINT LEVEL1'))))->method('exec')->will($this->returnValue(true)); + $conn->expects($this->at(2, array($this->equalTo('RELEASE SAVEPOINT LEVEL1'))))->method('exec')->will($this->returnValue(true)); + $conn->expects($this->at(3, array($this->equalTo('SAVEPOINT LEVEL1'))))->method('exec')->will($this->returnValue(true)); + $conn->expects($this->at(4, array($this->equalTo('ROLLBACK TO SAVEPOINT LEVEL1'))))->method('exec')->will($this->returnValue(true)); $conn->expects($this->at(5))->method('commit')->will($this->returnValue(true)); $this->_runTransactions($db); @@ -1549,7 +1549,7 @@ protected function _runTransactions($db) { */ public function testBuildStatementDefaults() { $conn = $this->getMock('MockPDO', array('quote')); - $conn->expects($this->any()) + $conn ->method('quote') ->will($this->returnArgument(0)); $db = new DboTestSource(); @@ -1577,7 +1577,7 @@ public function testBuildStatementDefaults() { */ public function testBuildStatementWithHaving() { $conn = $this->getMock('MockPDO', array('quote')); - $conn->expects($this->any()) + $conn ->method('quote') ->will($this->returnArgument(0)); $db = new DboTestSource(); @@ -1606,7 +1606,7 @@ public function testBuildStatementWithHaving() { */ public function testBuildStatementWithLockingHint() { $conn = $this->getMock('MockPDO', array('quote')); - $conn->expects($this->any()) + $conn ->method('quote') ->will($this->returnArgument(0)); $db = new DboTestSource(); @@ -1669,7 +1669,7 @@ public static function joinStatements() { #[\PHPUnit\Framework\Attributes\DataProvider('joinStatements')] public function testBuildJoinStatement($join, $expected) { $db = $this->getMock('DboTestSource', array('getSchemaName')); - $db->expects($this->any()) + $db ->method('getSchemaName') ->will($this->returnValue('cakephp')); $result = $db->buildJoinStatement($join); @@ -2061,8 +2061,8 @@ public function testUseConsistentAfterFind() { $Author = new Author(); $Post = $this->getMock('Post', array('afterFind'), array(), '', true); - $Post->expects($this->at(0))->method('afterFind')->with(array(array('Post' => $expected['Post'][0])), $this->isFalse())->will($this->returnArgument(0)); - $Post->expects($this->at(1))->method('afterFind')->with(array(array('Post' => $expected['Post'][1])), $this->isFalse())->will($this->returnArgument(0)); + $Post->expects($this->at(0, array(array(array('Post' => $expected['Post'][0])), $this->isFalse())))->method('afterFind')->will($this->returnArgument(0)); + $Post->expects($this->at(1, array(array(array('Post' => $expected['Post'][1])), $this->isFalse())))->method('afterFind')->will($this->returnArgument(0)); $Author->bindModel(array('hasMany' => array('Post' => array('limit' => 2, 'order' => 'Post.id')))); $Author->Post = $Post; @@ -2258,7 +2258,7 @@ public function testFindWithLockingHint() { $db = $this->getMock('DboTestSource', array('connect', '_execute', 'execute', 'describ')); $Test = $this->getMock('Test', array('getDataSource')); - $Test->expects($this->any()) + $Test ->method('getDataSource') ->will($this->returnValue($db)); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 4966677..ba2790d 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -8130,7 +8130,7 @@ protected function _getMockDboSource($methods = array()) { $db->endQuote = $testDb->endQuote; foreach ($passthrough as $method) { - $db->expects($this->any()) + $db ->method($method) ->will($this->returnCallback(array($testDb, $method))); } diff --git a/lib/Cake/Test/Case/Model/Validator/CakeValidationRuleTest.php b/lib/Cake/Test/Case/Model/Validator/CakeValidationRuleTest.php index 7e60340..1ca7af2 100644 --- a/lib/Cake/Test/Case/Model/Validator/CakeValidationRuleTest.php +++ b/lib/Cake/Test/Case/Model/Validator/CakeValidationRuleTest.php @@ -185,7 +185,7 @@ public function testIsEmptyAllowed() { */ public function testCheckRequiredWhenRequiredAndAllowEmpty() { $Rule = $this->getMock('CakeValidationRule', array('isRequired')); - $Rule->expects($this->any()) + $Rule ->method('isRequired') ->will($this->returnValue(true)); $Rule->allowEmpty = true; diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 48cf6b5..93bd985 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -226,20 +226,20 @@ public function testSend() { $response->body('the response body'); $response->expects($this->once())->method('_sendContent')->with('the response body'); $response->expects($this->at(0))->method('_setCookies'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Language', 'es'); - $response->expects($this->at(3)) - ->method('_sendHeader')->with('WWW-Authenticate', 'Negotiate'); - $response->expects($this->at(4)) - ->method('_sendHeader')->with('Access-Control-Allow-Origin', 'domain1'); - $response->expects($this->at(5)) - ->method('_sendHeader')->with('Access-Control-Allow-Origin', 'domain2'); - $response->expects($this->at(6)) - ->method('_sendHeader')->with('Content-Length', 17); - $response->expects($this->at(7)) - ->method('_sendHeader')->with('Content-Type', 'text/html; charset=UTF-8'); + $response->expects($this->at(1, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Language', 'es'))) + ->method('_sendHeader'); + $response->expects($this->at(3, array('WWW-Authenticate', 'Negotiate'))) + ->method('_sendHeader'); + $response->expects($this->at(4, array('Access-Control-Allow-Origin', 'domain1'))) + ->method('_sendHeader'); + $response->expects($this->at(5, array('Access-Control-Allow-Origin', 'domain2'))) + ->method('_sendHeader'); + $response->expects($this->at(6, array('Content-Length', 17))) + ->method('_sendHeader'); + $response->expects($this->at(7, array('Content-Type', 'text/html; charset=UTF-8'))) + ->method('_sendHeader'); $response->send(); } @@ -270,12 +270,12 @@ public function testSendChangingContentType($original, $expected) { $response->body('the response body'); $response->expects($this->once())->method('_sendContent')->with('the response body'); $response->expects($this->at(0))->method('_setCookies'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Length', 17); - $response->expects($this->at(3)) - ->method('_sendHeader')->with('Content-Type', $expected); + $response->expects($this->at(1, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Length', 17))) + ->method('_sendHeader'); + $response->expects($this->at(3, array('Content-Type', $expected))) + ->method('_sendHeader'); $response->send(); } @@ -292,12 +292,12 @@ public function testSendChangingContentTypeWithoutCharset() { $response->body('var $foo = "bar";'); $response->expects($this->once())->method('_sendContent')->with('var $foo = "bar";'); $response->expects($this->at(0))->method('_setCookies'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Length', 17); - $response->expects($this->at(3)) - ->method('_sendHeader')->with('Content-Type', 'application/javascript'); + $response->expects($this->at(1, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Length', 17))) + ->method('_sendHeader'); + $response->expects($this->at(3, array('Content-Type', 'application/javascript'))) + ->method('_sendHeader'); $response->send(); } @@ -310,12 +310,12 @@ public function testSendWithLocation() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); $response->header('Location', 'http://www.example.com'); $response->expects($this->at(0))->method('_setCookies'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('HTTP/1.1 302 Found'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Location', 'http://www.example.com'); - $response->expects($this->at(3)) - ->method('_sendHeader')->with('Content-Type', 'text/html; charset=UTF-8'); + $response->expects($this->at(1, array('HTTP/1.1 302 Found'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Location', 'http://www.example.com'))) + ->method('_sendHeader'); + $response->expects($this->at(3, array('Content-Type', 'text/html; charset=UTF-8'))) + ->method('_sendHeader'); $response->send(); } @@ -531,24 +531,24 @@ public function testSendContentLength() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->body('the response body'); $response->expects($this->once())->method('_sendContent')->with('the response body'); - $response->expects($this->at(0)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Type', 'text/html; charset=UTF-8'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Content-Length', strlen('the response body')); + $response->expects($this->at(0, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Type', 'text/html; charset=UTF-8'))) + ->method('_sendHeader'); + $response->expects($this->at(1, array('Content-Length', strlen('the response body')))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $body = '長い長い長いSubjectの場合はfoldingするのが正しいんだけどいったいどうなるんだろう?'; $response->body($body); $response->expects($this->once())->method('_sendContent')->with($body); - $response->expects($this->at(0)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Type', 'text/html; charset=UTF-8'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Content-Length', 116); + $response->expects($this->at(0, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Type', 'text/html; charset=UTF-8'))) + ->method('_sendHeader'); + $response->expects($this->at(1, array('Content-Length', 116))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', 'outputCompressed')); @@ -565,8 +565,8 @@ public function testSendContentLength() { $response->header('Content-Length', 1); $response->expects($this->never())->method('outputCompressed'); $response->expects($this->once())->method('_sendContent')->with($body); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Content-Length', 1); + $response->expects($this->at(1, array('Content-Length', 1))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -585,12 +585,12 @@ public function testSendContentLength() { $body = '長い長い長いSubjectの場合はfoldingするのが正しいんだけどいったいどうなるんだろう?'; $response->body($body); $response->expects($this->once())->method('_sendContent')->with($body); - $response->expects($this->at(0)) - ->method('_sendHeader')->with('HTTP/1.1 200 OK'); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Content-Length', strlen($goofyOutput) + 116); - $response->expects($this->at(2)) - ->method('_sendHeader')->with('Content-Type', 'text/html; charset=UTF-8'); + $response->expects($this->at(0, array('HTTP/1.1 200 OK'))) + ->method('_sendHeader'); + $response->expects($this->at(1, array('Content-Length', strlen($goofyOutput) + 116))) + ->method('_sendHeader'); + $response->expects($this->at(2, array('Content-Type', 'text/html; charset=UTF-8'))) + ->method('_sendHeader'); $response->send(); ob_end_clean(); } @@ -604,8 +604,8 @@ public function testProtocol() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->protocol('HTTP/1.0'); $this->assertEquals('HTTP/1.0', $response->protocol()); - $response->expects($this->at(0)) - ->method('_sendHeader')->with('HTTP/1.0 200 OK'); + $response->expects($this->at(0, array('HTTP/1.0 200 OK'))) + ->method('_sendHeader'); $response->send(); } @@ -618,8 +618,8 @@ public function testLength() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->length(100); $this->assertEquals(100, $response->length()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Content-Length', 100); + $response->expects($this->at(1, array('Content-Length', 100))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -670,24 +670,24 @@ public function testExpires() { $response->expires($now); $now->setTimeZone(new DateTimeZone('UTC')); $this->assertEquals($now->format('D, j M Y H:i:s') . ' GMT', $response->expires()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Expires', $now->format('D, j M Y H:i:s') . ' GMT'); + $response->expects($this->at(1, array('Expires', $now->format('D, j M Y H:i:s') . ' GMT'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $now = time(); $response->expires($now); $this->assertEquals(gmdate('D, j M Y H:i:s', $now) . ' GMT', $response->expires()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Expires', gmdate('D, j M Y H:i:s', $now) . ' GMT'); + $response->expects($this->at(1, array('Expires', gmdate('D, j M Y H:i:s', $now) . ' GMT'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $time = new DateTime('+1 day', new DateTimeZone('UTC')); $response->expires('+1 day'); $this->assertEquals($time->format('D, j M Y H:i:s') . ' GMT', $response->expires()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Expires', $time->format('D, j M Y H:i:s') . ' GMT'); + $response->expects($this->at(1, array('Expires', $time->format('D, j M Y H:i:s') . ' GMT'))) + ->method('_sendHeader'); $response->send(); } @@ -702,24 +702,24 @@ public function testModified() { $response->modified($now); $now->setTimeZone(new DateTimeZone('UTC')); $this->assertEquals($now->format('D, j M Y H:i:s') . ' GMT', $response->modified()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Last-Modified', $now->format('D, j M Y H:i:s') . ' GMT'); + $response->expects($this->at(1, array('Last-Modified', $now->format('D, j M Y H:i:s') . ' GMT'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $now = time(); $response->modified($now); $this->assertEquals(gmdate('D, j M Y H:i:s', $now) . ' GMT', $response->modified()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Last-Modified', gmdate('D, j M Y H:i:s', $now) . ' GMT'); + $response->expects($this->at(1, array('Last-Modified', gmdate('D, j M Y H:i:s', $now) . ' GMT'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $time = new DateTime('+1 day', new DateTimeZone('UTC')); $response->modified('+1 day'); $this->assertEquals($time->format('D, j M Y H:i:s') . ' GMT', $response->modified()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Last-Modified', $time->format('D, j M Y H:i:s') . ' GMT'); + $response->expects($this->at(1, array('Last-Modified', $time->format('D, j M Y H:i:s') . ' GMT'))) + ->method('_sendHeader'); $response->send(); } @@ -734,16 +734,16 @@ public function testSharable() { $response->sharable(true); $headers = $response->header(); $this->assertEquals('public', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'public'); + $response->expects($this->at(1, array('Cache-Control', 'public'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->sharable(false); $headers = $response->header(); $this->assertEquals('private', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'private'); + $response->expects($this->at(1, array('Cache-Control', 'private'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -753,8 +753,8 @@ public function testSharable() { $response->sharable(false); $headers = $response->header(); $this->assertEquals('private', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'private'); + $response->expects($this->at(1, array('Cache-Control', 'private'))) + ->method('_sendHeader'); $response->send(); $this->assertFalse($response->sharable()); $response->sharable(true); @@ -784,8 +784,8 @@ public function testMaxAge() { $this->assertEquals(3600, $response->maxAge()); $headers = $response->header(); $this->assertEquals('max-age=3600', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'max-age=3600'); + $response->expects($this->at(1, array('Cache-Control', 'max-age=3600'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -793,8 +793,8 @@ public function testMaxAge() { $response->sharable(false); $headers = $response->header(); $this->assertEquals('max-age=3600, private', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'max-age=3600, private'); + $response->expects($this->at(1, array('Cache-Control', 'max-age=3600, private'))) + ->method('_sendHeader'); $response->send(); } @@ -810,8 +810,8 @@ public function testSharedMaxAge() { $this->assertEquals(3600, $response->sharedMaxAge()); $headers = $response->header(); $this->assertEquals('s-maxage=3600', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 's-maxage=3600'); + $response->expects($this->at(1, array('Cache-Control', 's-maxage=3600'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -819,8 +819,8 @@ public function testSharedMaxAge() { $response->sharable(true); $headers = $response->header(); $this->assertEquals('s-maxage=3600, public', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 's-maxage=3600, public'); + $response->expects($this->at(1, array('Cache-Control', 's-maxage=3600, public'))) + ->method('_sendHeader'); $response->send(); } @@ -836,8 +836,8 @@ public function testMustRevalidate() { $this->assertTrue($response->mustRevalidate()); $headers = $response->header(); $this->assertEquals('must-revalidate', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 'must-revalidate'); + $response->expects($this->at(1, array('Cache-Control', 'must-revalidate'))) + ->method('_sendHeader'); $response->send(); $response->mustRevalidate(false); $this->assertFalse($response->mustRevalidate()); @@ -847,8 +847,8 @@ public function testMustRevalidate() { $response->mustRevalidate(true); $headers = $response->header(); $this->assertEquals('s-maxage=3600, must-revalidate', $headers['Cache-Control']); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Cache-Control', 's-maxage=3600, must-revalidate'); + $response->expects($this->at(1, array('Cache-Control', 's-maxage=3600, must-revalidate'))) + ->method('_sendHeader'); $response->send(); } @@ -861,14 +861,14 @@ public function testVary() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->vary('Accept-encoding'); $this->assertEquals(array('Accept-encoding'), $response->vary()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Vary', 'Accept-encoding'); + $response->expects($this->at(1, array('Vary', 'Accept-encoding'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->vary(array('Accept-language', 'Accept-encoding')); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Vary', 'Accept-language, Accept-encoding'); + $response->expects($this->at(1, array('Vary', 'Accept-language, Accept-encoding'))) + ->method('_sendHeader'); $response->send(); $this->assertEquals(array('Accept-language', 'Accept-encoding'), $response->vary()); } @@ -882,15 +882,15 @@ public function testEtag() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->etag('something'); $this->assertEquals('"something"', $response->etag()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Etag', '"something"'); + $response->expects($this->at(1, array('Etag', '"something"'))) + ->method('_sendHeader'); $response->send(); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response->etag('something', true); $this->assertEquals('W/"something"', $response->etag()); - $response->expects($this->at(1)) - ->method('_sendHeader')->with('Etag', 'W/"something"'); + $response->expects($this->at(1, array('Etag', 'W/"something"'))) + ->method('_sendHeader'); $response->send(); } @@ -1115,14 +1115,12 @@ public function testCors($request, $origin, $domains, $methods, $headers, $expec $i = 1; if ($expectedMethods) { - $response->expects($this->at($i++)) - ->method('header') - ->with('Access-Control-Allow-Methods', $expectedMethods ? $expectedMethods : $this->anything()); + $response->expects($this->at($i++, array('Access-Control-Allow-Methods', $expectedMethods ? $expectedMethods : $this->anything()))) + ->method('header'); } if ($expectedHeaders) { - $response->expects($this->at($i++)) - ->method('header') - ->with('Access-Control-Allow-Headers', $expectedHeaders ? $expectedHeaders : $this->anything()); + $response->expects($this->at($i++, array('Access-Control-Allow-Headers', $expectedHeaders ? $expectedHeaders : $this->anything()))) + ->method('header'); } $response->cors($request, $domains, $methods, $headers); @@ -1239,13 +1237,11 @@ public function testFile() { ->with('css') ->will($this->returnArgument(0)); - $response->expects($this->at(1)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(1, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with('Content-Length', 38); + $response->expects($this->at(2, array('Content-Length', 38))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); $response->expects($this->once())->method('_flushBuffer'); @@ -1292,17 +1288,14 @@ public function testFileWithUnknownFileTypeGeneric() { ->method('download') ->with('no_section.ini'); - $response->expects($this->at(2)) - ->method('header') - ->with('Content-Transfer-Encoding', 'binary'); + $response->expects($this->at(2, array('Content-Transfer-Encoding', 'binary'))) + ->method('header'); - $response->expects($this->at(3)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(3, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(4)) - ->method('header') - ->with('Content-Length', 35); + $response->expects($this->at(4, array('Content-Length', 35))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); $response->expects($this->once())->method('_flushBuffer'); @@ -1343,31 +1336,28 @@ public function testFileWithUnknownFileTypeOpera() { '_flushBuffer' )); - $response->expects($this->at(0)) + $response->expects($this->at(0, array('ini'))) ->method('type') - ->with('ini') + ->will($this->returnValue(false)); - $response->expects($this->at(1)) + $response->expects($this->at(1, array('application/octet-stream'))) ->method('type') - ->with('application/octet-stream') + ->will($this->returnValue(false)); $response->expects($this->once()) ->method('download') ->with('no_section.ini'); - $response->expects($this->at(3)) - ->method('header') - ->with('Content-Transfer-Encoding', 'binary'); + $response->expects($this->at(3, array('Content-Transfer-Encoding', 'binary'))) + ->method('header'); - $response->expects($this->at(4)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(4, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(5)) - ->method('header') - ->with('Content-Length', 35); + $response->expects($this->at(5, array('Content-Length', 35))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); $response->expects($this->once())->method('_flushBuffer'); @@ -1407,31 +1397,28 @@ public function testFileWithUnknownFileTypeIE() { '_flushBuffer' )); - $response->expects($this->at(0)) + $response->expects($this->at(0, array('ini'))) ->method('type') - ->with('ini') + ->will($this->returnValue(false)); - $response->expects($this->at(1)) + $response->expects($this->at(1, array('application/force-download'))) ->method('type') - ->with('application/force-download') + ->will($this->returnValue(false)); $response->expects($this->once()) ->method('download') ->with('config.ini'); - $response->expects($this->at(3)) - ->method('header') - ->with('Content-Transfer-Encoding', 'binary'); + $response->expects($this->at(3, array('Content-Transfer-Encoding', 'binary'))) + ->method('header'); - $response->expects($this->at(4)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(4, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(5)) - ->method('header') - ->with('Content-Length', 35); + $response->expects($this->at(5, array('Content-Length', 35))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); $response->expects($this->once())->method('_flushBuffer'); @@ -1477,9 +1464,8 @@ public function testFileWithUnknownFileNoDownload() { ->with('ini') ->will($this->returnValue(false)); - $response->expects($this->at(1)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(1, array('Accept-Ranges', 'bytes'))) + ->method('header'); $response->expects($this->never()) ->method('download'); @@ -1510,7 +1496,7 @@ public function testConnectionAbortedOnBuffering() { '_flushBuffer' )); - $response->expects($this->any()) + $response->expects($this->atLeastOnce()) ->method('type') ->with('css') ->will($this->returnArgument(0)); @@ -1545,7 +1531,7 @@ public function testFileUpperExtension() { '_flushBuffer' )); - $response->expects($this->any()) + $response->expects($this->atLeastOnce()) ->method('type') ->with('jpg') ->will($this->returnArgument(0)); @@ -1574,7 +1560,7 @@ public function testFileExtensionNotSet() { '_flushBuffer' )); - $response->expects($this->any()) + $response->expects($this->atLeastOnce()) ->method('type') ->with('jpg') ->will($this->returnArgument(0)); @@ -1627,26 +1613,22 @@ public function testFileRangeOffsets($range, $length, $offsetResponse) { '_flushBuffer' )); - $response->expects($this->at(1)) - ->method('header') - ->with('Content-Disposition', 'attachment; filename="test_asset.css"'); + $response->expects($this->at(1, array('Content-Disposition', 'attachment; filename="test_asset.css"'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with('Content-Transfer-Encoding', 'binary'); + $response->expects($this->at(2, array('Content-Transfer-Encoding', 'binary'))) + ->method('header'); - $response->expects($this->at(3)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(3, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(4)) - ->method('header') - ->with(array( + $response->expects($this->at(4, array(array( 'Content-Length' => $length, 'Content-Range' => $offsetResponse, - )); + )))) + ->method('header'); - $response->expects($this->any()) + $response->expects($this->anyInvocation()) ->method('_isActive') ->will($this->returnValue(true)); @@ -1682,28 +1664,24 @@ public function testFileRange() { ->with('css') ->will($this->returnArgument(0)); - $response->expects($this->at(1)) - ->method('header') - ->with('Content-Disposition', 'attachment; filename="test_asset.css"'); + $response->expects($this->at(1, array('Content-Disposition', 'attachment; filename="test_asset.css"'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with('Content-Transfer-Encoding', 'binary'); + $response->expects($this->at(2, array('Content-Transfer-Encoding', 'binary'))) + ->method('header'); - $response->expects($this->at(3)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(3, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(4)) - ->method('header') - ->with(array( + $response->expects($this->at(4, array(array( 'Content-Length' => 18, 'Content-Range' => 'bytes 8-25/38', - )); + )))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); - $response->expects($this->any()) + $response->expects($this->anyInvocation()) ->method('_isActive') ->will($this->returnValue(true)); @@ -1814,18 +1792,16 @@ public function testFileRangeOffsetsNoDownload($range, $length, $offsetResponse) '_flushBuffer' )); - $response->expects($this->at(1)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(1, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with(array( + $response->expects($this->at(2, array(array( 'Content-Length' => $length, 'Content-Range' => $offsetResponse, - )); + )))) + ->method('header'); - $response->expects($this->any()) + $response->expects($this->anyInvocation()) ->method('_isActive') ->will($this->returnValue(true)); @@ -1861,20 +1837,18 @@ public function testFileRangeNoDownload() { ->with('css') ->will($this->returnArgument(0)); - $response->expects($this->at(1)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(1, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with(array( + $response->expects($this->at(2, array(array( 'Content-Length' => 18, 'Content-Range' => 'bytes 8-25/38', - )); + )))) + ->method('header'); $response->expects($this->once())->method('_clearBuffer'); - $response->expects($this->any()) + $response->expects($this->anyInvocation()) ->method('_isActive') ->will($this->returnValue(true)); @@ -1908,15 +1882,13 @@ public function testFileRangeInvalidNoDownload() { '_flushBuffer' )); - $response->expects($this->at(1)) - ->method('header') - ->with('Accept-Ranges', 'bytes'); + $response->expects($this->at(1, array('Accept-Ranges', 'bytes'))) + ->method('header'); - $response->expects($this->at(2)) - ->method('header') - ->with(array( + $response->expects($this->at(2, array(array( 'Content-Range' => 'bytes 0-37/38', - )); + )))) + ->method('header'); $response->file( CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'css' . DS . 'test_asset.css', diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index 5210f2e..f52449e 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -57,7 +57,7 @@ public function testSendData() { 'Date' => $date, 'X-add' => mb_encode_mimeheader($longNonAscii, 'utf8', 'B'), )); - $email->expects($this->any())->method('message') + $email->method('message') ->will($this->returnValue(array('First Line', 'Second Line', '.Third Line', ''))); $encoded = '=?UTF-8?B?Rm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXog?='; diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index 23189ee..fdae9e5 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -82,8 +82,8 @@ public function setUp(): void { * @return void */ public function testConnectEhlo() { - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); - $this->socket->expects($this->any()) + $this->socket->method('connect')->will($this->returnValue(true)); + $this->socket ->method('read') ->will($this->onConsecutiveCalls( "220 Welcome message\r\n", @@ -100,14 +100,14 @@ public function testConnectEhlo() { */ public function testConnectEhloTls() { $this->SmtpTransport->config(array('tls' => true)); - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 Accepted\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("STARTTLS\r\n"); + $this->socket->expects($this->at(4, array("STARTTLS\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("220 Server ready\r\n")); - $this->socket->expects($this->at(6))->method('enableCrypto')->with('tls')->will($this->returnValue(true)); - $this->socket->expects($this->at(7))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(6, array('tls')))->method('enableCrypto')->will($this->returnValue(true)); + $this->socket->expects($this->at(7, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(8))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); } @@ -121,11 +121,11 @@ public function testConnectEhloTlsOnNonTlsServer() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP server did not accept the connection or trying to connect to non TLS SMTP server using TLS.'); $this->SmtpTransport->config(array('tls' => true)); - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 Accepted\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("STARTTLS\r\n"); + $this->socket->expects($this->at(4, array("STARTTLS\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("500 5.3.3 Unrecognized command\r\n")); $this->SmtpTransport->connect(); } @@ -139,11 +139,11 @@ public function testConnectEhloNoTlsOnRequiredTlsServer() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP authentication method not allowed, check if SMTP server requires TLS.'); $this->SmtpTransport->config(array('tls' => false, 'username' => 'user', 'password' => 'pass')); - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 Accepted\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(4, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("504 5.7.4 Unrecognized authentication type\r\n")); $this->SmtpTransport->connect(); $this->SmtpTransport->auth(); @@ -155,11 +155,11 @@ public function testConnectEhloNoTlsOnRequiredTlsServer() { * @return void */ public function testConnectHelo() { - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("HELO localhost\r\n"); + $this->socket->expects($this->at(4, array("HELO localhost\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); } @@ -172,11 +172,11 @@ public function testConnectHelo() { public function testConnectFail() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP server did not accept the connection.'); - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("HELO localhost\r\n"); + $this->socket->expects($this->at(4, array("HELO localhost\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); $this->SmtpTransport->connect(); } @@ -187,11 +187,11 @@ public function testConnectFail() { * @return void */ public function testAuth() { - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("334 Login\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("bWFyaw==\r\n"); + $this->socket->expects($this->at(2, array("bWFyaw==\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("334 Pass\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("c3Rvcnk=\r\n"); + $this->socket->expects($this->at(4, array("c3Rvcnk=\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("235 OK\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); $this->SmtpTransport->auth(); @@ -205,7 +205,7 @@ public function testAuth() { public function testAuthNotRecognized() { $this->expectException('SocketException'); $this->expectExceptionMessage('AUTH command not recognized or not implemented, SMTP server may not require authentication.'); - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("500 5.3.3 Unrecognized command\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); $this->SmtpTransport->auth(); @@ -219,7 +219,7 @@ public function testAuthNotRecognized() { public function testAuthNotImplemented() { $this->expectException('SocketException'); $this->expectExceptionMessage('AUTH command not recognized or not implemented, SMTP server may not require authentication.'); - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read') ->will($this->returnValue("502 5.3.3 Command not implemented\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); @@ -234,7 +234,7 @@ public function testAuthNotImplemented() { public function testAuthBadSequence() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP Error: 503 5.5.1 Already authenticated'); - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read') ->will($this->returnValue("503 5.5.1 Already authenticated\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); @@ -249,9 +249,9 @@ public function testAuthBadSequence() { public function testAuthBadUsername() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP server did not accept the username.'); - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("334 Login\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("bWFyaw==\r\n"); + $this->socket->expects($this->at(2, array("bWFyaw==\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("535 5.7.8 Authentication failed\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); $this->SmtpTransport->auth(); @@ -265,11 +265,11 @@ public function testAuthBadUsername() { public function testAuthBadPassword() { $this->expectException('SocketException'); $this->expectExceptionMessage('SMTP server did not accept the password.'); - $this->socket->expects($this->at(0))->method('write')->with("AUTH LOGIN\r\n"); + $this->socket->expects($this->at(0, array("AUTH LOGIN\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("334 Login\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("bWFyaw==\r\n"); + $this->socket->expects($this->at(2, array("bWFyaw==\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("334 Pass\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("c3Rvcnk=\r\n"); + $this->socket->expects($this->at(4, array("c3Rvcnk=\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("535 5.7.8 Authentication failed\r\n")); $this->SmtpTransport->config(array('username' => 'mark', 'password' => 'story')); $this->SmtpTransport->auth(); @@ -281,7 +281,7 @@ public function testAuthBadPassword() { * @return void */ public function testAuthNoAuth() { - $this->socket->expects($this->any())->method('write')->with($this->logicalNot($this->stringContains('AUTH LOGIN'))); + $this->socket->expects($this->never())->method('write'); $this->SmtpTransport->config(array('username' => null, 'password' => null)); $this->SmtpTransport->auth(); @@ -300,15 +300,15 @@ public function testRcpt() { $email->bcc('phpnut@cakephp.org'); $email->cc(array('mark@cakephp.org' => 'Mark Story', 'juan@cakephp.org' => 'Juan Basso')); - $this->socket->expects($this->at(0))->method('write')->with("MAIL FROM:\r\n"); + $this->socket->expects($this->at(0, array("MAIL FROM:\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(2, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(4))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(4, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(6))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(6, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(8))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(8, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(9))->method('read')->will($this->returnValue("250 OK\r\n")); $this->SmtpTransport->sendRcpt($email); @@ -325,9 +325,9 @@ public function testRcptWithReturnPath() { $email->to('cake@cakephp.org', 'CakePHP'); $email->returnPath('pleasereply@cakephp.org', 'CakePHP Return'); - $this->socket->expects($this->at(0))->method('write')->with("MAIL FROM:\r\n"); + $this->socket->expects($this->at(0, array("MAIL FROM:\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(2, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 OK\r\n")); $this->SmtpTransport->sendRcpt($email); @@ -368,9 +368,9 @@ public function testSendData() { $data .= "\r\n"; $data .= "\r\n\r\n.\r\n"; - $this->socket->expects($this->at(0))->method('write')->with("DATA\r\n"); + $this->socket->expects($this->at(0, array("DATA\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("354 OK\r\n")); - $this->socket->expects($this->at(2))->method('write')->with($data); + $this->socket->expects($this->at(2, array($data)))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 OK\r\n")); $this->SmtpTransport->sendData($email); @@ -382,7 +382,7 @@ public function testSendData() { * @return void */ public function testQuit() { - $this->socket->expects($this->at(0))->method('write')->with("QUIT\r\n"); + $this->socket->expects($this->at(0, array("QUIT\r\n")))->method('write'); $this->SmtpTransport->disconnect(); } @@ -411,9 +411,9 @@ public function testEmptyConfigArray() { public function testGetLastResponse() { $this->assertEmpty($this->SmtpTransport->getLastResponse()); - $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->socket->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2, array("EHLO localhost\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250-PIPELINING\r\n")); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250-SIZE 102400000\r\n")); $this->socket->expects($this->at(5))->method('read')->will($this->returnValue("250-VRFY\r\n")); @@ -445,9 +445,9 @@ public function testGetLastResponse() { $email->from('noreply@cakephp.org', 'CakePHP Test'); $email->to('cake@cakephp.org', 'CakePHP'); - $this->socket->expects($this->at(0))->method('write')->with("MAIL FROM:\r\n"); + $this->socket->expects($this->at(0, array("MAIL FROM:\r\n")))->method('write'); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("250 OK\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("RCPT TO:\r\n"); + $this->socket->expects($this->at(2, array("RCPT TO:\r\n")))->method('write'); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 OK\r\n")); $this->SmtpTransport->sendRcpt($email); diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 4683130..2944487 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -307,7 +307,7 @@ public function testConfigUri() { * @return void */ public function testRequest() { - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->returnValue(false)); @@ -579,7 +579,7 @@ public function testRequest() { * @return void */ public function testGetWithSchemeAndPort() { - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->returnValue(false)); @@ -603,7 +603,7 @@ public function testGetWithSchemeAndPort() { * @return void */ public function testRequestWithStringQuery() { - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->returnValue(false)); @@ -643,12 +643,11 @@ public function testRequest2() { $request = array('uri' => 'htpp://www.cakephp.org/'); $number = mt_rand(0, 9999999); - $this->Socket->expects($this->any())->method('connect')->will($this->returnValue(true)); + $this->Socket->method('connect')->will($this->returnValue(true)); $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

Hello, your lucky number is " . $number . "

"; - $this->Socket->expects($this->at(0))->method('write') - ->with("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n"); + $this->Socket->expects($this->at(0, array("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n")))->method('write'); - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse, false)); @@ -665,7 +664,7 @@ public function testRequest3() { $request = array('uri' => 'htpp://www.cakephp.org/'); $serverResponse = "HTTP/1.x 200 OK\r\nSet-Cookie: foo=bar\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

This is a cookie test!

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse, false)); @@ -702,11 +701,11 @@ public function testRequestWithConstructor() { $http = $this->getMock('TestHttpSocket', array('read', 'write', 'connect', 'request'), array($request)); $expected = array('method' => 'GET', 'uri' => 'http://localhost:5984/_test'); - $http->expects($this->at(0))->method('request')->with($expected); + $http->expects($this->at(0, array($expected)))->method('request'); $http->get('/_test'); $expected = array('method' => 'GET', 'uri' => 'http://localhost:5984/_test?count=4'); - $http->expects($this->at(0))->method('request')->with($expected); + $http->expects($this->at(0, array($expected)))->method('request'); $http->get('/_test', array('count' => 4)); } @@ -718,7 +717,7 @@ public function testRequestWithConstructor() { public function testRequestWithResource() { $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

This is a test!

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse, false, $serverResponse, false)); $this->Socket->connected = true; @@ -790,7 +789,7 @@ public function testRequestWithCrossCookie() { public function testRequestCustomResponse() { $this->Socket->connected = true; $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

This is a test!

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse, false)); @@ -817,17 +816,16 @@ public function testRequestWithRedirectUrlEncoded() { ->method('read') ->will($this->returnValue($serverResponse1)); - $this->Socket->expects($this->at(3)) - ->method('write') - ->with($this->logicalAnd( + $this->Socket->expects($this->at(3, array($this->logicalAnd( $this->stringContains('Host: i.cmpnet.com'), $this->stringContains('GET /techonline/pdf/a+b.pdf') - )); + )))) + ->method('write'); $this->Socket->expects($this->at(4)) ->method('read') ->will($this->returnValue($serverResponse2)); - $this->Socket->expects($this->any()) + $this->Socket ->method('read')->will($this->returnValue(false)); $response = $this->Socket->request($request); @@ -847,7 +845,7 @@ public function testRequestWithRedirectAsTrue() { $serverResponse1 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://localhost/anotheruri\r\n\r\n"; $serverResponse2 = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

You have been redirected

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse1, false, $serverResponse2, false)); @@ -868,7 +866,7 @@ public function testRequestWithRedirectAsInt() { $serverResponse1 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://localhost/anotheruri\r\n\r\n"; $serverResponse2 = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n

You have been redirected

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse1, false, $serverResponse2, false)); @@ -889,7 +887,7 @@ public function testRequestWithRedirectAsIntReachingZero() { $serverResponse1 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://localhost/oneruri\r\n\r\n"; $serverResponse2 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://localhost/anotheruri\r\n\r\n"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse1, false, $serverResponse2, false)); @@ -906,8 +904,8 @@ public function testRequestWithRedirectAsIntReachingZero() { */ public function testProxy() { $this->Socket->reset(); - $this->Socket->expects($this->any())->method('connect')->will($this->returnValue(true)); - $this->Socket->expects($this->any())->method('read')->will($this->returnValue(false)); + $this->Socket->method('connect')->will($this->returnValue(true)); + $this->Socket->method('read')->will($this->returnValue(false)); $this->Socket->configProxy('proxy.server', 123); $expected = "GET http://www.cakephp.org/ HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n"; @@ -1036,33 +1034,26 @@ public function testUrl() { public function testGet() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'http://www.google.com/')); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'GET', 'uri' => 'http://www.google.com/')))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=bar')); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=bar')))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=bar')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=bar')))) + ->method('request'); - $this->RequestSocket->expects($this->at(3)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=23&foobar=42')); + $this->RequestSocket->expects($this->at(3, array(array('method' => 'GET', 'uri' => 'http://www.google.com/?foo=23&foobar=42')))) + ->method('request'); - $this->RequestSocket->expects($this->at(4)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'http://www.google.com/', 'version' => '1.0')); + $this->RequestSocket->expects($this->at(4, array(array('method' => 'GET', 'uri' => 'http://www.google.com/', 'version' => '1.0')))) + ->method('request'); - $this->RequestSocket->expects($this->at(5)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'https://secure.example.com/test.php?one=two')); + $this->RequestSocket->expects($this->at(5, array(array('method' => 'GET', 'uri' => 'https://secure.example.com/test.php?one=two')))) + ->method('request'); - $this->RequestSocket->expects($this->at(6)) - ->method('request') - ->with(array('method' => 'GET', 'uri' => 'https://example.com/oauth/access?clientid=123&redirect_uri=http%3A%2F%2Fexample.com&code=456')); + $this->RequestSocket->expects($this->at(6, array(array('method' => 'GET', 'uri' => 'https://example.com/oauth/access?clientid=123&redirect_uri=http%3A%2F%2Fexample.com&code=456')))) + ->method('request'); $this->RequestSocket->get('http://www.google.com/'); $this->RequestSocket->get('http://www.google.com/', array('foo' => 'bar')); @@ -1084,33 +1075,26 @@ public function testGet() { */ public function testHead() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'http://www.google.com/')); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'HEAD', 'uri' => 'http://www.google.com/')))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=bar')); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=bar')))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=bar')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=bar')))) + ->method('request'); - $this->RequestSocket->expects($this->at(3)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=23&foobar=42')); + $this->RequestSocket->expects($this->at(3, array(array('method' => 'HEAD', 'uri' => 'http://www.google.com/?foo=23&foobar=42')))) + ->method('request'); - $this->RequestSocket->expects($this->at(4)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'http://www.google.com/', 'version' => '1.0')); + $this->RequestSocket->expects($this->at(4, array(array('method' => 'HEAD', 'uri' => 'http://www.google.com/', 'version' => '1.0')))) + ->method('request'); - $this->RequestSocket->expects($this->at(5)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'https://secure.example.com/test.php?one=two')); + $this->RequestSocket->expects($this->at(5, array(array('method' => 'HEAD', 'uri' => 'https://secure.example.com/test.php?one=two')))) + ->method('request'); - $this->RequestSocket->expects($this->at(6)) - ->method('request') - ->with(array('method' => 'HEAD', 'uri' => 'https://example.com/oauth/access?clientid=123&redirect_uri=http%3A%2F%2Fexample.com&code=456')); + $this->RequestSocket->expects($this->at(6, array(array('method' => 'HEAD', 'uri' => 'https://example.com/oauth/access?clientid=123&redirect_uri=http%3A%2F%2Fexample.com&code=456')))) + ->method('request'); $this->RequestSocket->head('http://www.google.com/'); $this->RequestSocket->head('http://www.google.com/', array('foo' => 'bar')); @@ -1131,7 +1115,7 @@ public function testHead() { * @return void */ public function testAuth() { - $this->Socket->expects($this->any()) + $this->Socket ->method('read')->will($this->returnValue(false)); $this->Socket->get('http://mark:secret@example.com/test'); @@ -1175,7 +1159,7 @@ public function testAuth() { * @return void */ public function testConsecutiveGetResetsAuthCredentials() { - $this->Socket->expects($this->any()) + $this->Socket ->method('read')->will($this->returnValue(false)); $this->Socket->get('http://mark:secret@example.com/test'); @@ -1206,17 +1190,14 @@ public function testConsecutiveGetResetsAuthCredentials() { */ public function testPost() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => array())); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => array())))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'POST', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')))) + ->method('request'); $this->RequestSocket->post('http://www.google.com/'); $this->RequestSocket->post('http://www.google.com/', array('Foo' => 'bar')); @@ -1230,17 +1211,14 @@ public function testPost() { */ public function testPut() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => array())); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => array())))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'PUT', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')))) + ->method('request'); $this->RequestSocket->put('http://www.google.com/'); $this->RequestSocket->put('http://www.google.com/', array('Foo' => 'bar')); @@ -1254,17 +1232,14 @@ public function testPut() { */ public function testPatch() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => array())); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => array())))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'PATCH', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')))) + ->method('request'); $this->RequestSocket->patch('http://www.google.com/'); $this->RequestSocket->patch('http://www.google.com/', array('Foo' => 'bar')); @@ -1278,17 +1253,14 @@ public function testPatch() { */ public function testDelete() { $this->RequestSocket->reset(); - $this->RequestSocket->expects($this->at(0)) - ->method('request') - ->with(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => array())); + $this->RequestSocket->expects($this->at(0, array(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => array())))) + ->method('request'); - $this->RequestSocket->expects($this->at(1)) - ->method('request') - ->with(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))); + $this->RequestSocket->expects($this->at(1, array(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => array('Foo' => 'bar'))))) + ->method('request'); - $this->RequestSocket->expects($this->at(2)) - ->method('request') - ->with(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')); + $this->RequestSocket->expects($this->at(2, array(array('method' => 'DELETE', 'uri' => 'http://www.google.com/', 'body' => null, 'line' => 'Hey Server')))) + ->method('request'); $this->RequestSocket->delete('http://www.google.com/'); $this->RequestSocket->delete('http://www.google.com/', array('Foo' => 'bar')); @@ -1876,7 +1848,7 @@ public function testResponseStatusParsing($status, $code, $msg = '') { $this->Socket->connected = true; $serverResponse = $status . "\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\n\r\n

This is a test!

"; - $this->Socket->expects($this->any()) + $this->Socket ->method('read') ->will($this->onConsecutiveCalls($serverResponse, false)); diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index 9f6110d..6d06f7c 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -210,7 +210,7 @@ public function testGenerate() { ->will($this->returnValue(true)); $this->assertTrue($Posts->RequestHandler->isPut()); - $Posts->Auth->Session->expects($this->any()) + $Posts->Auth->Session ->method('write') ->will($this->returnValue('written!')); $this->assertEquals('written!', $Posts->Auth->Session->write('something')); diff --git a/lib/Cake/Test/Case/TestSuite/Fixture/CakeFixtureManagerTest.php b/lib/Cake/Test/Case/TestSuite/Fixture/CakeFixtureManagerTest.php index 187066d..7a27ce6 100644 --- a/lib/Cake/Test/Case/TestSuite/Fixture/CakeFixtureManagerTest.php +++ b/lib/Cake/Test/Case/TestSuite/Fixture/CakeFixtureManagerTest.php @@ -65,7 +65,6 @@ public function testLoadTruncatesTable() { ->method('truncate') ->will($this->returnValue(true)); $MockFixture - ->expects($this->any()) ->method('insert') ->will($this->returnValue(true)); $MockFixture->created = array('test'); @@ -125,7 +124,7 @@ public function testLoadSingleTruncatesTable() { } $db = $this->getMock('DboSource', $dboMethods); $db->config['prefix'] = ''; - $db->expects($this->any()) + $db ->method('listSources') ->will($this->returnValue(array($MockFixture->table))); diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index db613c9..c26a52e 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -404,10 +404,10 @@ public function testTriggerPriority() { $this->Objects->setObject('TriggerMockFirst', $this->FirstGenericObject); $this->Objects->setObject('TriggerMockSecond', $this->SecondGenericObject, array('priority' => 5)); - $this->Objects->TriggerMockFirst->expects($this->any()) + $this->Objects->TriggerMockFirst ->method('callback') ->will($this->returnValue('1st')); - $this->Objects->TriggerMockSecond->expects($this->any()) + $this->Objects->TriggerMockSecond ->method('callback') ->will($this->returnValue('2nd')); @@ -419,7 +419,7 @@ public function testTriggerPriority() { $this->assertEquals($expected, $result); $this->Objects->setObject('TriggerMockThird', $this->ThirdGenericObject, array('priority' => 7)); - $this->Objects->TriggerMockThird->expects($this->any()) + $this->Objects->TriggerMockThird ->method('callback') ->will($this->returnValue('3rd')); diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 251cf96..5fb6425 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -707,13 +707,11 @@ public function testCssLink() { $this->assertTags($result[1], $expected); $this->assertEquals(2, count($result)); - $this->View->expects($this->at(0)) - ->method('append') - ->with('css', $this->matchesRegularExpression('/css_in_head.css/')); + $this->View->expects($this->at(0, array('css', $this->matchesRegularExpression('/css_in_head.css/')))) + ->method('append'); - $this->View->expects($this->at(1)) - ->method('append') - ->with('css', $this->matchesRegularExpression('/more_css_in_head.css/')); + $this->View->expects($this->at(1, array('css', $this->matchesRegularExpression('/more_css_in_head.css/')))) + ->method('append'); $result = $this->Html->css('css_in_head', array('inline' => false)); $this->assertNull($result); @@ -939,12 +937,10 @@ public function testPluginCssTimestamping() { * @return void */ public function testBufferedCssAndScriptWithIdenticalResourceName() { - $this->View->expects($this->at(0)) - ->method('append') - ->with('css', $this->stringContains('test.min.css')); - $this->View->expects($this->at(1)) - ->method('append') - ->with('script', $this->stringContains('test.min.js')); + $this->View->expects($this->at(0, array('css', $this->stringContains('test.min.css')))) + ->method('append'); + $this->View->expects($this->at(1, array('script', $this->stringContains('test.min.js')))) + ->method('append'); $this->Html->css('test.min', array('inline' => false)); $this->Html->script('test.min', array('inline' => false)); } @@ -1172,17 +1168,14 @@ public function testPluginScript() { * @return void */ public function testScriptWithBlocks() { - $this->View->expects($this->at(0)) - ->method('append') - ->with('script', $this->matchesRegularExpression('/script_in_head.js/')); + $this->View->expects($this->at(0, array('script', $this->matchesRegularExpression('/script_in_head.js/')))) + ->method('append'); - $this->View->expects($this->at(1)) - ->method('append') - ->with('script', $this->matchesRegularExpression('/bool_false.js/')); + $this->View->expects($this->at(1, array('script', $this->matchesRegularExpression('/bool_false.js/')))) + ->method('append'); - $this->View->expects($this->at(2)) - ->method('append') - ->with('headScripts', $this->matchesRegularExpression('/second_script.js/')); + $this->View->expects($this->at(2, array('headScripts', $this->matchesRegularExpression('/second_script.js/')))) + ->method('append'); $result = $this->Html->script('script_in_head', array('inline' => false)); $this->assertNull($result); @@ -1318,13 +1311,11 @@ public function testScriptBlock() { ); $this->assertTags($result, $expected); - $this->View->expects($this->at(0)) - ->method('append') - ->with('script', $this->matchesRegularExpression('/window\.foo\s\=\s2;/')); + $this->View->expects($this->at(0, array('script', $this->matchesRegularExpression('/window\.foo\s\=\s2;/')))) + ->method('append'); - $this->View->expects($this->at(1)) - ->method('append') - ->with('scriptTop', $this->stringContains('alert(')); + $this->View->expects($this->at(1, array('scriptTop', $this->stringContains('alert(')))) + ->method('append'); $result = $this->Html->scriptBlock('window.foo = 2;', array('inline' => false)); $this->assertNull($result); @@ -1872,13 +1863,11 @@ public function testMetaIcon() { * @return void */ public function testMetaWithBlocks() { - $this->View->expects($this->at(0)) - ->method('append') - ->with('meta', $this->stringContains('ROBOTS')); + $this->View->expects($this->at(0, array('meta', $this->stringContains('ROBOTS')))) + ->method('append'); - $this->View->expects($this->at(1)) - ->method('append') - ->with('metaTags', $this->stringContains('favicon.ico')); + $this->View->expects($this->at(1, array('metaTags', $this->stringContains('favicon.ico')))) + ->method('append'); $result = $this->Html->meta(array('name' => 'ROBOTS', 'content' => 'ALL'), null, array('inline' => false)); $this->assertNull($result); diff --git a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php index b3f548f..d6d0c7e 100644 --- a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php @@ -408,14 +408,13 @@ public function testLinkWithMock() { $this->Js->TestJsEngine->expects($this->at(0)) ->method('get'); - $this->Js->TestJsEngine->expects($this->at(1)) + $this->Js->TestJsEngine->expects($this->at(1, array('/posts/view/1', $options))) ->method('request') - ->with('/posts/view/1', $options) + ->will($this->returnValue('--ajax code--')); - $this->Js->TestJsEngine->expects($this->at(2)) - ->method('event') - ->with('click', '--ajax code--', $options + array('buffer' => null)); + $this->Js->TestJsEngine->expects($this->at(2, array('click', '--ajax code--', $options + array('buffer' => null)))) + ->method('event'); $result = $this->Js->link('test link', '/posts/view/1', $options); $expected = array( @@ -490,9 +489,9 @@ public function testLinkWithAribtraryAttributes() { public function testLinkWithNoBuffering() { $this->_useMock(); - $this->Js->TestJsEngine->expects($this->at(1)) + $this->Js->TestJsEngine->expects($this->at(1, array('/posts/view/1', array('update' => '#content')))) ->method('request') - ->with('/posts/view/1', array('update' => '#content')) + ->will($this->returnValue('ajax code')); $this->Js->TestJsEngine->expects($this->at(2)) @@ -522,9 +521,9 @@ public function testLinkWithNoBuffering() { public function testLinkWithNoBufferingAndSafe() { $this->_useMock(); - $this->Js->TestJsEngine->expects($this->at(1)) + $this->Js->TestJsEngine->expects($this->at(1, array('/posts/view/1', array('update' => '#content')))) ->method('request') - ->with('/posts/view/1', array('update' => '#content')) + ->will($this->returnValue('ajax code')); $this->Js->TestJsEngine->expects($this->at(2)) @@ -571,9 +570,8 @@ public function testSubmitWithMock() { 'method' => 'post', 'dataExpression' => true, 'buffer' => null ); - $this->Js->TestJsEngine->expects($this->at(3)) - ->method('event') - ->with('click', "ajax-code", $params); + $this->Js->TestJsEngine->expects($this->at(3, array('click', "ajax-code", $params))) + ->method('event'); $result = $this->Js->submit('Save', $options); $expected = array( @@ -606,9 +604,9 @@ public function testSubmitWithMockRequestParams() { 'dataExpression' => true ); - $this->Js->TestJsEngine->expects($this->at(2)) + $this->Js->TestJsEngine->expects($this->at(2, array('/custom/url', $requestParams))) ->method('request') - ->with('/custom/url', $requestParams) + ->will($this->returnValue('ajax-code')); $params = array( @@ -616,9 +614,8 @@ public function testSubmitWithMockRequestParams() { 'method' => 'post', 'dataExpression' => true, 'buffer' => null ); - $this->Js->TestJsEngine->expects($this->at(3)) - ->method('event') - ->with('click', "ajax-code", $params); + $this->Js->TestJsEngine->expects($this->at(3, array('click', "ajax-code", $params))) + ->method('event'); $options = array('update' => '#content', 'id' => 'test-submit', 'url' => '/custom/url'); $result = $this->Js->submit('Save', $options); @@ -659,9 +656,8 @@ public function testSubmitWithNoBuffer() { 'method' => 'post', 'dataExpression' => true, 'buffer' => false ); - $this->Js->TestJsEngine->expects($this->at(3)) - ->method('event') - ->with('click', "ajax-code", $params); + $this->Js->TestJsEngine->expects($this->at(3, array('click', "ajax-code", $params))) + ->method('event'); $result = $this->Js->submit('Save', $options); $expected = array( diff --git a/lib/Cake/Test/Case/View/MediaViewTest.php b/lib/Cake/Test/Case/View/MediaViewTest.php index c6d5bc0..b7adb59 100644 --- a/lib/Cake/Test/Case/View/MediaViewTest.php +++ b/lib/Cake/Test/Case/View/MediaViewTest.php @@ -126,7 +126,7 @@ public function testRenderUpperExtension() { 'id' => 'test_2.JPG' ); - $this->MediaView->response->expects($this->any()) + $this->MediaView->response->expects($this->anyInvocation()) ->method('type') ->with('jpg') ->will($this->returnArgument(0)); diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 1aa9601..f20692e 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -1008,83 +1008,59 @@ public function testHelperCallbackTriggering() { $View->helpers = array(); $View->Helpers = $this->getMock('HelperCollection', array('trigger'), array($View)); - $View->Helpers->expects($this->at(0))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(0, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.beforeRender' && $event->subject() == $View; }) - ) - ); - $View->Helpers->expects($this->at(1))->method('trigger') - ->with( - $this->logicalAnd( + ))))->method('trigger'); + $View->Helpers->expects($this->at(1, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.beforeRenderFile' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); - $View->Helpers->expects($this->at(2))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(2, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.afterRenderFile' && $event->subject() == $View; }) - ) - ); - $View->Helpers->expects($this->at(3))->method('trigger') - ->with( - $this->logicalAnd( + ))))->method('trigger'); + $View->Helpers->expects($this->at(3, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.afterRender' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); - $View->Helpers->expects($this->at(4))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(4, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.beforeLayout' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); - $View->Helpers->expects($this->at(5))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(5, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.beforeRenderFile' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); - $View->Helpers->expects($this->at(6))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(6, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.afterRenderFile' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); - $View->Helpers->expects($this->at(7))->method('trigger') - ->with( - $this->logicalAnd( + $View->Helpers->expects($this->at(7, array($this->logicalAnd( $this->isInstanceOf('CakeEvent'), $this->callback(function (\CakeEvent $event) use ($View) { return $event->name() == 'View.afterLayout' && $event->subject() == $View; }) - ) - ); + ))))->method('trigger'); $View->render('index'); } diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index 74332fd..b81c116 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -16,8 +16,11 @@ * @license https://opensource.org/licenses/mit-license.php MIT License */ -use PHPUnit\Framework\Constraint\Attribute; +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Constraint\Constraint; +use PHPUnit\Framework\Constraint\IsEqual; use PHPUnit\Framework\Exception; +use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls; use PHPUnit\Framework\MockObject\Stub\ReturnArgument; use PHPUnit\Framework\MockObject\Stub\ReturnCallback; @@ -313,6 +316,28 @@ public static function onConsecutiveCalls(...$values): ConsecutiveCalls { return new ConsecutiveCalls($values); } +/** + * A "zero or more invocations" matcher. + * + * PHPUnit 13 hard-deprecates TestCase::any() and removes it in 14: as an + * expectation it asserts nothing, so the advice is to use a plain test stub — + * `$mock->method('x')` — instead. That advice does not carry over to the + * doubles built on CakeStubTrait (CakeRequest, CakeResponse and subclasses), + * which deliberately do not expose PHPUnit's `method()` shorthand: CakeRequest + * declares a real method() of its own, which is why those classes get a + * hand-written stub rather than a generated mock. expects() is the only way in, + * so a matcher meaning "no invocation count expectation" is still needed. + * + * The underlying rule object is not deprecated — it is what `method()` uses + * internally — only the TestCase::any() shorthand is. Passing it to expects() + * triggers no deprecation. + * + * @return \PHPUnit\Framework\MockObject\Rule\AnyInvokedCount + */ + public static function anyInvocation(): AnyInvokedCount { + return new AnyInvokedCount(); + } + /** * Backwards-compatibility wrapper for getMockForAbstractClass(), removed * in PHPUnit 12. Uses the MockBuilder to produce a mock of the abstract @@ -1340,16 +1365,33 @@ public function getMock( * Compatibility shim for PHPUnit's removed at() method. * Returns a matcher that matches the n-th invocation of a method. * + * The index counts invocations of the whole mock, not of a single method: + * PHPUnit asks every matcher's invocation rule about every call before it + * checks the method name, which is the semantics the legacy matcher had. + * + * $expectedArgs replaces the `->with(...)` that used to follow this matcher. + * PHPUnit 13 allows only one with() configuration per doubled method, so + * sequencing several indexed expectations over the same method — the whole + * point of at() — now raises MethodParametersAlreadyConfiguredForAnotherMatcher. + * Checking the arguments from inside the matcher keeps the per-call assertions + * without registering a second parameters rule. The check runs in invokedDo(), + * which PHPUnit only reaches once the method name matched too; matches() alone + * also fires for calls to other methods of the same mock. + * * @param int $index The invocation index to match. + * @param array $expectedArgs Values or Constraints to match the call's + * arguments against, positionally. Null skips argument checking. * @return \PHPUnit\Framework\MockObject\Rule\InvocationOrder */ - public static function at($index) { - return new class($index) extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder { + public static function at($index, ?array $expectedArgs = null) { + return new class($index, $expectedArgs) extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder { private int $_index; + private ?array $_expectedArgs; private int $_currentIndex = -1; - public function __construct(int $index) { + public function __construct(int $index, ?array $expectedArgs) { $this->_index = $index; + $this->_expectedArgs = $expectedArgs; } public function index(): int { @@ -1366,6 +1408,19 @@ public function matches(\PHPUnit\Framework\MockObject\Invocation $invocation): b } protected function invokedDo(\PHPUnit\Framework\MockObject\Invocation $invocation): void { + if ($this->_expectedArgs === null) { + return; + } + $actual = $invocation->parameters(); + foreach ($this->_expectedArgs as $position => $expected) { + $constraint = $expected instanceof Constraint ? $expected : new IsEqual($expected); + Assert::assertThat($actual[$position] ?? null, $constraint, sprintf( + 'Argument %d of the call to %s() at sequence index %d', + $position, + $invocation->methodName(), + $this->_index + )); + } } public function verify(): void { diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index cdf2202..d40cc84 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -258,10 +258,14 @@ protected function _testAction($url, $options = array()) { $_SERVER['REQUEST_URI'] = $url; $request = $this->getMock('CakeRequest', array('_readInput')); + // A plain stub, not an expectation: the action under test is free to + // read the input zero or more times. expects($this->any()) used to say + // the same thing, but any() is hard-deprecated in PHPUnit 13 and its + // removal is scheduled for 14. Registering the stub directly is also + // what the matcher did here anyway — CakeStubBuilder::will() ends up + // calling _cakeSetStub(), and an any() expectation never fails. if (is_string($options['data'])) { - $request->expects($this->any()) - ->method('_readInput') - ->will($this->returnValue($options['data'])); + $request->_cakeSetStub('_readInput', $this->returnValue($options['data'])); } $Dispatch = $this->_createDispatcher(); diff --git a/phpunit.xml b/phpunit.xml index 9142738..4d05e99 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + lib/Cake/Test/Case From 067532a50cf3a3cfb0ce2868fe7f4286e6f83eba Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Wed, 12 Aug 2026 22:54:32 -0300 Subject: [PATCH 2/8] Remove o Rector e sobe o piso do PHP para 8.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O rector/rector estava preso na ^0.12.5, de 2021: não executa no PHP 8.5, usa a API antiga de configuração (ContainerConfigurator) e registra o SpecificAssertContainsRector, que nem existe mais nas versões atuais. As regras de PHPUnit também migraram para o pacote rector/rector-phpunit desde então. Sai a dependência junto com rector.php e RECTOR.md; o phpstan vem junto, era dependência transitiva dele. O piso do PHP sobe de 8.3 para 8.4 acompanhando o PHPUnit 13, que exige >= 8.4.1. Sem isso o projeto declararia suporte a uma versão que o CI não consegue mais testar. --- RECTOR.md | 7 --- composer.json | 3 +- composer.lock | 122 +------------------------------------------------- rector.php | 26 ----------- 4 files changed, 3 insertions(+), 155 deletions(-) delete mode 100644 RECTOR.md delete mode 100644 rector.php diff --git a/RECTOR.md b/RECTOR.md deleted file mode 100644 index a38cb60..0000000 --- a/RECTOR.md +++ /dev/null @@ -1,7 +0,0 @@ -# RectorPHP - -Para executar, rode: - -```bash -./vendors/bin/rector process -a bootstrap.php -``` diff --git a/composer.json b/composer.json index 3d1a9de..ab3834e 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,12 @@ "source": "https://github.com/cakephp/cakephp" }, "require": { - "php": ">=8.3,<8.6" + "php": ">=8.4,<8.6" }, "suggest": { "ext-openssl": "Required for AES-256 encryption (Security::encrypt/decrypt)" }, "require-dev": { - "rector/rector": "^0.12.5", "phpunit/phpunit": "^13.0" }, "config": { diff --git a/composer.lock b/composer.lock index affb419..ca961e6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8dff65c7beb68fe94b463f6b8c0a4b0c", + "content-hash": "c408f0e11656b0fb81cd626dacd892bf", "packages": [], "packages-dev": [ { @@ -242,64 +242,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpstan/phpstan", - "version": "1.12.21", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "14276fdef70575106a3392a4ed553c06a984df28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/14276fdef70575106a3392a4ed553c06a984df28", - "reference": "14276fdef70575106a3392a4ed553c06a984df28", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - } - ], - "time": "2025-03-09T09:24:50+00:00" - }, { "name": "phpunit/php-code-coverage", "version": "14.3.0", @@ -775,66 +717,6 @@ ], "time": "2026-08-07T07:37:01+00:00" }, - { - "name": "rector/rector", - "version": "0.12.23", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "690b31768b322db886b35845f8452025eba2cacb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/690b31768b322db886b35845f8452025eba2cacb", - "reference": "690b31768b322db886b35845f8452025eba2cacb", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.6" - }, - "conflict": { - "phpstan/phpdoc-parser": "<1.2", - "rector/rector-cakephp": "*", - "rector/rector-doctrine": "*", - "rector/rector-laravel": "*", - "rector/rector-nette": "*", - "rector/rector-phpoffice": "*", - "rector/rector-phpunit": "*", - "rector/rector-prefixed": "*", - "rector/rector-symfony": "*" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.12-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.12.23" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2022-05-01T15:50:16+00:00" - }, { "name": "sebastian/cli-parser", "version": "5.0.1", @@ -2051,7 +1933,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.3,<8.6" + "php": ">=8.4,<8.6" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/rector.php b/rector.php deleted file mode 100644 index 7b3c9ab..0000000 --- a/rector.php +++ /dev/null @@ -1,26 +0,0 @@ -parameters(); - $parameters->set(Option::PATHS, [ - __DIR__ . '/lib/Cake/Test/Case' - ]); - - // Define what rule sets will be applied - //$containerConfigurator->import(SetList::DEAD_CODE); - - - // get services (needed for register a single rule) - $services = $containerConfigurator->services(); - - // register a single rule - $services->set(\Rector\PHPUnit\Rector\MethodCall\SpecificAssertContainsRector::class); -}; From e3dc24ddb1d6858ff50360334d8b75adf2aeed22 Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 06:12:03 -0300 Subject: [PATCH 3/8] =?UTF-8?q?Corrige=20polui=C3=A7=C3=A3o=20de=20estado?= =?UTF-8?q?=20entre=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cinco pontos em que um teste deixava estado global sujo para os seguintes. Nenhum quebrava na ordem default, então passavam despercebidos até a suíte ser reordenada — --order-by=reverse e --order-by=random expõem os cinco. - CakeFixtureManager::_setupTable() tentava detectar uma tabela dropada por outra classe esperando uma exceção do truncate, mas CakeTestFixture::truncate() captura o PDOException e devolve false. O guard nunca disparava, e a falha só aparecia depois, no insert(). SchemaShellTest::testCreateNoArgs dropa i18n legitimamente (ela mesma criou a tabela), o que derrubava a fixture core.translate para BehaviorCollectionTest e TreeBehaviorScopedTest. - SecurityComponentTest::testRequireSecureSucceed deixava HTTPS ligado em $_SERVER. CakeSession lê isso e passa a acrescentar session.cookie_secure à config de sessão de todo teste posterior. - CakeRequestTest, CakeResponseTest e RequestHandlerComponentTest limpavam $_SERVER por lista curada de chaves, e as listas tinham ficado para trás: HTTP_USER_AGENT e CONTENT_TYPE escapavam. O primeiro chega a um branch de CakeResponse::file() e fazia testFileRange contar uma chamada extra a type(); o segundo chegava a CakeRequestTest::testContentType. As três passam a restaurar o array inteiro. Em CakeResponseTest o restore ainda era condicionado a haver valor anterior, o que sob CLI nunca há. - CakeSessionTest não zerava CakeSession::$_userAgent, estático que sobrevive ao destroy(). Dois testes o põem em 'bogus!', e o segundo a rodar comparava 'bogus!' com 'bogus!' e via sessão válida onde esperava divergência. - CakeEventManagerTest anexava listeners ao manager global sem soltá-los. listeners() mescla os globais no resultado de qualquer manager local, então sobravam em testAttachListeners. CakeRequestStub ganhou accepts(), parseAccept() e clientIp(): os testes dublavam esses métodos, mas o stub não os interceptava, então rodavam de verdade e liam $_SERVER. Verificado em --order-by default, reverse e random com as seeds 1, 7, 42 e 99. Antes, reverse e random quebravam. --- .../Component/RequestHandlerComponentTest.php | 24 ++++++------ .../Component/SecurityComponentTest.php | 12 ++++++ .../Test/Case/Event/CakeEventManagerTest.php | 16 ++++++++ .../Case/Model/Datasource/CakeSessionTest.php | 6 +++ .../Test/Case/Network/CakeRequestTest.php | 38 +++++++------------ .../Test/Case/Network/CakeResponseTest.php | 18 +++++++-- .../TestSuite/Fixture/CakeFixtureManager.php | 30 +++++++++++++-- lib/Cake/TestSuite/Stub/CakeRequestStub.php | 18 +++++++++ 8 files changed, 119 insertions(+), 43 deletions(-) diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 00d8bc9..09a5d54 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -87,6 +87,13 @@ class CustomJsonView extends JsonView { */ class RequestHandlerComponentTest extends CakeTestCase { +/** + * $_SERVER as it was before the test, restored in tearDown. + * + * @var array + */ + protected $_server = array(); + /** * Controller property * @@ -108,7 +115,7 @@ class RequestHandlerComponentTest extends CakeTestCase { */ public function setUp(): void { parent::setUp(); - $this->_serverAccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; + $this->_server = $_SERVER; $this->_init(); } @@ -134,20 +141,13 @@ protected function _init() { public function tearDown(): void { parent::tearDown(); unset($this->RequestHandler, $this->Controller); - unset( - $_SERVER['HTTP_X_REQUESTED_WITH'], - $_SERVER['HTTP_X_PROTOTYPE_VERSION'], - $_SERVER['HTTP_IF_NONE_MATCH'], - $_SERVER['HTTP_IF_MODIFIED_SINCE'] - ); // 20 tests in this class overwrite HTTP_ACCEPT. Leaving it behind makes // CakeRequest::is('json') true for every later test; AuthComponent then // answers 403 and calls Component::_stop(), an exit() that ends the run. - if ($this->_serverAccept === null) { - unset($_SERVER['HTTP_ACCEPT']); - } else { - $_SERVER['HTTP_ACCEPT'] = $this->_serverAccept; - } + // Restoring the whole array rather than a hand-kept list of keys covers + // the rest of the 50-odd $_SERVER writes here as well — CONTENT_TYPE + // was reaching CakeRequestTest::testContentType. + $_SERVER = $this->_server; if (!headers_sent()) { header('Content-type: text/html'); //reset content type. } diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index 5e1b777..82e4195 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -155,6 +155,13 @@ class SecurityComponentTest extends CakeTestCase { */ public $oldSalt; +/** + * $_SERVER as it was before the test, restored in tearDown. + * + * @var array + */ + protected $_server = array(); + /** * setUp method * @@ -177,6 +184,7 @@ public function setUp(): void { $this->Security->csrfCheck = false; Configure::write('Security.salt', 'foo!'); + $this->_server = $_SERVER; $_SERVER['REQUEST_METHOD'] = 'GET'; } @@ -187,6 +195,10 @@ public function setUp(): void { */ public function tearDown(): void { parent::tearDown(); + // testRequireSecureSucceed turns HTTPS on, and CakeSession reads it to + // decide on session.cookie_secure. Left behind it changes the session + // config every later test sees. + $_SERVER = $this->_server; $this->Controller->Session->delete('_Token'); $this->Controller->Session->destroy(); unset($this->Controller->Security); diff --git a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php index f5e0d8f..5f9b742 100644 --- a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php @@ -91,6 +91,22 @@ public function thirdListenerFunction() { */ class CakeEventManagerTest extends CakeTestCase { +/** + * Puts a clean manager back in the global slot. + * + * testDispatchLocalHandledByGlobal and testDispatchWithGlobalAndLocalEvents + * attach to the global manager and never detach, and other tests here swap it + * for a mock. CakeEventManager::listeners() merges the global listeners into + * every local manager's result, so whatever stays attached turns up in + * testAttachListeners' expected list. + * + * @return void + */ + public function tearDown(): void { + parent::tearDown(); + CakeEventManager::instance(new CakeEventManager()); + } + /** * Tests the attach() method for a single event key in multiple queues * diff --git a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php index 9d9271f..095fa27 100644 --- a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php @@ -135,6 +135,12 @@ public function tearDown(): void { Configure::delete('Session'); Configure::write('Session', array('defaults' => 'php')); TestCakeSession::destroy(); + // CakeSession::$_userAgent is static and destroy() leaves it alone. Two + // tests here set it to 'bogus!', and start() then stamps that into + // Config.userAgent — so whichever of them ran second compared 'bogus!' + // against 'bogus!' and saw a valid session where it expected a + // mismatch. Emptying it makes the next init() derive it again. + TestCakeSession::setUserAgent(''); unset($_SESSION); parent::tearDown(); } diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 82b3eb3..6351904 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -59,6 +59,13 @@ public function reConstruct($url = 'some/path', $parseEnvironment = true) { */ class CakeRequestTest extends CakeTestCase { +/** + * $_SERVER as it was before the test, restored in tearDown. + * + * @var array + */ + protected $_server = array(); + /** * Setup callback * @@ -72,10 +79,7 @@ public function setUp(): void { // left behind changes how later tests resolve base paths and query // strings. $this->_get = $_GET; - $this->_serverPaths = array(); - foreach (array('SCRIPT_FILENAME', 'DOCUMENT_ROOT', 'SCRIPT_NAME') as $key) { - $this->_serverPaths[$key] = isset($_SERVER[$key]) ? $_SERVER[$key] : null; - } + $this->_server = $_SERVER; $this->_case = null; if (isset($_GET['case'])) { $this->_case = $_GET['case']; @@ -108,29 +112,15 @@ public function tearDown(): void { $_GET['case'] = $this->_case; } Configure::write('App', $this->_app); - unset( - $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'], - $_SERVER['HTTP_X_FORWARDED_HOST'], - $_SERVER['HTTP_X_FORWARDED_FOR'], - $_SERVER['HTTP_CLIENT_IP'], - $_SERVER['REQUEST_URI'], - $_SERVER['PHP_SELF'], - $_SERVER['PATH_INFO'], - $_SERVER['QUERY_STRING'], - $_SERVER['HTTP_REFERER'], - $_SERVER['CONTENT_TYPE'], - $_SERVER['HTTP_CONTENT_TYPE'] - ); $_POST = array(); $_FILES = array(); $_GET = $this->_get; - foreach ($this->_serverPaths as $key => $value) { - if ($value === null) { - unset($_SERVER[$key]); - } else { - $_SERVER[$key] = $value; - } - } + // Restoring the whole array rather than unsetting a hand-kept list of + // keys: the list had drifted and no longer covered HTTP_USER_AGENT, + // which tests here set to MSIE and mobile browser strings. + // CakeResponse::file() branches on that header, so an MSIE string left + // behind made CakeResponseTest::testFileRange see a second type() call. + $_SERVER = $this->_server; } /** diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 93bd985..658a791 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -24,12 +24,20 @@ */ class CakeResponseTest extends CakeTestCase { +/** + * $_SERVER as it was before the test, restored in tearDown. + * + * @var array + */ + protected $_server = array(); + /** * Setup for tests * * @return void */ public function setUp(): void { + $this->_server = $_SERVER; $_SERVER['HTTP_IF_NONE_MATCH'] = null; $_SERVER['HTTP_IF_MODIFIED_SINCE'] = null; $_SERVER['HTTP_RANGE'] = null; @@ -43,9 +51,13 @@ public function setUp(): void { * @return void */ public function tearDown(): void { - $_SERVER['HTTP_IF_NONE_MATCH'] = null; - $_SERVER['HTTP_IF_MODIFIED_SINCE'] = null; - $_SERVER['HTTP_RANGE'] = null; + // Restoring the whole array rather than nulling a hand-kept list of + // keys. Several tests here set HTTP_USER_AGENT to Opera and MSIE + // strings and only put it back when it had a previous value — which + // under CLI it never has, so the browser string stayed. That header + // steers a branch in CakeResponse::file(), which is what made + // testFileRange see type() called twice. + $_SERVER = $this->_server; parent::tearDown(); ob_end_clean(); } diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index 473128b..824e155 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php @@ -259,6 +259,7 @@ protected function _setupTable($fixture, $db = null, $drop = true) { $db = $this->_db; } } + $staleCreated = false; if (!empty($fixture->created) && in_array($db->configKeyName, $fixture->created)) { if (self::$cacheInstances) { // The static cache survived across test classes, so the table @@ -267,19 +268,40 @@ protected function _setupTable($fixture, $db = null, $drop = true) { // table untruncated and make the following insert collide with // the rows already there; truncating and treating a failure as // "table is gone" does not depend on that cache. + // + // The signal is the return value, not an exception: + // CakeTestFixture::truncate() catches the PDOException itself + // and reports false. Waiting for an exception here meant a + // dropped table went unnoticed until insert() hit it — see + // SchemaShellTest::testCreateNoArgs, which drops i18n out from + // under the core.translate fixture. + $truncated = false; try { - $fixture->truncate($db); - return; + $truncated = $fixture->truncate($db) !== false; } catch (Exception $e) { - $fixture->created = array_diff($fixture->created, array($db->configKeyName)); } + if ($truncated) { + return; + } + $fixture->created = array_diff($fixture->created, array($db->configKeyName)); + $staleCreated = true; } else { $fixture->truncate($db); return; } } - $sources = (array)$db->listSources(); + if ($staleCreated) { + // The cached source list still names the table that just failed to + // truncate, so it has to be re-read to decide between create and + // drop+create below. + $cacheSources = $db->cacheSources; + $db->cacheSources = false; + $sources = (array)$db->listSources(); + $db->cacheSources = $cacheSources; + } else { + $sources = (array)$db->listSources(); + } $table = $db->config['prefix'] . $fixture->table; $exists = in_array($table, $sources); diff --git a/lib/Cake/TestSuite/Stub/CakeRequestStub.php b/lib/Cake/TestSuite/Stub/CakeRequestStub.php index 3d61a04..495da27 100644 --- a/lib/Cake/TestSuite/Stub/CakeRequestStub.php +++ b/lib/Cake/TestSuite/Stub/CakeRequestStub.php @@ -30,4 +30,22 @@ public function here($base = true) { }); } + public function accepts($type = null) { + return $this->_cakeResolve('accepts', array($type), function () use ($type) { + return parent::accepts($type); + }); + } + + public function parseAccept() { + return $this->_cakeResolve('parseAccept', array(), function () { + return parent::parseAccept(); + }); + } + + public function clientIp($safe = true) { + return $this->_cakeResolve('clientIp', array($safe), function () use ($safe) { + return parent::clientIp($safe); + }); + } + } From 0c873d2900326b4da802a1733eccb3916a158dea Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 08:12:59 -0300 Subject: [PATCH 4/8] Suporta PHPUnit 12 e 13, devolvendo o PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A constraint passa a ^12.0 || ^13.0 e o piso do PHP volta para 8.3. A 13 exige PHP >= 8.4.1, então em 8.3 o composer resolve a 12; nas demais versões, a 13. O CI volta a testar 8.3 e passa a rodar composer update em vez de install: o lock fixa uma versão só do PHPUnit, e instalar a partir dele falharia no leg do 8.3. Resolvendo por leg, cada versão de PHP pega o PHPUnit que lhe serve — e a matriz acaba cobrindo as duas. Nada no código precisou de adaptação. Os pontos da migração são todos API que as duas versões têm: o matcher AnyInvokedCount por trás de anyInvocation(), o hook invokedDo() usado pelo shim at() para conferir argumentos, e os stubs de retorno, que na 13 mudaram de diretório mas mantiveram o namespace. O xsi:noNamespaceSchemaLocation volta para 12.5, o piso suportado; o arquivo valida nas duas e nenhuma reclama. Suíte verificada nas duas versões, em ordem default, reverse e random (seed 99): 3976 testes, sem falhas. --- .github/workflows/ci.yml | 7 +++++-- composer.json | 4 ++-- composer.lock | 37 ++++++++++++++++++------------------- phpunit.xml | 2 +- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb58215..99cc9fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.4', '8.5'] + php-version: ['8.3', '8.4', '8.5'] db: ['sqlite', 'mysql'] steps: - uses: niden/actions-memcached@v7 @@ -48,5 +48,8 @@ jobs: env: DB: ${{ matrix.db }} run: | - composer install --no-progress --no-suggest -o --no-ansi --no-interaction + # update, não install: o lock fixa uma versão só do PHPUnit, e a 13 + # exige PHP >= 8.4.1. Resolvendo por leg, o 8.3 pega a 12 e os demais + # a 13, que é justamente o que a constraint ^12.0 || ^13.0 permite. + composer update --no-progress -o --no-ansi --no-interaction composer test diff --git a/composer.json b/composer.json index ab3834e..9d789f2 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ "source": "https://github.com/cakephp/cakephp" }, "require": { - "php": ">=8.4,<8.6" + "php": ">=8.3,<8.6" }, "suggest": { "ext-openssl": "Required for AES-256 encryption (Security::encrypt/decrypt)" }, "require-dev": { - "phpunit/phpunit": "^13.0" + "phpunit/phpunit": "^12.0 || ^13.0" }, "config": { "vendor-dir": "vendors/", diff --git a/composer.lock b/composer.lock index ca961e6..96495b5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c408f0e11656b0fb81cd626dacd892bf", + "content-hash": "bf0203515553e8be1d2e1404e66f7173", "packages": [], "packages-dev": [ { @@ -1477,30 +1477,29 @@ }, { "name": "sebastian/object-enumerator", - "version": "8.0.0", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "b39ab125fd9a7434b0ecbc4202eebce11a98cfc5" + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/b39ab125fd9a7434b0ecbc4202eebce11a98cfc5", - "reference": "b39ab125fd9a7434b0ecbc4202eebce11a98cfc5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", "shasum": "" }, "require": { "php": ">=8.4", - "sebastian/object-reflector": "^6.0", - "sebastian/recursion-context": "^8.0" + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^13.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -1523,7 +1522,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.0.0" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" }, "funding": [ { @@ -1543,27 +1542,27 @@ "type": "tidelift" } ], - "time": "2026-02-06T04:46:36+00:00" + "time": "2026-08-13T07:05:05+00:00" }, { "name": "sebastian/object-reflector", - "version": "6.0.0", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "3ca042c2c60b0eab094f8a1b6a7093f4d4c72200" + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/3ca042c2c60b0eab094f8a1b6a7093f4d4c72200", - "reference": "3ca042c2c60b0eab094f8a1b6a7093f4d4c72200", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", "shasum": "" }, "require": { "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^13.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { @@ -1591,7 +1590,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" }, "funding": [ { @@ -1611,7 +1610,7 @@ "type": "tidelift" } ], - "time": "2026-02-06T04:47:13+00:00" + "time": "2026-08-13T06:34:36+00:00" }, { "name": "sebastian/recursion-context", @@ -1933,7 +1932,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.4,<8.6" + "php": ">=8.3,<8.6" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/phpunit.xml b/phpunit.xml index 4d05e99..9142738 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + lib/Cake/Test/Case From eb84aabfd205d10213100bcb300242f0f43faf56 Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 08:54:04 -0300 Subject: [PATCH 5/8] =?UTF-8?q?Restaura=20checagens=20de=20argumento=20per?= =?UTF-8?q?didas=20na=20convers=C3=A3o=20do=20at()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mover o with() para dentro do at() apagou a asserção em dois casos. Nos doubles apoiados em CakeStubTrait (CakeRequest, CakeResponse) o matcher nunca chega em invokedDo(): CakeStubTrait intercepta a chamada e CakeStubBuilder::_cakeVerifyIndexed() confere os argumentos depois, lendo só o que veio de with(). Sem with(), _with ficava null e a verificação retornava cedo — dezenas de asserções de header em CakeResponseTest, além de RequestHandlerComponentTest, ControllerTest e AuthComponentTest, seguiam verdes com Content-Type errado ou status trocado. O CakeStubBuilder passa a ler os argumentos do próprio matcher, via um getter novo no shim; um with() explícito ainda tem precedência. Só CakeResponseTest sai de 407 para 595 asserções. Em ModelTaskTest::testInteractiveFieldValidationWithBogusResponse o with() sumiu por outro motivo: a primeira versão do script de conversão casava `$this->at()` dentro de docblocks, e num deles moveu para o texto do comentário o with() da instrução seguinte. O comentário foi corrigido na hora, o with() não. Auditei todos os arquivos convertidos comparando com o master: os únicos outros déficits de with() são os dois merges em logicalAnd e a troca por never() no SmtpTransportTest, ambos deliberados. Verificado por mutação — trocar um Content-Length esperado ou o texto da mensagem agora faz o teste falhar, e antes não fazia. Suíte verde nas duas versões do PHPUnit, em ordem default e reverse. --- .../Test/Case/Console/Command/Task/ModelTaskTest.php | 2 +- lib/Cake/TestSuite/CakeTestCase.php | 10 ++++++++++ lib/Cake/TestSuite/Stub/CakeStubBuilder.php | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php index b4cc0dc..d35d3ee 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php @@ -336,7 +336,7 @@ public function testInteractiveFieldValidationWithBogusResponse() { $this->Task->method('in') ->will($this->onConsecutiveCalls('999999', '26', 'n')); - $this->Task->expects($this->at(10))->method('out'); + $this->Task->expects($this->at(10, array($this->stringContains('make a valid'))))->method('out'); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); $expected = array('notBlank' => 'notBlank'); diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index b81c116..5cca05e 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -1398,6 +1398,16 @@ public function index(): int { return $this->_index; } + /** + * The doubles built on CakeStubTrait never reach invokedDo(): + * CakeStubTrait intercepts the call itself and verifies the + * expectations afterwards. CakeStubBuilder reads the expectation + * through here so those argument checks are not lost. + */ + public function expectedArgs(): ?array { + return $this->_expectedArgs; + } + public function toString(): string { return 'invoked at sequence index ' . $this->_index; } diff --git a/lib/Cake/TestSuite/Stub/CakeStubBuilder.php b/lib/Cake/TestSuite/Stub/CakeStubBuilder.php index 556310c..eda0b2b 100644 --- a/lib/Cake/TestSuite/Stub/CakeStubBuilder.php +++ b/lib/Cake/TestSuite/Stub/CakeStubBuilder.php @@ -57,6 +57,14 @@ public function __construct($owner, $matcher = null, $startSequence = 0) { if (is_object($matcher) && method_exists($matcher, 'index')) { $this->_index = $matcher->index(); } + // CakeTestCase::at() can carry the argument expectation that used to be + // written as ->with(...), because PHPUnit 13 allows only one with() per + // doubled method. On a generated mock the matcher checks those itself, + // in invokedDo(); this stub never gets there, so it has to pick them up. + // An explicit with() later on still overrides them. + if (is_object($matcher) && method_exists($matcher, 'expectedArgs')) { + $this->_with = $matcher->expectedArgs(); + } } /** From 459c0c7befb8472d43262d4cee31fbbae98e8236 Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 09:06:05 -0300 Subject: [PATCH 6/8] =?UTF-8?q?Confere=20argumentos=20tamb=C3=A9m=20quando?= =?UTF-8?q?=20o=20matcher=20=C3=A9=20any()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CakeStubBuilder::_cakeVerify() pulava a checagem de argumentos quando o matcher era AnyInvokedCount ou InvokedAtMostCount, alegando que o PHPUnit faz o mesmo. Não faz: Matcher::invoked() roda parametersRule->apply() logo depois da regra de contagem, seja qual for o matcher — confirmado por probe, um with() violado sob any() e sob atMost(3) falha nos dois. Na prática isso desativava em silêncio o with() dos doubles construídos com anyInvocation(). Hoje há um único call site nessa forma (MediaViewTest), mas o buraco valia para qualquer um que aparecesse. never() continua coberto pela guarda de contagem zero: se houvesse chamada, a asserção de contagem acima já teria falhado. atMost() não é usado em lugar nenhum da suíte. Suíte verde nas duas versões do PHPUnit, em default e reverse. --- lib/Cake/TestSuite/Stub/CakeStubBuilder.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/Cake/TestSuite/Stub/CakeStubBuilder.php b/lib/Cake/TestSuite/Stub/CakeStubBuilder.php index eda0b2b..e63eff9 100644 --- a/lib/Cake/TestSuite/Stub/CakeStubBuilder.php +++ b/lib/Cake/TestSuite/Stub/CakeStubBuilder.php @@ -8,7 +8,6 @@ use PHPUnit\Framework\Assert; use PHPUnit\Framework\Constraint\Constraint; use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount; use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce; use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount; @@ -180,8 +179,8 @@ public function willThrowException(\Throwable $e) { /** * Verifies this expectation against the invocations actually recorded for the * method. Mirrors what PHPUnit's Matcher::verify() does for real mock objects: - * the invocation count is checked against the matcher, and — unless the - * matcher is any()/never()/atMost() — the arguments are checked too. + * the invocation count is checked against the matcher, and the arguments are + * checked on every recorded call whenever with() declared any. * * @param array $invocations List of argument arrays, in invocation order. * @param bool $strictArguments When true every invocation must match the @@ -232,11 +231,15 @@ public function _cakeVerify(array $invocations, $strictArguments = true) { } } - // PHPUnit skips the parameter rule for any(), never() and atMost(). - if ($this->_with === null || $count === 0 || $max === 0 || - $this->_matcher instanceof AnyInvokedCount || - $this->_matcher instanceof InvokedAtMostCount - ) { + // PHPUnit applies the parameters rule to every invocation the matcher + // accepted, whatever the invocation count matcher is — any() and + // atMost() included; Matcher::invoked() runs parametersRule->apply() + // right after the count rule. Skipping them here silently disabled the + // argument check on doubles built with anyInvocation(). What does make + // the check vacuous is having no with() at all, or no calls to compare + // it against; never() is covered by the latter, since a call would have + // failed the count assertion above. + if ($this->_with === null || $count === 0) { return; } From 108ff0bf7ffbf01fa2f507aa7829583acfacfa23 Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 09:20:01 -0300 Subject: [PATCH 7/8] Bump version to 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor, não patch: a árvore de testes distribuída ganhou API pública — CakeTestCase::anyInvocation(), um segundo parâmetro opcional em at() e accepts()/parseAccept()/clientIp() no CakeRequestStub. Junto vai uma mudança de comportamento que pode deixar vermelha a suíte de quem consome o framework: CakeStubBuilder passou a conferir os argumentos de with() também sob any(), o que antes era silenciosamente ignorado. Nenhum código de runtime mudou — o diff fora de lib/Cake/Test/Case fica todo em lib/Cake/TestSuite, mais CI e dependências de desenvolvimento. O 2.11.0 estava livre: foi bumpado em 60703e5 e desfeito em c575cbc, sem tag em nenhum momento. --- lib/Cake/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/VERSION.txt b/lib/Cake/VERSION.txt index cef2c48..81c948a 100644 --- a/lib/Cake/VERSION.txt +++ b/lib/Cake/VERSION.txt @@ -17,4 +17,4 @@ // @license https://opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -2.10.24 +2.11.0 From 0f15c2bf5307060ec434f4f13c31fec9cc4e61b2 Mon Sep 17 00:00:00 2001 From: Gerson Felipe Schwinn Date: Thu, 13 Aug 2026 09:24:03 -0300 Subject: [PATCH 8/8] Deixa de versionar o composer.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Isto é uma biblioteca: quem consome resolve as dependências no próprio lock, e o daqui só valia para o desenvolvimento do framework. Versioná-lo fixava uma versão única do PHPUnit para todos os legs do CI, sendo que a 13 não instala em PHP 8.3 — foi por isso que o pipeline teve de trocar install por update. O update continua, agora por outro motivo: sem lock, o install apenas avisa "No composer.lock file present" e resolve as dependências do mesmo jeito, então update é o comando honesto. Cada leg resolve a sua versão — 8.3 pega o PHPUnit 12, os demais o 13. --- .github/workflows/ci.yml | 7 +- .gitignore | 4 + composer.lock | 1939 -------------------------------------- 3 files changed, 8 insertions(+), 1942 deletions(-) delete mode 100644 composer.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99cc9fb..ec19ac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,8 +48,9 @@ jobs: env: DB: ${{ matrix.db }} run: | - # update, não install: o lock fixa uma versão só do PHPUnit, e a 13 - # exige PHP >= 8.4.1. Resolvendo por leg, o 8.3 pega a 12 e os demais - # a 13, que é justamente o que a constraint ^12.0 || ^13.0 permite. + # update, não install: o composer.lock não é versionado, e sem ele o + # install apenas avisa e resolve as dependências do mesmo jeito. Cada + # leg resolve as suas — o 8.3 pega o PHPUnit 12, os demais o 13, que é + # o que a constraint ^12.0 || ^13.0 permite. composer update --no-progress -o --no-ansi --no-interaction composer test diff --git a/.gitignore b/.gitignore index 763ef85..7df77df 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,10 @@ /dist /tags *.mo +# Biblioteca, não aplicação: quem consome resolve as dependências no próprio +# lock. Versionar o daqui só fixaria uma versão do PHPUnit para todos os legs +# do CI, e a 13 não instala em PHP 8.3. +/composer.lock # IDE and editor specific files # ################################# diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 96495b5..0000000 --- a/composer.lock +++ /dev/null @@ -1,1939 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "bf0203515553e8be1d2e1404e66f7173", - "packages": [], - "packages-dev": [ - { - "name": "myclabs/deep-copy", - "version": "1.14.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", - "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" - }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - } - ], - "time": "2026-08-11T10:17:44+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v5.8.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", - "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "php": ">=7.4" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" - }, - "time": "2026-07-04T14:30:18+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2024-03-03T12:33:53+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "14.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "060a5c93e81afb01e97dbe8930a5d0c9bd46e54e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/060a5c93e81afb01e97dbe8930a5d0c9bd46e54e", - "reference": "060a5c93e81afb01e97dbe8930a5d0c9bd46e54e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^5.8.0", - "php": ">=8.4", - "phpunit/php-text-template": "^6.0", - "sebastian/complexity": "^6.0", - "sebastian/environment": "^9.3.2", - "sebastian/git-state": "^1.0", - "sebastian/lines-of-code": "^5.0.2", - "sebastian/version": "^7.0", - "theseer/tokenizer": "^2.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^13.3" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "14.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "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/14.3.0" - }, - "funding": [ - { - "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/php-code-coverage", - "type": "tidelift" - } - ], - "time": "2026-08-07T07:24:15+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "7.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3ccaa29123548190af12fee7af078dcd7f3ddfab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3ccaa29123548190af12fee7af078dcd7f3ddfab", - "reference": "3ccaa29123548190af12fee7af078dcd7f3ddfab", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.1" - }, - "funding": [ - { - "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/php-file-iterator", - "type": "tidelift" - } - ], - "time": "2026-08-10T06:43:12+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "7.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", - "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^13.0" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" - }, - "funding": [ - { - "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/php-invoker", - "type": "tidelift" - } - ], - "time": "2026-02-06T04:34:47+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "6.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/a47af19f93f76aa3368303d752aa5272ca3299f4", - "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.0" - }, - "funding": [ - { - "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/php-text-template", - "type": "tidelift" - } - ], - "time": "2026-02-06T04:36:37+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "9.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", - "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" - }, - "funding": [ - { - "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/php-timer", - "type": "tidelift" - } - ], - "time": "2026-02-06T04:37:53+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "13.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "346fcba6ce7ab89bb1b0675feac6bc29c0f7711b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/346fcba6ce7ab89bb1b0675feac6bc29c0f7711b", - "reference": "346fcba6ce7ab89bb1b0675feac6bc29c0f7711b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-filter": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.4", - "phar-io/manifest": "^2.0.4", - "phar-io/version": "^3.2.1", - "php": ">=8.4.1", - "phpunit/php-code-coverage": "^14.3", - "phpunit/php-file-iterator": "^7.0.0", - "phpunit/php-invoker": "^7.0.0", - "phpunit/php-text-template": "^6.0.0", - "phpunit/php-timer": "^9.0.0", - "sebastian/cli-parser": "^5.0.1", - "sebastian/comparator": "^8.4", - "sebastian/diff": "^9.0", - "sebastian/environment": "^9.3.2", - "sebastian/exporter": "^8.2.1", - "sebastian/file-filter": "^1.0", - "sebastian/git-state": "^1.0", - "sebastian/global-state": "^9.0.1", - "sebastian/object-enumerator": "^8.0.0", - "sebastian/recursion-context": "^8.0.1", - "sebastian/type": "^7.0.1", - "sebastian/version": "^7.0.0", - "staabm/side-effects-detector": "^1.0.5" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "13.3-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/13.3.0" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsoring.html", - "type": "other" - } - ], - "time": "2026-08-07T07:37:01+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "5.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", - "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.2.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" - }, - "funding": [ - { - "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/sebastian/cli-parser", - "type": "tidelift" - } - ], - "time": "2026-08-01T04:27:14+00:00" - }, - { - "name": "sebastian/comparator", - "version": "8.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", - "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-mbstring": "*", - "php": ">=8.4", - "sebastian/diff": "^9.0", - "sebastian/exporter": "^8.2" - }, - "require-dev": { - "phpunit/phpunit": "^13.3" - }, - "suggest": { - "ext-bcmath": "For comparing BcMath\\Number objects" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "8.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" - }, - "funding": [ - { - "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/sebastian/comparator", - "type": "tidelift" - } - ], - "time": "2026-08-07T07:23:13+00:00" - }, - { - "name": "sebastian/complexity", - "version": "6.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "c5651c795c98093480df79350cb050813fc7a2f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", - "reference": "c5651c795c98093480df79350cb050813fc7a2f3", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^5.0", - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" - }, - "funding": [ - { - "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/sebastian/complexity", - "type": "tidelift" - } - ], - "time": "2026-02-06T04:41:32+00:00" - }, - { - "name": "sebastian/diff", - "version": "9.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "a3fb6a298a265ff487a91bbea46e03cd01dbb226" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a3fb6a298a265ff487a91bbea46e03cd01dbb226", - "reference": "a3fb6a298a265ff487a91bbea46e03cd01dbb226", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.2", - "symfony/process": "^7.4.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/9.0.0" - }, - "funding": [ - { - "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/sebastian/diff", - "type": "tidelift" - } - ], - "time": "2026-06-05T03:04:51+00:00" - }, - { - "name": "sebastian/environment", - "version": "9.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", - "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.1.11" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "https://github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/9.3.2" - }, - "funding": [ - { - "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/sebastian/environment", - "type": "tidelift" - } - ], - "time": "2026-05-25T13:41:38+00:00" - }, - { - "name": "sebastian/exporter", - "version": "8.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", - "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=8.4", - "sebastian/recursion-context": "^8.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^13.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "8.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" - }, - "funding": [ - { - "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/sebastian/exporter", - "type": "tidelift" - } - ], - "time": "2026-08-07T07:22:06+00:00" - }, - { - "name": "sebastian/file-filter", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/file-filter.git", - "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", - "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for filtering files", - "homepage": "https://github.com/sebastianbergmann/file-filter", - "support": { - "issues": "https://github.com/sebastianbergmann/file-filter/issues", - "security": "https://github.com/sebastianbergmann/file-filter/security/policy", - "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" - }, - "funding": [ - { - "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/sebastian/file-filter", - "type": "tidelift" - } - ], - "time": "2026-04-22T07:20:04+00:00" - }, - { - "name": "sebastian/git-state", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/git-state.git", - "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/792a952e0eba55b6960a48aeceb9f371aad1f76b", - "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for describing the state of a Git checkout", - "homepage": "https://github.com/sebastianbergmann/git-state", - "support": { - "issues": "https://github.com/sebastianbergmann/git-state/issues", - "security": "https://github.com/sebastianbergmann/git-state/security/policy", - "source": "https://github.com/sebastianbergmann/git-state/tree/1.0.0" - }, - "funding": [ - { - "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/sebastian/git-state", - "type": "tidelift" - } - ], - "time": "2026-03-21T12:54:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "9.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", - "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", - "shasum": "" - }, - "require": { - "php": ">=8.4", - "sebastian/object-reflector": "^6.0", - "sebastian/recursion-context": "^8.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^13.1.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "https://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" - }, - "funding": [ - { - "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/sebastian/global-state", - "type": "tidelift" - } - ], - "time": "2026-06-01T15:11:33+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "5.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", - "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^5.8.0", - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" - }, - "funding": [ - { - "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/sebastian/lines-of-code", - "type": "tidelift" - } - ], - "time": "2026-07-09T08:42:34+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "8.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", - "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", - "shasum": "" - }, - "require": { - "php": ">=8.4", - "sebastian/recursion-context": "^8.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^13.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "8.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" - }, - "funding": [ - { - "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/sebastian/object-enumerator", - "type": "tidelift" - } - ], - "time": "2026-08-13T07:05:05+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "6.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", - "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" - }, - "funding": [ - { - "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/sebastian/object-reflector", - "type": "tidelift" - } - ], - "time": "2026-08-13T06:34:36+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "8.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", - "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.2.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "8.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" - }, - "funding": [ - { - "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/sebastian/recursion-context", - "type": "tidelift" - } - ], - "time": "2026-08-03T05:58:12+00:00" - }, - { - "name": "sebastian/type", - "version": "7.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "bd1df467864cb95140414059a535b2d906173fcf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", - "reference": "bd1df467864cb95140414059a535b2d906173fcf", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "require-dev": { - "phpunit/phpunit": "^13.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" - }, - "funding": [ - { - "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/sebastian/type", - "type": "tidelift" - } - ], - "time": "2026-08-10T08:00:57+00:00" - }, - { - "name": "sebastian/version", - "version": "7.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ad37a5552c8e2b88572249fdc19b6da7792e021b", - "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b", - "shasum": "" - }, - "require": { - "php": ">=8.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/7.0.0" - }, - "funding": [ - { - "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/sebastian/version", - "type": "tidelift" - } - ], - "time": "2026-02-06T04:52:52+00:00" - }, - { - "name": "staabm/side-effects-detector", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/staabm/side-effects-detector.git", - "reference": "d8334211a140ce329c13726d4a715adbddd0a163" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", - "reference": "d8334211a140ce329c13726d4a715adbddd0a163", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^1.12.6", - "phpunit/phpunit": "^9.6.21", - "symfony/var-dumper": "^5.4.43", - "tomasvotruba/type-coverage": "1.0.0", - "tomasvotruba/unused-public": "1.0.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "lib/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A static analysis tool to detect side effects in PHP code", - "keywords": [ - "static analysis" - ], - "support": { - "issues": "https://github.com/staabm/side-effects-detector/issues", - "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" - }, - "funding": [ - { - "url": "https://github.com/staabm", - "type": "github" - } - ], - "time": "2024-10-20T05:08:20+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^8.1" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/2.0.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2025-12-08T11:19:18+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": {}, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=8.3,<8.6" - }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" -}