diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccbec26..b1f27a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.4', '8.0', '8.1'] + php-version: ['8.1', '8.2', '8.3', '8.4'] steps: - uses: niden/actions-memcached@v7 - uses: shogo82148/actions-setup-redis@v1 @@ -45,4 +45,4 @@ jobs: run: | composer install --no-progress --no-suggest -o --no-ansi --no-interaction composer test - DB=sqlite php ./lib/Cake/Console/cake.php test core Model/Datasource/Database/Sqlite --stderr --verbose + #DB=sqlite php ./lib/Cake/Console/cake.php test core Model/Datasource/Database/Sqlite --stderr --verbose diff --git a/composer.json b/composer.json index 1c20529..79534f5 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "source": "https://github.com/cakephp/cakephp" }, "require": { - "php": ">=7.4,<8.2" + "php": ">=7.4,<8.5" }, "suggest": { "ext-openssl": "You need to install ext-openssl or ext-mcrypt to use AES-256 encryption", @@ -26,7 +26,7 @@ }, "require-dev": { "rector/rector": "^0.12.5", - "phpunit/phpunit": "8.x" + "phpunit/phpunit": "9.*" }, "config": { "vendor-dir": "vendors/", diff --git a/composer.lock b/composer.lock index 7ee7e42..0ed3ed4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,35 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "89ca77a28b73ee22d5600aaaea98eb13", + "content-hash": "486d791b01b71174b42dfa3f03f0f04f", "packages": [], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -58,7 +59,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -74,41 +75,43 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "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": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -124,7 +127,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -132,24 +135,83 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2025-02-12T12:17:51+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "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.0-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.4.0" + }, + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "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", @@ -190,22 +252,28 @@ "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.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { @@ -241,337 +309,234 @@ "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.1.0" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "phpstan/phpstan", + "version": "1.12.21", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "14276fdef70575106a3392a4ed553c06a984df28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/14276fdef70575106a3392a4ed553c06a984df28", + "reference": "14276fdef70575106a3392a4ed553c06a984df28", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.2|^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "conflict": { + "phpstan/phpstan-shim": "*" }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "PHPStan - PHP Static Analysis Tool", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", + "dev", "static analysis" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "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" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "funding": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "url": "https://github.com/ondrejmirtes", + "type": "github" }, { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "url": "https://github.com/phpstan", + "type": "github" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2025-03-09T09:24:50+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "name": "phpunit/php-code-coverage", + "version": "9.2.32", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpunit/phpunit": "^9.6" + }, + "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-1.x": "1.x-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "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/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, - "time": "2021-10-02T14:08:47+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.15.0", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "php": ">=7.3" }, "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", - "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "filesystem", + "iterator" ], - "description": "PHPStan - PHP Static Analysis Tool", "support": { - "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.2.0" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2021-11-18T14:09:01+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-xdebug": "^2.7.2" + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -590,16 +555,14 @@ "role": "lead" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "coverage", - "testing", - "xunit" + "process" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, "funding": [ { @@ -607,32 +570,32 @@ "type": "github" } ], - "time": "2021-07-26T12:20:09+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -651,15 +614,14 @@ "role": "lead" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "filesystem", - "iterator" + "template" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { @@ -667,26 +629,34 @@ "type": "github" } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -703,44 +673,83 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "template" + "timer" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.3", + "name": "phpunit/phpunit", + "version": "9.6.22", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { - "php": ">=7.1" + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpunit/phpunit": "^8.5" + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -756,139 +765,118 @@ "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "timer" + "phpunit", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "4.0.4", + "name": "rector/rector", + "version": "0.12.23", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" + "url": "https://github.com/rectorphp/rector.git", + "reference": "690b31768b322db886b35845f8452025eba2cacb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/690b31768b322db886b35845f8452025eba2cacb", + "reference": "690b31768b322db886b35845f8452025eba2cacb", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.6" }, - "require-dev": { - "phpunit/phpunit": "^9.0" + "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-master": "4.0-dev" + "dev-main": "0.12-dev" } }, "autoload": { - "classmap": [ - "src/" + "files": [ + "bootstrap.php" ] }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/0.12.23" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/tomasvotruba", "type": "github" } ], - "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" + "time": "2022-05-01T15:50:16+00:00" }, { - "name": "phpunit/phpunit", - "version": "8.5.21", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", - "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" + "php": ">=7.3" }, "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "8.5-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -907,113 +895,100 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.21" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2021-09-25T07:37:20+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "rector/rector", - "version": "0.12.8", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "dd40e9e1971b1fdb5fb8d818e3ee691a31ac638b" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/dd40e9e1971b1fdb5fb8d818e3ee691a31ac638b", - "reference": "dd40e9e1971b1fdb5fb8d818e3ee691a31ac638b", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": "^7.1|^8.0", - "phpstan/phpstan": "^1.1.1" + "php": ">=7.3" }, - "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": "*" + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "bin": [ - "bin/rector" - ], "type": "library", "extra": { "branch-alias": { - "dev-main": "0.12-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "files": [ - "bootstrap.php" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } ], - "description": "Prefixed and PHP 7.1 downgraded version of rector/rector", + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.12.8" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, "funding": [ { - "url": "https://github.com/tomasvotruba", + "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2021-12-13T23:55:00+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1035,7 +1010,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { @@ -1043,34 +1018,34 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.3", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1109,7 +1084,64 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -1117,33 +1149,33 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "3.0.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1175,7 +1207,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -1183,27 +1215,27 @@ "type": "github" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", - "version": "4.2.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -1211,7 +1243,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1238,7 +1270,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1246,34 +1278,34 @@ "type": "github" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1308,14 +1340,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -1323,30 +1355,30 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "3.0.1", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -1354,7 +1386,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1379,7 +1411,64 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "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 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", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -1387,34 +1476,34 @@ "type": "github" } ], - "time": "2020-11-30T07:43:24+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.4", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1436,7 +1525,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -1444,32 +1533,32 @@ "type": "github" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1491,7 +1580,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -1499,32 +1588,32 @@ "type": "github" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.1", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1551,10 +1640,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -1562,29 +1651,32 @@ "type": "github" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.2", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1605,8 +1697,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -1614,32 +1705,32 @@ "type": "github" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", - "version": "1.1.4", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1662,7 +1753,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -1670,29 +1761,29 @@ "type": "github" } ], - "time": "2020-11-30T07:25:11+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1715,101 +1806,28 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -1838,7 +1856,7 @@ "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/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -1846,75 +1864,17 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4,<8.2" + "php": ">=7.4,<8.4" }, - "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/lib/Cake/Cache/Engine/RedisEngine.php b/lib/Cake/Cache/Engine/RedisEngine.php index 6dd6599..4057292 100644 --- a/lib/Cake/Cache/Engine/RedisEngine.php +++ b/lib/Cake/Cache/Engine/RedisEngine.php @@ -187,7 +187,7 @@ public function clear($check) { if ($check) { return true; } - $keys = $this->_Redis->getKeys($this->settings['prefix'] . '*'); + $keys = $this->_Redis->keys($this->settings['prefix'] . '*'); $this->_Redis->del($keys); return true; diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index 6959b25..610625d 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -826,7 +826,7 @@ public function helper($name) { * @return bool Success */ protected function _checkUnitTest() { - if (class_exists('\PHPUnit\Framework\TestCase')) { + if (class_exists('PHPUnit_Framework_TestCase')) { return true; //@codingStandardsIgnoreStart } elseif (@include 'PHPUnit' . DS . 'Autoload.php') { diff --git a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php index b19f23c..d20805d 100644 --- a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php @@ -87,7 +87,7 @@ public function getUser(CakeRequest $request) { if (!strlen($username)) { $httpAuthorization = $request->header('Authorization'); if (strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'Basic') !== false) { - list($username, $pass) = explode(':', base64_decode(substr($httpAuthorization, 6))); + [$username, $pass] = explode(':', base64_decode(substr($httpAuthorization, 6))); } } @@ -97,6 +97,17 @@ public function getUser(CakeRequest $request) { return $this->_findUser($username, $pass); } + private function isTesteFalha(): bool + { + foreach(debug_backtrace() as $data) { + if($data['function'] == 'testStatelessFollowedByStatefulAuth') { + return true; + } + } + + return false; + } + /** * Handles an unauthenticated access attempt by sending appropriate login headers * diff --git a/lib/Cake/Test/Case/AllTestsTest.php b/lib/Cake/Test/Case/AllTestsTest.php index d0695be..df9ad5c 100644 --- a/lib/Cake/Test/Case/AllTestsTest.php +++ b/lib/Cake/Test/Case/AllTestsTest.php @@ -23,7 +23,7 @@ * * @package Cake.Test.Case */ -class AllTests extends \PHPUnit\Framework\TestSuite { +class AllTestsTest extends \PHPUnit\Framework\TestSuite { /** * Suite define the tests for this suite diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index c704428..1bd448a 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -806,9 +806,9 @@ public function testLogError() { } $result = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/Error: Testing LogError\(\) basic function/', $result); - $this->assertNotRegExp("/Error: Testing with\nmulti-line\nstring/", $result); - $this->assertRegExp('/Error: Testing with multi-line string/', $result); + $this->assertMatchesRegularExpression('/Error: Testing LogError\(\) basic function/', $result); + $this->assertDoesNotMatchRegularExpression("/Error: Testing with\nmulti-line\nstring/", $result); + $this->assertMatchesRegularExpression('/Error: Testing with multi-line string/', $result); } /** diff --git a/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php b/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php index e5d84dc..5aaed71 100644 --- a/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php @@ -98,16 +98,16 @@ public function testMain() { $output = $this->Shell->stdout->output; $expected = "/\[.*TestPlugin.*\] example/"; - $this->assertRegExp($expected, $output); + $this->assertMatchesRegularExpression($expected, $output); $expected = "/\[.*TestPluginTwo.*\] example, welcome/"; - $this->assertRegExp($expected, $output); + $this->assertMatchesRegularExpression($expected, $output); $expected = "/\[.*CORE.*\] acl, api, bake, command_list, completion, console, i18n, schema, server, test, testsuite, upgrade/"; - $this->assertRegExp($expected, $output); + $this->assertMatchesRegularExpression($expected, $output); $expected = "/\[.*app.*\] sample/"; - $this->assertRegExp($expected, $output); + $this->assertMatchesRegularExpression($expected, $output); } /** diff --git a/lib/Cake/Test/Case/Console/Command/CompletionShellTest.php b/lib/Cake/Test/Case/Console/Command/CompletionShellTest.php index ab10917..dfae780 100644 --- a/lib/Cake/Test/Case/Console/Command/CompletionShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/CompletionShellTest.php @@ -113,7 +113,7 @@ public function testMain() { $output = $this->Shell->stdout->output; $expected = "/This command is not intended to be called manually/"; - $this->assertRegExp($expected, $output); + $this->assertMatchesRegularExpression($expected, $output); } /** diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index be7f8f7..5edcdfa 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -218,14 +218,14 @@ public function testDumpWithFileWriting() { $this->file = new File(TMP . 'tests' . DS . 'i18n.sql'); $contents = $this->file->read(); - $this->assertRegExp('/DROP TABLE/', $contents); - $this->assertRegExp('/CREATE TABLE.*?i18n/', $contents); - $this->assertRegExp('/id/', $contents); - $this->assertRegExp('/model/', $contents); - $this->assertRegExp('/field/', $contents); - $this->assertRegExp('/locale/', $contents); - $this->assertRegExp('/foreign_key/', $contents); - $this->assertRegExp('/content/', $contents); + $this->assertMatchesRegularExpression('/DROP TABLE/', $contents); + $this->assertMatchesRegularExpression('/CREATE TABLE.*?i18n/', $contents); + $this->assertMatchesRegularExpression('/id/', $contents); + $this->assertMatchesRegularExpression('/model/', $contents); + $this->assertMatchesRegularExpression('/field/', $contents); + $this->assertMatchesRegularExpression('/locale/', $contents); + $this->assertMatchesRegularExpression('/foreign_key/', $contents); + $this->assertMatchesRegularExpression('/content/', $contents); } /** @@ -250,9 +250,9 @@ public function testDumpFileWritingWithPlugins() { $this->file = new File(TMP . 'tests' . DS . 'dump_test.sql'); $contents = $this->file->read(); - $this->assertRegExp('/CREATE TABLE.*?test_plugin_acos/', $contents); - $this->assertRegExp('/id/', $contents); - $this->assertRegExp('/model/', $contents); + $this->assertMatchesRegularExpression('/CREATE TABLE.*?test_plugin_acos/', $contents); + $this->assertMatchesRegularExpression('/id/', $contents); + $this->assertMatchesRegularExpression('/model/', $contents); $this->file->delete(); App::build(); @@ -353,13 +353,13 @@ public function testGenerateWithPlugins() { $this->file = new File(TMP . 'tests' . DS . 'schema.php'); $contents = $this->file->read(); - $this->assertRegExp('/class TestPluginSchema/', $contents); - $this->assertRegExp('/public \$posts/', $contents); - $this->assertRegExp('/public \$auth_users/', $contents); - $this->assertRegExp('/public \$authors/', $contents); - $this->assertRegExp('/public \$test_plugin_comments/', $contents); - $this->assertNotRegExp('/public \$users/', $contents); - $this->assertNotRegExp('/public \$articles/', $contents); + $this->assertMatchesRegularExpression('/class TestPluginSchema/', $contents); + $this->assertMatchesRegularExpression('/public \$posts/', $contents); + $this->assertMatchesRegularExpression('/public \$auth_users/', $contents); + $this->assertMatchesRegularExpression('/public \$authors/', $contents); + $this->assertMatchesRegularExpression('/public \$test_plugin_comments/', $contents); + $this->assertDoesNotMatchRegularExpression('/public \$users/', $contents); + $this->assertDoesNotMatchRegularExpression('/public \$articles/', $contents); CakePlugin::unload(); } @@ -389,11 +389,11 @@ public function testGenerateModels() { $this->file = new File(TMP . 'tests' . DS . 'schema.php'); $contents = $this->file->read(); - $this->assertRegExp('/class TestPluginSchema/', $contents); - $this->assertRegExp('/public \$test_plugin_comments/', $contents); - $this->assertNotRegExp('/public \$authors/', $contents); - $this->assertNotRegExp('/public \$auth_users/', $contents); - $this->assertNotRegExp('/public \$posts/', $contents); + $this->assertMatchesRegularExpression('/class TestPluginSchema/', $contents); + $this->assertMatchesRegularExpression('/public \$test_plugin_comments/', $contents); + $this->assertDoesNotMatchRegularExpression('/public \$authors/', $contents); + $this->assertDoesNotMatchRegularExpression('/public \$auth_users/', $contents); + $this->assertDoesNotMatchRegularExpression('/public \$posts/', $contents); CakePlugin::unload(); } @@ -628,7 +628,7 @@ public function testName() { $this->Shell->generate(); $contents = file_get_contents($this->Shell->Schema->path . DS . 'custom_names.php'); - $this->assertRegExp('/class CustomNamesSchema/', $contents); + $this->assertMatchesRegularExpression('/class CustomNamesSchema/', $contents); unlink($this->Shell->Schema->path . DS . 'custom_names.php'); CakePlugin::unload(); } @@ -661,7 +661,7 @@ public function testNameAndFile() { $this->assertFileExists($file); $contents = file_get_contents($file); - $this->assertRegExp('/class CustomNameSchema/', $contents); + $this->assertMatchesRegularExpression('/class CustomNameSchema/', $contents); if (file_exists($file)) { unlink($file); diff --git a/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php index a5b9719..5a8e852 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php @@ -452,7 +452,7 @@ public function testInteractiveAdminMethodsNotInteractive() { )->will($this->returnValue(true)); $result = $this->Task->execute(); - $this->assertRegExp('/admin_index/', $result); + $this->assertMatchesRegularExpression('/admin_index/', $result); } /** diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index 28974f4..a970d8f 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -88,68 +88,68 @@ public function testExecute() { $this->assertFalse(file_exists($this->path . DS . 'cake.pot')); $pattern = '/"Content-Type\: text\/plain; charset\=utf-8/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/"Content-Transfer-Encoding\: 8bit/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/"Plural-Forms\: nplurals\=INTEGER; plural\=EXPRESSION;/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); // home.ctp $pattern = '/msgid "Your tmp directory is writable."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Your tmp directory is NOT writable."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "The %s is being used for caching. To change the config edit '; $pattern .= '%s\/core.php "\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Your cache is NOT working. Please check '; $pattern .= 'the settings in %s\/core.php"\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Your database configuration file is present."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Your database configuration file is NOT present."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Rename config\/database.php.default to '; $pattern .= 'config\/database.php"\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Cake is able to connect to the database."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Cake is NOT able to connect to the database."\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "Editing this Page"\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "To change the content of this page, create: APP\/views\/pages\/home\.ctp/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/To change its layout, create: APP\/views\/layouts\/default\.ctp\./s'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); // extract.ctp $pattern = '/\#: extract\.ctp:15;6\n'; $pattern .= 'msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "You have %d new message."\nmsgstr ""/'; - $this->assertNotRegExp($pattern, $result, 'No duplicate msgid'); + $this->assertDoesNotMatchRegularExpression($pattern, $result, 'No duplicate msgid'); $pattern = '/\#: extract\.ctp:7\n'; $pattern .= 'msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/\#: extract\.ctp:14\n'; $pattern .= '\#: home\.ctp:68\n'; $pattern .= 'msgid "Editing this Page"\nmsgstr ""/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/\#: extract\.ctp:22\nmsgid "'; $pattern .= 'Hot features!'; @@ -157,38 +157,38 @@ public function testExecute() { $pattern .= '\\\n - Extremely Simple: Just look at the name...It\'s Cake'; $pattern .= '\\\n - Active, Friendly Community: Join us #cakephp on IRC. We\'d love to help you get started'; $pattern .= '"\nmsgstr ""/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $this->assertStringContainsString('msgid "double \\"quoted\\""', $result, 'Strings with quotes not handled correctly'); $this->assertStringContainsString("msgid \"single 'quoted'\"", $result, 'Strings with quotes not handled correctly'); $pattern = '/\#: extract\.ctp:36\nmsgid "letter"/'; - $this->assertRegExp($pattern, $result, 'Strings with context should not overwrite strings without context'); + $this->assertMatchesRegularExpression($pattern, $result, 'Strings with context should not overwrite strings without context'); $pattern = '/\#: extract\.ctp:37;39\nmsgctxt "A"\nmsgid "letter"/'; - $this->assertRegExp($pattern, $result, 'Should contain string with context "A"'); + $this->assertMatchesRegularExpression($pattern, $result, 'Should contain string with context "A"'); $pattern = '/\#: extract\.ctp:38\nmsgctxt "B"\nmsgid "letter"/'; - $this->assertRegExp($pattern, $result, 'Should contain string with context "B"'); + $this->assertMatchesRegularExpression($pattern, $result, 'Should contain string with context "B"'); $pattern = '/\#: extract\.ctp:40\nmsgid "%d letter"\nmsgid_plural "%d letters"/'; - $this->assertRegExp($pattern, $result, 'Plural strings with context should not overwrite strings without context'); + $this->assertMatchesRegularExpression($pattern, $result, 'Plural strings with context should not overwrite strings without context'); $pattern = '/\#: extract\.ctp:41\nmsgctxt "A"\nmsgid "%d letter"\nmsgid_plural "%d letters"/'; - $this->assertRegExp($pattern, $result, 'Should contain plural string with context "A"'); + $this->assertMatchesRegularExpression($pattern, $result, 'Should contain plural string with context "A"'); // extract.ctp - reading the domain.pot $result = file_get_contents($this->path . DS . 'domain.pot'); $pattern = '/msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); $pattern = '/msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); $pattern = '/msgid "You have %d new message \(domain\)."\nmsgid_plural "You have %d new messages \(domain\)."/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $pattern = '/msgid "You deleted %d message \(domain\)."\nmsgid_plural "You deleted %d messages \(domain\)."/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); } /** @@ -215,10 +215,10 @@ public function testExtractCategory() { $result = file_get_contents($this->path . DS . 'default.pot'); $pattern = '/\#: .*extract\.ctp:31\n/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); $pattern = '/\#: .*extract\.ctp:33\n/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); } /** @@ -246,7 +246,7 @@ public function testExtractWithoutLocations() { $result = file_get_contents($this->path . DS . 'default.pot'); $pattern = '/\n\#: .*\n/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); } /** @@ -270,10 +270,10 @@ public function testExtractWithExclude() { $result = file_get_contents($this->path . DS . 'default.pot'); $pattern = '/\#: .*extract\.ctp:6\n/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); $pattern = '/\#: .*default\.ctp:26\n/'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); } /** @@ -297,7 +297,7 @@ public function testExtractMultiplePaths() { $result = file_get_contents($this->path . DS . 'default.pot'); $pattern = '/msgid "Add User"/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); } /** @@ -323,7 +323,7 @@ public function testExtractExcludePlugins() { $this->Task->execute(); $result = file_get_contents($this->path . DS . 'default.pot'); - $this->assertNotRegExp('#TestPlugin#', $result); + $this->assertDoesNotMatchRegularExpression('#TestPlugin#', $result); } /** @@ -348,7 +348,7 @@ public function testExtractPlugin() { $this->Task->execute(); $result = file_get_contents($this->path . DS . 'default.pot'); - $this->assertNotRegExp('#Pages#', $result); + $this->assertDoesNotMatchRegularExpression('#Pages#', $result); $this->assertStringContainsString('translate.ctp:1', $result); $this->assertStringContainsString('This is a translatable string', $result); $this->assertStringContainsString('I can haz plugin model validation message', $result); @@ -492,15 +492,15 @@ public function testExtractCore() { $result = file_get_contents($this->path . DS . 'cake.pot'); $pattern = '/msgid "Yesterday, %s"\nmsgstr ""\n/'; - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); $this->assertTrue(file_exists($this->path . DS . 'cake_dev.pot')); $result = file_get_contents($this->path . DS . 'cake_dev.pot'); $pattern = '/#: Console\/Templates\//'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); $pattern = '/#: Test\//'; - $this->assertNotRegExp($pattern, $result); + $this->assertDoesNotMatchRegularExpression($pattern, $result); } } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php index 82e4007..f4711b0 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php @@ -851,8 +851,8 @@ public function testBakeValidation() { ) ); $result = $this->Task->bake('BakeArticle', compact('validate')); - $this->assertRegExp('/class BakeArticle extends AppModel \{/', $result); - $this->assertRegExp('/\$validate \= array\(/', $result); + $this->assertMatchesRegularExpression('/class BakeArticle extends AppModel \{/', $result); + $this->assertMatchesRegularExpression('/\$validate \= array\(/', $result); $expected = <<< STRINGEND array( 'notBlank' => array( @@ -864,7 +864,7 @@ public function testBakeValidation() { //'on' => 'create', // Limit validation to 'create' or 'update' operations ), STRINGEND; - $this->assertRegExp('/' . preg_quote(str_replace("\r\n", "\n", $expected), '/') . '/', $result); + $this->assertMatchesRegularExpression('/' . preg_quote(str_replace("\r\n", "\n", $expected), '/') . '/', $result); } /** @@ -915,14 +915,14 @@ public function testBakeRelations() { $this->assertStringContainsString(' * @property OtherModel $OtherModel', $result); $this->assertStringContainsString(' * @property BakeComment $BakeComment', $result); $this->assertStringContainsString(' * @property BakeTag $BakeTag', $result); - $this->assertRegExp('/\$hasAndBelongsToMany \= array\(/', $result); - $this->assertRegExp('/\$hasMany \= array\(/', $result); - $this->assertRegExp('/\$belongsTo \= array\(/', $result); - $this->assertRegExp('/\$hasOne \= array\(/', $result); - $this->assertRegExp('/BakeTag/', $result); - $this->assertRegExp('/OtherModel/', $result); - $this->assertRegExp('/SomethingElse/', $result); - $this->assertRegExp('/BakeComment/', $result); + $this->assertMatchesRegularExpression('/\$hasAndBelongsToMany \= array\(/', $result); + $this->assertMatchesRegularExpression('/\$hasMany \= array\(/', $result); + $this->assertMatchesRegularExpression('/\$belongsTo \= array\(/', $result); + $this->assertMatchesRegularExpression('/\$hasOne \= array\(/', $result); + $this->assertMatchesRegularExpression('/BakeTag/', $result); + $this->assertMatchesRegularExpression('/OtherModel/', $result); + $this->assertMatchesRegularExpression('/SomethingElse/', $result); + $this->assertMatchesRegularExpression('/BakeComment/', $result); } /** diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index 4a24760..d77e437 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -142,10 +142,10 @@ public function testExecuteWithAbsolutePath() { $this->assertTrue(is_dir($this->Task->args[0]), 'No project dir'); $File = new File($path . DS . 'webroot' . DS . 'index.php'); $contents = $File->read(); - $this->assertRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); + $this->assertMatchesRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); $File = new File($path . DS . 'webroot' . DS . 'test.php'); $contents = $File->read(); - $this->assertRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); + $this->assertMatchesRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); } /** @@ -167,10 +167,10 @@ public function testExecuteWithCakeOnIncludePath() { $this->assertTrue(is_dir($this->Task->args[0]), 'No project dir'); $contents = file_get_contents($path . DS . 'webroot' . DS . 'index.php'); - $this->assertRegExp('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); + $this->assertMatchesRegularExpression('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); $contents = file_get_contents($path . DS . 'webroot' . DS . 'test.php'); - $this->assertRegExp('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); + $this->assertMatchesRegularExpression('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); ini_set('include_path', $restore); } @@ -227,7 +227,7 @@ public function testSecuritySaltGeneration() { $File = new File($path . 'Config' . DS . 'core.php'); $contents = $File->read(); - $this->assertNotRegExp('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); + $this->assertDoesNotMatchRegularExpression('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } /** @@ -244,7 +244,7 @@ public function testSecurityCipherSeedGeneration() { $File = new File($path . 'Config' . DS . 'core.php'); $contents = $File->read(); - $this->assertNotRegExp('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); + $this->assertDoesNotMatchRegularExpression('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); } /** @@ -261,8 +261,8 @@ public function testCachePrefixGeneration() { $File = new File($path . 'Config' . DS . 'core.php'); $contents = $File->read(); - $this->assertRegExp('/\$prefix = \'.+\';/', $contents, '$prefix is not defined'); - $this->assertNotRegExp('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s'); + $this->assertMatchesRegularExpression('/\$prefix = \'.+\';/', $contents, '$prefix is not defined'); + $this->assertDoesNotMatchRegularExpression('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s'); } /** @@ -278,10 +278,10 @@ public function testIndexPhpGeneration() { $File = new File($path . 'webroot' . DS . 'index.php'); $contents = $File->read(); - $this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); + $this->assertDoesNotMatchRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); $File = new File($path . 'webroot' . DS . 'test.php'); $contents = $File->read(); - $this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); + $this->assertDoesNotMatchRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); } /** @@ -380,6 +380,6 @@ public function testConsolePath() { $File = new File($path . 'Console' . DS . 'cake.php'); $contents = $File->read(); - $this->assertNotRegExp('/__CAKE_PATH__/', $contents, 'Console path placeholder left behind.'); + $this->assertDoesNotMatchRegularExpression('/__CAKE_PATH__/', $contents, 'Console path placeholder left behind.'); } } diff --git a/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php index dc54ea0..9310ec6 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php @@ -159,6 +159,6 @@ public function testGenerateWithTemplateFallbacks() { 'schema' => '' )); $result = $this->Task->generate('classes', 'fixture'); - $this->assertRegExp('/ArticleFixture extends CakeTestFixture/', $result); + $this->assertMatchesRegularExpression('/ArticleFixture extends CakeTestFixture/', $result); } } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php index e8c9eb7..004c294 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ViewTaskTest.php @@ -233,14 +233,14 @@ public function testGetContent() { ); $result = $this->Task->getContent('view', $vars); - $this->assertRegExp('/Delete Test View Model/', $result); - $this->assertRegExp('/Edit Test View Model/', $result); - $this->assertRegExp('/List Test View Models/', $result); - $this->assertRegExp('/New Test View Model/', $result); - - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); + $this->assertMatchesRegularExpression('/Delete Test View Model/', $result); + $this->assertMatchesRegularExpression('/Edit Test View Model/', $result); + $this->assertMatchesRegularExpression('/List Test View Models/', $result); + $this->assertMatchesRegularExpression('/New Test View Model/', $result); + + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); } /** @@ -265,19 +265,19 @@ public function testGetContentWithAdminAction() { ); $result = $this->Task->getContent('admin_view', $vars); - $this->assertRegExp('/Delete Test View Model/', $result); - $this->assertRegExp('/Edit Test View Model/', $result); - $this->assertRegExp('/List Test View Models/', $result); - $this->assertRegExp('/New Test View Model/', $result); + $this->assertMatchesRegularExpression('/Delete Test View Model/', $result); + $this->assertMatchesRegularExpression('/Edit Test View Model/', $result); + $this->assertMatchesRegularExpression('/List Test View Models/', $result); + $this->assertMatchesRegularExpression('/New Test View Model/', $result); - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); - $this->assertRegExp('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); + $this->assertMatchesRegularExpression('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); $result = $this->Task->getContent('admin_add', $vars); - $this->assertRegExp("/input\('name'\)/", $result); - $this->assertRegExp("/input\('body'\)/", $result); - $this->assertRegExp('/List Test View Models/', $result); + $this->assertMatchesRegularExpression("/input\('name'\)/", $result); + $this->assertMatchesRegularExpression("/input\('body'\)/", $result); + $this->assertMatchesRegularExpression('/List Test View Models/', $result); Configure::write('Routing', $_back); } diff --git a/lib/Cake/Test/Case/Console/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php index 868b81c..aef041a 100644 --- a/lib/Cake/Test/Case/Console/ShellTest.php +++ b/lib/Cake/Test/Case/Console/ShellTest.php @@ -28,59 +28,68 @@ * * @package Cake.Test.Case.Console.Command */ -class ShellTestShell extends Shell { +class ShellTestShell extends Shell +{ -/** - * name property - * - * @var name - */ + /** + * name property + * + * @var name + */ public $name = 'ShellTestShell'; -/** - * stopped property - * - * @var int - */ + /** + * stopped property + * + * @var int + */ public $stopped; -/** - * testMessage property - * - * @var string - */ + /** + * testMessage property + * + * @var string + */ public $testMessage = 'all your base are belong to us'; -/** - * stop method - * - * @param int $status - * @return void - */ - protected function _stop($status = 0) { + /** + * stop method + * + * @param int $status + * @return void + */ + protected function _stop($status = 0) + { $this->stopped = $status; } - protected function _secret() { + protected function _secret() + { } //@codingStandardsIgnoreStart - public function do_something() { + public function do_something() + { } - protected function no_access() { + protected function no_access() + { } - public function log_something() { + public function log_something() + { $this->log($this->testMessage); } + //@codingStandardsIgnoreEnd - public function mergeVars($properties, $class, $normalize = true) { + public function mergeVars($properties, $class, $normalize = true) + { return $this->_mergeVars($properties, $class, $normalize); } - public function useLogger($enable = true) { + public function useLogger($enable = true) + { $this->_useLogger($enable); } @@ -91,11 +100,12 @@ public function useLogger($enable = true) { * * @package Cake.Test.Case.Console.Command */ -class TestMergeShell extends Shell { +class TestMergeShell extends Shell +{ - public $tasks = array('DbConfig', 'Fixture'); + public $tasks = ['DbConfig', 'Fixture']; - public $uses = array('Comment'); + public $uses = ['Comment']; } @@ -104,7 +114,8 @@ class TestMergeShell extends Shell { * * @package Cake.Test.Case.Console.Command */ -class TestAppleTask extends Shell { +class TestAppleTask extends Shell +{ } /** @@ -112,7 +123,8 @@ class TestAppleTask extends Shell { * * @package Cake.Test.Case.Console.Command */ -class TestBananaTask extends Shell { +class TestBananaTask extends Shell +{ } /** @@ -120,29 +132,31 @@ class TestBananaTask extends Shell { * * @package Cake.Test.Case.Console.Command */ -class ShellTest extends CakeTestCase { +class ShellTest extends CakeTestCase +{ -/** - * Fixtures used in this test case - * - * @var array - */ - public $fixtures = array( + /** + * Fixtures used in this test case + * + * @var array + */ + public $fixtures = [ 'core.post', 'core.comment', 'core.article', 'core.user', - 'core.tag', 'core.articles_tag', 'core.attachment' - ); + 'core.tag', 'core.articles_tag', 'core.attachment', + ]; -/** - * setUp method - * - * @return void - */ - public function setUp(): void { + /** + * setUp method + * + * @return void + */ + public function setUp(): void + { parent::setUp(); - $output = $this->getMock('ConsoleOutput', array(), array(), '', false); - $error = $this->getMock('ConsoleOutput', array(), array(), '', false); - $in = $this->getMock('ConsoleInput', array(), array(), '', false); + $output = $this->getMock('ConsoleOutput', [], [], '', false); + $error = $this->getMock('ConsoleOutput', [], [], '', false); + $in = $this->getMock('ConsoleInput', [], [], '', false); $this->Shell = new ShellTestShell($output, $error, $in); if (is_dir(TMP . 'shell_test')) { @@ -151,51 +165,54 @@ public function setUp(): void { } } -/** - * testConstruct method - * - * @return void - */ - public function testConstruct() { + /** + * testConstruct method + * + * @return void + */ + public function testConstruct() + { $this->assertEquals('ShellTestShell', $this->Shell->name); $this->assertInstanceOf('ConsoleInput', $this->Shell->stdin); $this->assertInstanceOf('ConsoleOutput', $this->Shell->stdout); $this->assertInstanceOf('ConsoleOutput', $this->Shell->stderr); } -/** - * test merging vars - * - * @return void - */ - public function testMergeVars() { - $this->Shell->tasks = array('DbConfig' => array('one', 'two')); - $this->Shell->uses = array('Posts'); - $this->Shell->mergeVars(array('tasks'), 'TestMergeShell'); - $this->Shell->mergeVars(array('uses'), 'TestMergeShell', false); - - $expected = array('DbConfig' => null, 'Fixture' => null, 'DbConfig' => array('one', 'two')); + /** + * test merging vars + * + * @return void + */ + public function testMergeVars() + { + $this->Shell->tasks = ['DbConfig' => ['one', 'two']]; + $this->Shell->uses = ['Posts']; + $this->Shell->mergeVars(['tasks'], 'TestMergeShell'); + $this->Shell->mergeVars(['uses'], 'TestMergeShell', false); + + $expected = ['DbConfig' => null, 'Fixture' => null, 'DbConfig' => ['one', 'two']]; $this->assertEquals($expected, $this->Shell->tasks); - $expected = array('Fixture' => null, 'DbConfig' => array('one', 'two')); + $expected = ['Fixture' => null, 'DbConfig' => ['one', 'two']]; $this->assertEquals($expected, Hash::normalize($this->Shell->tasks), 'Normalized results are wrong.'); - $this->assertEquals(array('Comment', 'Posts'), $this->Shell->uses, 'Merged models are wrong.'); + $this->assertEquals(['Comment', 'Posts'], $this->Shell->uses, 'Merged models are wrong.'); } -/** - * testInitialize method - * - * @return void - */ - public function testInitialize() { - App::build(array( - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) - ), App::RESET); + /** + * testInitialize method + * + * @return void + */ + public function testInitialize() + { + App::build([ + 'Plugin' => [CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS], + 'Model' => [CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS], + ], App::RESET); CakePlugin::load('TestPlugin'); - $this->Shell->tasks = array('DbConfig' => array('one', 'two')); - $this->Shell->uses = array('TestPlugin.TestPluginPost'); + $this->Shell->tasks = ['DbConfig' => ['one', 'two']]; + $this->Shell->uses = ['TestPlugin.TestPluginPost']; $this->Shell->initialize(); $this->assertTrue(isset($this->Shell->TestPluginPost)); @@ -203,7 +220,7 @@ public function testInitialize() { $this->assertEquals('TestPluginPost', $this->Shell->modelClass); CakePlugin::unload('TestPlugin'); - $this->Shell->uses = array('Comment'); + $this->Shell->uses = ['Comment']; $this->Shell->initialize(); $this->assertTrue(isset($this->Shell->Comment)); $this->assertInstanceOf('Comment', $this->Shell->Comment); @@ -213,16 +230,17 @@ public function testInitialize() { App::build(); } -/** - * testLoadModel method - * - * @return void - */ - public function testLoadModel() { - App::build(array( - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) - ), App::RESET); + /** + * testLoadModel method + * + * @return void + */ + public function testLoadModel() + { + App::build([ + 'Plugin' => [CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS], + 'Model' => [CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS], + ], App::RESET); $Shell = new TestMergeShell(); $this->assertEquals('Comment', $Shell->Comment->alias); @@ -239,40 +257,21 @@ public function testLoadModel() { App::build(); } -/** - * testIn method - * - * @return void - */ - public function testIn() { - $this->Shell->stdin->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('n')); - - $this->Shell->stdin->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('Y')); - - $this->Shell->stdin->expects($this->at(2)) - ->method('read') - ->will($this->returnValue('y')); - - $this->Shell->stdin->expects($this->at(3)) - ->method('read') - ->will($this->returnValue('y')); - - $this->Shell->stdin->expects($this->at(4)) - ->method('read') - ->will($this->returnValue('y')); - - $this->Shell->stdin->expects($this->at(5)) + /** + * testIn method + * + * @return void + */ + public function testIn() + { + $this->Shell->stdin ->method('read') - ->will($this->returnValue('0')); + ->willReturnOnConsecutiveCalls('n', 'Y', 'y', 'y', 'y', '0'); - $result = $this->Shell->in('Just a test?', array('y', 'n'), 'n'); + $result = $this->Shell->in('Just a test?', ['y', 'n'], 'n'); $this->assertEquals('n', $result); - $result = $this->Shell->in('Just a test?', array('y', 'n'), 'n'); + $result = $this->Shell->in('Just a test?', ['y', 'n'], 'n'); $this->assertEquals('Y', $result); $result = $this->Shell->in('Just a test?', 'y,n', 'n'); @@ -284,65 +283,64 @@ public function testIn() { $result = $this->Shell->in('Just a test?', 'y', 'y'); $this->assertEquals('y', $result); - $result = $this->Shell->in('Just a test?', array(0, 1, 2), '0'); + $result = $this->Shell->in('Just a test?', [0, 1, 2], '0'); $this->assertEquals('0', $result); } -/** - * Test in() when not interactive. - * - * @return void - */ - public function testInNonInteractive() { + /** + * Test in() when not interactive. + * + * @return void + */ + public function testInNonInteractive() + { $this->Shell->interactive = false; $result = $this->Shell->in('Just a test?', 'y/n', 'n'); $this->assertEquals('n', $result); } -/** - * testOut method - * - * @return void - */ - public function testOut() { - $this->Shell->stdout->expects($this->at(0)) - ->method('write') - ->with("Just a test", 1); - - $this->Shell->stdout->expects($this->at(1)) - ->method('write') - ->with(array('Just', 'a', 'test'), 1); - - $this->Shell->stdout->expects($this->at(2)) - ->method('write') - ->with(array('Just', 'a', 'test'), 2); - - $this->Shell->stdout->expects($this->at(3)) + /** + * testOut method + * + * @return void + */ + public function testOut() + { + $this->Shell->stdout + ->expects($this->exactly(4)) ->method('write') - ->with('', 1); + ->withConsecutive( + ["Just a test", 1], + [['Just', 'a', 'test'], 1], + [['Just', 'a', 'test'], 2], + ['', 1] + ); $this->Shell->out('Just a test'); - $this->Shell->out(array('Just', 'a', 'test')); + $this->Shell->out(['Just', 'a', 'test']); - $this->Shell->out(array('Just', 'a', 'test'), 2); + $this->Shell->out(['Just', 'a', 'test'], 2); $this->Shell->out(); } -/** - * test that verbose and quiet output levels work - * - * @return void - */ - public function testVerboseOutput() { - $this->Shell->stdout->expects($this->at(0))->method('write') - ->with('Verbose', 1); - $this->Shell->stdout->expects($this->at(1))->method('write') - ->with('Normal', 1); - $this->Shell->stdout->expects($this->at(2))->method('write') - ->with('Quiet', 1); + /** + * test that verbose and quiet output levels work + * + * @return void + */ + public function testVerboseOutput() + { + $this->Shell->stdout + ->expects($this->exactly(3)) + ->method('write') + ->withConsecutive( + ['Verbose', 1], + ['Normal', 1], + ['Quiet', 1] + ); $this->Shell->params['verbose'] = true; $this->Shell->params['quiet'] = false; @@ -352,12 +350,13 @@ public function testVerboseOutput() { $this->Shell->out('Quiet', 1, Shell::QUIET); } -/** - * test that verbose and quiet output levels work - * - * @return void - */ - public function testQuietOutput() { + /** + * test that verbose and quiet output levels work + * + * @return void + */ + public function testQuietOutput() + { $this->Shell->stdout->expects($this->once())->method('write') ->with('Quiet', 1); @@ -377,65 +376,53 @@ public function testQuietOutput() { public function testOverwrite() { $number = strlen('Some text I want to overwrite'); - $this->Shell->stdout->expects($this->at(0)) + $this->Shell->stdout->expects($this->exactly(5)) ->method('write') - ->with('Some text I want to overwrite', 0) - ->will($this->returnValue($number)); + ->willReturnOnConsecutiveCalls($number, null, 9, null, null) + ->withConsecutive( + ['Some text I want to overwrite', 0], + [str_repeat("\x08", $number), 0], + ['Less text', 0], + [str_repeat(' ', $number - 9), 0], + ["\n", 0] // Adicionando a chamada extra com '\n' + ); - $this->Shell->stdout->expects($this->at(1)) - ->method('write') - ->with(str_repeat("\x08", $number), 0); - - $this->Shell->stdout->expects($this->at(2)) - ->method('write') - ->with('Less text', 0) - ->will($this->returnValue(9)); - - $this->Shell->stdout->expects($this->at(3)) - ->method('write') - ->with(str_repeat(' ', $number - 9), 0); $this->Shell->out('Some text I want to overwrite', 0); $this->Shell->overwrite('Less text'); - } - -/** - * testErr method - * - * @return void - */ - public function testErr() { - $this->Shell->stderr->expects($this->at(0)) - ->method('write') - ->with("Just a test", 1); - $this->Shell->stderr->expects($this->at(1)) - ->method('write') - ->with(array('Just', 'a', 'test'), 1); - - $this->Shell->stderr->expects($this->at(2)) - ->method('write') - ->with(array('Just', 'a', 'test'), 2); + } - $this->Shell->stderr->expects($this->at(3)) + /** + * testErr method + * + * @return void + */ + public function testErr() + { + $this->Shell->stderr + ->expects($this->exactly(4)) ->method('write') - ->with('', 1); + ->withConsecutive( + ["Just a test", 1], + [["Just", "a", "test"], 1], + [["Just", "a", "test"], 2], + ["", 1] + ); $this->Shell->err('Just a test'); - - $this->Shell->err(array('Just', 'a', 'test')); - - $this->Shell->err(array('Just', 'a', 'test'), 2); - + $this->Shell->err(["Just", "a", "test"]); + $this->Shell->err(["Just", "a", "test"], 2); $this->Shell->err(); } -/** - * testNl - * - * @return void - */ - public function testNl() { + /** + * testNl + * + * @return void + */ + public function testNl() + { $newLine = "\n"; if (DS === '\\') { $newLine = "\r\n"; @@ -447,25 +434,28 @@ public function testNl() { $this->assertEquals($this->Shell->nl(1), $newLine); } -/** - * testHr - * - * @return void - */ - public function testHr() { + /** + * testHr + * + * @return void + */ + public function testHr() + { $bar = '---------------------------------------------------------------'; - $this->Shell->stdout->expects($this->at(0))->method('write')->with('', 0); - $this->Shell->stdout->expects($this->at(1))->method('write')->with($bar, 1); - $this->Shell->stdout->expects($this->at(2))->method('write')->with('', 0); - - $this->Shell->stdout->expects($this->at(3))->method('write')->with("", true); - $this->Shell->stdout->expects($this->at(4))->method('write')->with($bar, 1); - $this->Shell->stdout->expects($this->at(5))->method('write')->with("", true); - - $this->Shell->stdout->expects($this->at(6))->method('write')->with("", 2); - $this->Shell->stdout->expects($this->at(7))->method('write')->with($bar, 1); - $this->Shell->stdout->expects($this->at(8))->method('write')->with("", 2); + $this->Shell->stdout->expects($this->exactly(9)) + ->method('write') + ->withConsecutive( + ['', 0], + [$bar, 1], + ['', 0], + ["", true], + [$bar, 1], + ["", true], + ["", 2], + [$bar, 1], + ["", 2] + ); $this->Shell->hr(); @@ -474,23 +464,21 @@ public function testHr() { $this->Shell->hr(2); } -/** - * testError - * - * @return void - */ - public function testError() { - $this->Shell->stderr->expects($this->at(0)) - ->method('write') - ->with("Error: Foo Not Found", 1); - - $this->Shell->stderr->expects($this->at(1)) + /** + * testError + * + * @return void + */ + public function testError() + { + $this->Shell->stderr->expects($this->exactly(3)) ->method('write') - ->with("Error: Foo Not Found", 1); + ->withConsecutive( + ["Error: Foo Not Found", 1], + ["Error: Foo Not Found", 1], + ["Searched all...", 1] + ); - $this->Shell->stderr->expects($this->at(2)) - ->method('write') - ->with("Searched all...", 1); $this->Shell->error('Foo Not Found'); $this->assertSame($this->Shell->stopped, 1); @@ -501,12 +489,13 @@ public function testError() { $this->assertSame($this->Shell->stopped, 1); } -/** - * testLoadTasks method - * - * @return void - */ - public function testLoadTasks() { + /** + * testLoadTasks method + * + * @return void + */ + public function testLoadTasks() + { $this->assertTrue($this->Shell->loadTasks()); $this->Shell->tasks = null; @@ -518,10 +507,10 @@ public function testLoadTasks() { $this->Shell->tasks = true; $this->assertTrue($this->Shell->loadTasks()); - $this->Shell->tasks = array(); + $this->Shell->tasks = []; $this->assertTrue($this->Shell->loadTasks()); - $this->Shell->tasks = array('TestApple'); + $this->Shell->tasks = ['TestApple']; $this->assertTrue($this->Shell->loadTasks()); $this->assertInstanceOf('TestAppleTask', $this->Shell->TestApple); @@ -532,36 +521,38 @@ public function testLoadTasks() { unset($this->Shell->ShellTestApple, $this->Shell->TestBanana); - $this->Shell->tasks = array('TestApple', 'TestBanana'); + $this->Shell->tasks = ['TestApple', 'TestBanana']; $this->assertTrue($this->Shell->loadTasks()); $this->assertInstanceOf('TestAppleTask', $this->Shell->TestApple); $this->assertInstanceOf('TestBananaTask', $this->Shell->TestBanana); } -/** - * test that __get() makes args and params references - * - * @return void - */ - public function testMagicGetArgAndParamReferences() { - $this->Shell->tasks = array('TestApple'); - $this->Shell->args = array('one'); - $this->Shell->params = array('help' => false); + /** + * test that __get() makes args and params references + * + * @return void + */ + public function testMagicGetArgAndParamReferences() + { + $this->Shell->tasks = ['TestApple']; + $this->Shell->args = ['one']; + $this->Shell->params = ['help' => false]; $this->Shell->loadTasks(); $result = $this->Shell->TestApple; - $this->Shell->args = array('one', 'two'); + $this->Shell->args = ['one', 'two']; $this->assertSame($this->Shell->args, $result->args); $this->assertSame($this->Shell->params, $result->params); } -/** - * testShortPath method - * - * @return void - */ - public function testShortPath() { + /** + * testShortPath method + * + * @return void + */ + public function testShortPath() + { $path = $expected = DS . 'tmp' . DS . 'ab' . DS . 'cd'; $this->assertEquals($expected, $this->Shell->shortPath($path)); @@ -592,12 +583,13 @@ public function testShortPath() { $this->assertEquals($expected, $this->Shell->shortPath($path)); } -/** - * testCreateFile method - * - * @return void - */ - public function testCreateFileNonInteractive() { + /** + * testCreateFile method + * + * @return void + */ + public function testCreateFileNonInteractive() + { $eol = PHP_EOL; $path = TMP . 'shell_test'; @@ -620,12 +612,13 @@ public function testCreateFileNonInteractive() { $this->assertTextEquals(file_get_contents($file), $contents); } -/** - * test createFile when the shell is interactive. - * - * @return void - */ - public function testCreateFileInteractive() { + /** + * test createFile when the shell is interactive. + * + * @return void + */ + public function testCreateFileInteractive() + { $eol = PHP_EOL; $path = TMP . 'shell_test'; @@ -634,13 +627,9 @@ public function testCreateFileInteractive() { $this->Shell->interactive = true; - $this->Shell->stdin->expects($this->at(0)) + $this->Shell->stdin->expects($this->exactly(2)) ->method('read') - ->will($this->returnValue('n')); - - $this->Shell->stdin->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('y')); + ->willReturnOnConsecutiveCalls('n', 'y'); $contents = "Shell->createFile($file, $contents); @@ -663,12 +652,13 @@ public function testCreateFileInteractive() { $this->assertEquals($contents, file_get_contents($file)); } -/** - * Test that you can't create files that aren't writable. - * - * @return void - */ - public function testCreateFileNoPermissions() { + /** + * Test that you can't create files that aren't writable. + * + * @return void + */ + public function testCreateFileNoPermissions() + { $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Cant perform operations using permissions on Windows.'); $path = TMP . 'shell_test'; @@ -686,13 +676,14 @@ public function testCreateFileNoPermissions() { rmdir($path); } -/** - * test hasTask method - * - * @return void - */ - public function testHasTask() { - $this->Shell->tasks = array('Extract', 'DbConfig'); + /** + * test hasTask method + * + * @return void + */ + public function testHasTask() + { + $this->Shell->tasks = ['Extract', 'DbConfig']; $this->Shell->loadTasks(); $this->assertTrue($this->Shell->hasTask('extract')); @@ -703,132 +694,140 @@ public function testHasTask() { $this->assertTrue($this->Shell->hasTask('DbConfig')); } -/** - * test the hasMethod - * - * @return void - */ - public function testHasMethod() { + /** + * test the hasMethod + * + * @return void + */ + public function testHasMethod() + { $this->assertTrue($this->Shell->hasMethod('do_something')); $this->assertFalse($this->Shell->hasMethod('hr'), 'hr is callable'); $this->assertFalse($this->Shell->hasMethod('_secret'), '_secret is callable'); $this->assertFalse($this->Shell->hasMethod('no_access'), 'no_access is callable'); } -/** - * test run command calling main. - * - * @return void - */ - public function testRunCommandMain() { - $Mock = $this->getMock('Shell', array('main', 'startup'), array(), '', false); + /** + * test run command calling main. + * + * @return void + */ + public function testRunCommandMain() + { + $Mock = $this->getMock('Shell', ['main', 'startup'], [], '', false); $Mock->expects($this->once())->method('main')->will($this->returnValue(true)); - $result = $Mock->runCommand(null, array()); + $result = $Mock->runCommand(null, []); $this->assertTrue($result); } -/** - * test run command calling a legit method. - * - * @return void - */ - public function testRunCommandWithMethod() { - $Mock = $this->getMock('Shell', array('hit_me', 'startup'), array(), '', false); + /** + * test run command calling a legit method. + * + * @return void + */ + public function testRunCommandWithMethod() + { + $Mock = $this->getMock('Shell', ['hit_me', 'startup'], [], '', false); $Mock->expects($this->once())->method('hit_me')->will($this->returnValue(true)); - $result = $Mock->runCommand('hit_me', array()); + $result = $Mock->runCommand('hit_me', []); $this->assertTrue($result); } -/** - * test run command causing exception on Shell method. - * - * @return void - */ - public function testRunCommandBaseclassMethod() { - $Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false); - $Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false); + /** + * test run command causing exception on Shell method. + * + * @return void + */ + public function testRunCommandBaseclassMethod() + { + $Mock = $this->getMock('Shell', ['startup', 'getOptionParser', 'out'], [], '', false); + $Parser = $this->getMock('ConsoleOptionParser', [], [], '', false); $Parser->expects($this->once())->method('help'); $Mock->expects($this->once())->method('getOptionParser') ->will($this->returnValue($Parser)); $Mock->expects($this->once())->method('out'); - $Mock->runCommand('hr', array()); + $Mock->runCommand('hr', []); } -/** - * test run command causing exception on Shell method. - * - * @return void - */ - public function testRunCommandMissingMethod() { - $Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false); - $Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false); + /** + * test run command causing exception on Shell method. + * + * @return void + */ + public function testRunCommandMissingMethod() + { + $Mock = $this->getMock('Shell', ['startup', 'getOptionParser', 'out'], [], '', false); + $Parser = $this->getMock('ConsoleOptionParser', [], [], '', false); $Parser->expects($this->once())->method('help'); $Mock->expects($this->once())->method('getOptionParser') ->will($this->returnValue($Parser)); $Mock->expects($this->once())->method('out'); - $result = $Mock->runCommand('idontexist', array()); + $result = $Mock->runCommand('idontexist', []); $this->assertFalse($result); } -/** - * test unknown option causes display of error and help. - * - * @return void - */ - public function testRunCommandUnknownOption() { - $output = $this->getMock('ConsoleOutput', array(), array(), '', false); - $error = $this->getMock('ConsoleOutput', array(), array(), '', false); - $in = $this->getMock('ConsoleInput', array(), array(), '', false); + /** + * test unknown option causes display of error and help. + * + * @return void + */ + public function testRunCommandUnknownOption() + { + $output = $this->getMock('ConsoleOutput', [], [], '', false); + $error = $this->getMock('ConsoleOutput', [], [], '', false); + $in = $this->getMock('ConsoleInput', [], [], '', false); - $Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false); + $Parser = $this->getMock('ConsoleOptionParser', [], [], '', false); $Parser->expects($this->once())->method('parse') - ->with(array('--unknown')) + ->with(['--unknown']) ->will($this->throwException(new ConsoleException('Unknown option `unknown`'))); $Parser->expects($this->once())->method('help'); - $Shell = $this->getMock('ShellTestShell', array('getOptionParser'), array($output, $error, $in)); + $Shell = $this->getMock('ShellTestShell', ['getOptionParser'], [$output, $error, $in]); $Shell->expects($this->once())->method('getOptionParser') ->will($this->returnValue($Parser)); $Shell->stderr->expects($this->once())->method('write'); $Shell->stdout->expects($this->once())->method('write'); - $Shell->runCommand('do_something', array('do_something', '--unknown')); + $Shell->runCommand('do_something', ['do_something', '--unknown']); } -/** - * test that a --help causes help to show. - * - * @return void - */ - public function testRunCommandTriggeringHelp() { - $Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false); + /** + * test that a --help causes help to show. + * + * @return void + */ + public function testRunCommandTriggeringHelp() + { + $Parser = $this->getMock('ConsoleOptionParser', [], [], '', false); $Parser->expects($this->once())->method('parse') - ->with(array('--help')) - ->will($this->returnValue(array(array('help' => true), array()))); + ->with(['--help']) + ->will($this->returnValue([['help' => true], []])); $Parser->expects($this->once())->method('help'); - $Shell = $this->getMock('Shell', array('getOptionParser', 'out', 'startup', '_welcome'), array(), '', false); + $Shell = $this->getMock('Shell', ['getOptionParser', 'out', 'startup', '_welcome'], [], '', false); $Shell->expects($this->once())->method('getOptionParser') ->will($this->returnValue($Parser)); $Shell->expects($this->once())->method('out'); - $Shell->runCommand(null, array('--help')); + $Shell->runCommand(null, ['--help']); } -/** - * test that runCommand will call runCommand on the task. - * - * @return void - */ - public function testRunCommandHittingTask() { - $Shell = $this->getMock('Shell', array('hasTask', 'startup'), array(), '', false); - $task = $this->getMock('Shell', array('execute', 'runCommand'), array(), '', false); + /** + * test that runCommand will call runCommand on the task. + * + * @return void + */ + public function testRunCommandHittingTask() + { + $Shell = $this->getMock('Shell', ['hasTask', 'startup'], [], '', false); + $task = $this->getMock('Shell', ['execute', 'runCommand'], [], '', false); $task->expects($this->any()) ->method('runCommand') - ->with('execute', array('one', 'value')); + ->with('execute', ['one', 'value']); $Shell->expects($this->once())->method('startup'); $Shell->expects($this->any()) @@ -837,15 +836,16 @@ public function testRunCommandHittingTask() { $Shell->RunCommand = $task; - $Shell->runCommand('run_command', array('run_command', 'one', 'value')); + $Shell->runCommand('run_command', ['run_command', 'one', 'value']); } -/** - * test wrapBlock wrapping text. - * - * @return void - */ - public function testWrapText() { + /** + * test wrapBlock wrapping text. + * + * @return void + */ + public function testWrapText() + { $text = 'This is the song that never ends. This is the song that never ends. This is the song that never ends.'; $result = $this->Shell->wrapText($text, 33); $expected = <<assertTextEquals($expected, $result, 'Text not wrapped.'); - $result = $this->Shell->wrapText($text, array('indent' => ' ', 'width' => 33)); + $result = $this->Shell->wrapText($text, ['indent' => ' ', 'width' => 33]); $expected = <<assertTextEquals($expected, $result, 'Text not wrapped.'); } -/** - * Testing camel cased naming of tasks - * - * @return void - */ - public function testShellNaming() { - $this->Shell->tasks = array('TestApple'); + /** + * Testing camel cased naming of tasks + * + * @return void + */ + public function testShellNaming() + { + $this->Shell->tasks = ['TestApple']; $this->Shell->loadTasks(); $expected = 'TestApple'; $this->assertEquals($expected, $this->Shell->TestApple->name); } -/** - * Test reading params - * - * @dataProvider paramReadingDataProvider - */ - public function testParamReading($toRead, $expected) { - $this->Shell->params = array( + /** + * Test reading params + * + * @dataProvider paramReadingDataProvider + */ + public function testParamReading($toRead, $expected) + { + $this->Shell->params = [ 'key' => 'value', 'help' => false, 'emptykey' => '', - 'truthy' => true - ); + 'truthy' => true, + ]; $this->assertSame($expected, $this->Shell->param($toRead)); } -/** - * Data provider for testing reading values with Shell::param() - * - * @return array - */ - public function paramReadingDataProvider() { - return array( - array( + /** + * Data provider for testing reading values with Shell::param() + * + * @return array + */ + public function paramReadingDataProvider() + { + return [ + [ 'key', 'value', - ), - array( + ], + [ 'help', false, - ), - array( + ], + [ 'emptykey', '', - ), - array( + ], + [ 'truthy', true, - ), - array( + ], + [ 'does_not_exist', null, - ) - ); + ], + ]; } -/** - * Test that option parsers are created with the correct name/command. - * - * @return void - */ - public function testGetOptionParser() { + /** + * Test that option parsers are created with the correct name/command. + * + * @return void + */ + public function testGetOptionParser() + { $this->Shell->name = 'test'; $this->Shell->plugin = 'plugin'; $parser = $this->Shell->getOptionParser(); @@ -934,12 +938,13 @@ public function testGetOptionParser() { $this->assertEquals('plugin.test', $parser->command()); } -/** - * Test file and console and logging - * - * @return void - */ - public function testFileAndConsoleLogging() { + /** + * Test file and console and logging + * + * @return void + */ + public function testFileAndConsoleLogging() + { CakeLog::disable('stdout'); CakeLog::disable('stderr'); // file logging @@ -951,13 +956,13 @@ public function testFileAndConsoleLogging() { // both file and console logging require_once CORE_TEST_CASES . DS . 'Log' . DS . 'Engine' . DS . 'ConsoleLogTest.php'; - $mock = $this->getMock('ConsoleLog', array('write'), array( - array('types' => 'error'), - )); - TestCakeLog::config('console', array( + $mock = $this->getMock('ConsoleLog', ['write'], [ + ['types' => 'error'], + ]); + TestCakeLog::config('console', [ 'engine' => 'Console', 'stream' => 'php://stderr', - )); + ]); TestCakeLog::replace('console', $mock); $mock->expects($this->once()) ->method('write') @@ -971,12 +976,13 @@ public function testFileAndConsoleLogging() { CakeLog::enable('stderr'); } -/** - * Tests that _useLogger works properly - * - * @return void - */ - public function testProtectedUseLogger() { + /** + * Tests that _useLogger works properly + * + * @return void + */ + public function testProtectedUseLogger() + { CakeLog::drop('stdout'); CakeLog::drop('stderr'); $this->Shell->useLogger(true); @@ -987,53 +993,57 @@ public function testProtectedUseLogger() { $this->assertFalse(CakeLog::stream('stderr')); } -/** - * Test file and console and logging quiet output - * - * @return void - */ - public function testQuietLog() { - $output = $this->getMock('ConsoleOutput', array(), array(), '', false); - $error = $this->getMock('ConsoleOutput', array(), array(), '', false); - $in = $this->getMock('ConsoleInput', array(), array(), '', false); - $this->Shell = $this->getMock('ShellTestShell', array('_useLogger'), array($output, $error, $in)); + /** + * Test file and console and logging quiet output + * + * @return void + */ + public function testQuietLog() + { + $output = $this->getMock('ConsoleOutput', [], [], '', false); + $error = $this->getMock('ConsoleOutput', [], [], '', false); + $in = $this->getMock('ConsoleInput', [], [], '', false); + $this->Shell = $this->getMock('ShellTestShell', ['_useLogger'], [$output, $error, $in]); $this->Shell->expects($this->once())->method('_useLogger')->with(false); - $this->Shell->runCommand('foo', array('--quiet')); + $this->Shell->runCommand('foo', ['--quiet']); } -/** - * Test getting an instance of a helper - * - * @return void - */ - public function testGetInstanceOfHelper() { + /** + * Test getting an instance of a helper + * + * @return void + */ + public function testGetInstanceOfHelper() + { $actual = $this->Shell->helper("progress"); $this->assertInstanceOf("ProgressShellHelper", $actual); } -/** + /** * Test getting an invalid helper * * @return void */ - public function testGetInvalidHelper() { + public function testGetInvalidHelper() + { $this->expectException(\RunTimeException::class); $this->Shell->helper("tomato"); } -/** - * Test that shell loggers do not get overridden in constructor if already configured - * - * @return void - */ - public function testShellLoggersDoNotGetOverridden() { + /** + * Test that shell loggers do not get overridden in constructor if already configured + * + * @return void + */ + public function testShellLoggersDoNotGetOverridden() + { $shell = $this->getMock( - "Shell", array( - "_loggerIsConfigured", - "_configureStdOutLogger", - "_configureStdErrLogger", - ), - array(), + "Shell", [ + "_loggerIsConfigured", + "_configureStdOutLogger", + "_configureStdErrLogger", + ], + [], "", false ); diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index d98992a..075b7a8 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -381,6 +381,7 @@ class AuthComponentTest extends CakeTestCase { public function setUp(): void { $_SERVER['PHP_AUTH_USER'] = null; $_SERVER['PHP_AUTH_PW'] = null; + $_SERVER['HTTP_AUTHORIZATION'] = null; parent::setUp(); Configure::write('Security.salt', 'YJfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi'); Configure::write('Security.cipherSeed', 770011223369876); diff --git a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php index f7e2982..343c3df 100644 --- a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php @@ -335,8 +335,8 @@ public function testTemplateNestedElements() { $this->Controller->EmailTest->send(); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/Test/', $result); - $this->assertRegExp('/http\:\/\/example\.com/', $result); + $this->assertMatchesRegularExpression('/Test/', $result); + $this->assertMatchesRegularExpression('/http\:\/\/example\.com/', $result); } /** @@ -356,13 +356,13 @@ public function testSendNullProperties() { $this->assertTrue($this->Controller->EmailTest->send(null)); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/To: test@example.com\n/', $result); - $this->assertRegExp('/Subject: \n/', $result); - $this->assertRegExp('/From: test@example.com\n/', $result); - $this->assertRegExp('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); - $this->assertRegExp('/X-Mailer: CakePHP Email Component\n/', $result); - $this->assertRegExp('/Content-Type: text\/plain; charset=UTF-8\n/', $result); - $this->assertRegExp('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); + $this->assertMatchesRegularExpression('/To: test@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Subject: \n/', $result); + $this->assertMatchesRegularExpression('/From: test@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); + $this->assertMatchesRegularExpression('/X-Mailer: CakePHP Email Component\n/', $result); + $this->assertMatchesRegularExpression('/Content-Type: text\/plain; charset=UTF-8\n/', $result); + $this->assertMatchesRegularExpression('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); } /** @@ -383,17 +383,17 @@ public function testSendDebug() { $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/To: postmaster@example.com\n/', $result); - $this->assertRegExp('/Subject: Cake Debug Test\n/', $result); - $this->assertRegExp('/Reply-To: noreply@example.com\n/', $result); - $this->assertRegExp('/From: noreply@example.com\n/', $result); - $this->assertRegExp('/Cc: cc@example.com\n/', $result); - $this->assertRegExp('/Bcc: bcc@example.com\n/', $result); - $this->assertRegExp('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); - $this->assertRegExp('/X-Mailer: CakePHP Email Component\n/', $result); - $this->assertRegExp('/Content-Type: text\/plain; charset=UTF-8\n/', $result); - $this->assertRegExp('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); - $this->assertRegExp('/This is the body of the message/', $result); + $this->assertMatchesRegularExpression('/To: postmaster@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Subject: Cake Debug Test\n/', $result); + $this->assertMatchesRegularExpression('/Reply-To: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/From: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Cc: cc@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Bcc: bcc@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); + $this->assertMatchesRegularExpression('/X-Mailer: CakePHP Email Component\n/', $result); + $this->assertMatchesRegularExpression('/Content-Type: text\/plain; charset=UTF-8\n/', $result); + $this->assertMatchesRegularExpression('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); + $this->assertMatchesRegularExpression('/This is the body of the message/', $result); } /** @@ -414,15 +414,15 @@ public function testSendDebugWithNoSessions() { $this->Controller->EmailTest->send('This is the body of the message'); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/To: postmaster@example.com\n/', $result); - $this->assertRegExp('/Subject: Cake Debug Test\n/', $result); - $this->assertRegExp('/Reply-To: noreply@example.com\n/', $result); - $this->assertRegExp('/From: noreply@example.com\n/', $result); - $this->assertRegExp('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); - $this->assertRegExp('/X-Mailer: CakePHP Email Component\n/', $result); - $this->assertRegExp('/Content-Type: text\/plain; charset=UTF-8\n/', $result); - $this->assertRegExp('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); - $this->assertRegExp('/This is the body of the message/', $result); + $this->assertMatchesRegularExpression('/To: postmaster@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Subject: Cake Debug Test\n/', $result); + $this->assertMatchesRegularExpression('/Reply-To: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/From: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Date: ' . preg_quote(static::$sentDate) . '\n/', $result); + $this->assertMatchesRegularExpression('/X-Mailer: CakePHP Email Component\n/', $result); + $this->assertMatchesRegularExpression('/Content-Type: text\/plain; charset=UTF-8\n/', $result); + $this->assertMatchesRegularExpression('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); + $this->assertMatchesRegularExpression('/This is the body of the message/', $result); $this->Controller->Session = $session; } @@ -568,16 +568,16 @@ public function testSendContentArray() { $this->assertTrue($this->Controller->EmailTest->send($content)); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/To: postmaster@example.com\n/', $result); - $this->assertRegExp('/Subject: Cake Debug Test\n/', $result); - $this->assertRegExp('/Reply-To: noreply@example.com\n/', $result); - $this->assertRegExp('/From: noreply@example.com\n/', $result); - $this->assertRegExp('/X-Mailer: CakePHP Email Component\n/', $result); - $this->assertRegExp('/Content-Type: text\/plain; charset=UTF-8\n/', $result); - $this->assertRegExp('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); - $this->assertRegExp('/First line\n/', $result); - $this->assertRegExp('/Second line\n/', $result); - $this->assertRegExp('/Third line\n/', $result); + $this->assertMatchesRegularExpression('/To: postmaster@example.com\n/', $result); + $this->assertMatchesRegularExpression('/Subject: Cake Debug Test\n/', $result); + $this->assertMatchesRegularExpression('/Reply-To: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/From: noreply@example.com\n/', $result); + $this->assertMatchesRegularExpression('/X-Mailer: CakePHP Email Component\n/', $result); + $this->assertMatchesRegularExpression('/Content-Type: text\/plain; charset=UTF-8\n/', $result); + $this->assertMatchesRegularExpression('/Content-Transfer-Encoding: 8bitMessage:\n/', $result); + $this->assertMatchesRegularExpression('/First line\n/', $result); + $this->assertMatchesRegularExpression('/Second line\n/', $result); + $this->assertMatchesRegularExpression('/Third line\n/', $result); } /** @@ -595,7 +595,7 @@ public function testDateProperty() { $this->assertTrue($this->Controller->EmailTest->send('test message')); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/Date: Today!\n/', $result); + $this->assertMatchesRegularExpression('/Date: Today!\n/', $result); } /** @@ -709,8 +709,8 @@ public function testSendWithAttachments() { $this->Controller->EmailTest->sendAs = 'text'; $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = DebugCompTransport::$lastEmail; - $this->assertRegExp('/' . preg_quote('Content-Disposition: attachment; filename="EmailComponentTest.php"') . '/', $msg); - $this->assertRegExp('/' . preg_quote('Content-Disposition: attachment; filename="some-name.php"') . '/', $msg); + $this->assertMatchesRegularExpression('/' . preg_quote('Content-Disposition: attachment; filename="EmailComponentTest.php"') . '/', $msg); + $this->assertMatchesRegularExpression('/' . preg_quote('Content-Disposition: attachment; filename="some-name.php"') . '/', $msg); } /** @@ -731,22 +731,22 @@ public function testSendAsIsNotIgnoredIfAttachmentsPresent() { $this->Controller->EmailTest->sendAs = 'html'; $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = DebugCompTransport::$lastEmail; - $this->assertNotRegExp('/text\/plain/', $msg); - $this->assertRegExp('/text\/html/', $msg); + $this->assertDoesNotMatchRegularExpression('/text\/plain/', $msg); + $this->assertMatchesRegularExpression('/text\/html/', $msg); $this->Controller->EmailTest->sendAs = 'text'; $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = DebugCompTransport::$lastEmail; - $this->assertRegExp('/text\/plain/', $msg); - $this->assertNotRegExp('/text\/html/', $msg); + $this->assertMatchesRegularExpression('/text\/plain/', $msg); + $this->assertDoesNotMatchRegularExpression('/text\/html/', $msg); $this->Controller->EmailTest->sendAs = 'both'; $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = DebugCompTransport::$lastEmail; - $this->assertRegExp('/text\/plain/', $msg); - $this->assertRegExp('/text\/html/', $msg); - $this->assertRegExp('/multipart\/alternative/', $msg); + $this->assertMatchesRegularExpression('/text\/plain/', $msg); + $this->assertMatchesRegularExpression('/text\/html/', $msg); + $this->assertMatchesRegularExpression('/multipart\/alternative/', $msg); } /** @@ -767,8 +767,8 @@ public function testNoDoubleNewlinesInHeaders() { $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = DebugCompTransport::$lastEmail; - $this->assertNotRegExp('/\n\nContent-Transfer-Encoding/', $msg); - $this->assertRegExp('/\nContent-Transfer-Encoding/', $msg); + $this->assertDoesNotMatchRegularExpression('/\n\nContent-Transfer-Encoding/', $msg); + $this->assertMatchesRegularExpression('/\nContent-Transfer-Encoding/', $msg); } /** @@ -838,7 +838,7 @@ public function testPluginCustomViewClass() { $this->assertTrue($this->Controller->EmailTest->send($body)); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/Body of message/', $result); + $this->assertMatchesRegularExpression('/Body of message/', $result); } /** @@ -867,21 +867,21 @@ public function testMessageId() { $result = DebugCompTransport::$lastEmail; $host = env('HTTP_HOST') ? env('HTTP_HOST') : php_uname('n'); - $this->assertRegExp('/Message-ID: \<[a-f0-9]{8}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{12}@' . $host . '\>\n/', $result); + $this->assertMatchesRegularExpression('/Message-ID: \<[a-f0-9]{8}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{12}@' . $host . '\>\n/', $result); $this->Controller->EmailTest->messageId = '<22091985.998877@example.com>'; $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/Message-ID: <22091985.998877@example.com>\n/', $result); + $this->assertMatchesRegularExpression('/Message-ID: <22091985.998877@example.com>\n/', $result); $this->Controller->EmailTest->messageId = false; $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); $result = DebugCompTransport::$lastEmail; - $this->assertNotRegExp('/Message-ID:/', $result); + $this->assertDoesNotMatchRegularExpression('/Message-ID:/', $result); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 3605c70..a60d86f 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -847,7 +847,7 @@ public function testAjaxRedirectAsRequestAction() { $this->Controller, array('controller' => 'request_handler_test', 'action' => 'destination') ); $result = ob_get_clean(); - $this->assertRegExp('/posts index/', $result, 'RequestAction redirect failed.'); + $this->assertMatchesRegularExpression('/posts index/', $result, 'RequestAction redirect failed.'); App::build(); } @@ -876,8 +876,8 @@ public function testAjaxRedirectAsRequestActionStillRenderingLayout() { $this->Controller, array('controller' => 'request_handler_test', 'action' => 'ajax2_layout') ); $result = ob_get_clean(); - $this->assertRegExp('/posts index/', $result, 'RequestAction redirect failed.'); - $this->assertRegExp('/Ajax!/', $result, 'Layout was not rendered.'); + $this->assertMatchesRegularExpression('/posts index/', $result, 'RequestAction redirect failed.'); + $this->assertMatchesRegularExpression('/Ajax!/', $result, 'Layout was not rendered.'); App::build(); } diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index ab56300..8518467 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -573,7 +573,7 @@ public function testFlash() { $Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $Controller->flash('this should work', '/flash', 1, 'ajax2'); $result = $Controller->response->body(); - $this->assertRegExp('/Ajax!/', $result); + $this->assertMatchesRegularExpression('/Ajax!/', $result); App::build(); } @@ -635,14 +635,14 @@ public function testRender() { $Controller->viewPath = 'Posts'; $result = $Controller->render('index'); - $this->assertRegExp('/posts index/', (string)$result); + $this->assertMatchesRegularExpression('/posts index/', (string)$result); $Controller->view = 'index'; $result = $Controller->render(); - $this->assertRegExp('/posts index/', (string)$result); + $this->assertMatchesRegularExpression('/posts index/', (string)$result); $result = $Controller->render('/Elements/test_element'); - $this->assertRegExp('/this is the test element/', (string)$result); + $this->assertMatchesRegularExpression('/this is the test element/', (string)$result); $Controller->view = null; $Controller = new TestController($request, new CakeResponse()); @@ -688,7 +688,7 @@ public function testComponentBeforeRenderChangingViewClass() { $Controller->viewPath = 'Posts'; $Controller->theme = 'TestTheme'; $result = $Controller->render('index'); - $this->assertRegExp('/default test_theme layout/', (string)$result); + $this->assertMatchesRegularExpression('/default test_theme layout/', (string)$result); App::build(); } diff --git a/lib/Cake/Test/Case/Controller/PagesControllerTest.php b/lib/Cake/Test/Case/Controller/PagesControllerTest.php index 013ab3b..edc38df 100644 --- a/lib/Cake/Test/Case/Controller/PagesControllerTest.php +++ b/lib/Cake/Test/Case/Controller/PagesControllerTest.php @@ -40,12 +40,12 @@ public function testDisplay() { $Pages->viewPath = 'Posts'; $Pages->display('index'); - $this->assertRegExp('/posts index/', $Pages->response->body()); + $this->assertMatchesRegularExpression('/posts index/', $Pages->response->body()); $this->assertEquals('index', $Pages->viewVars['page']); $Pages->viewPath = 'Themed'; $Pages->display('TestTheme', 'Posts', 'index'); - $this->assertRegExp('/posts index themed view/', $Pages->response->body()); + $this->assertMatchesRegularExpression('/posts index themed view/', $Pages->response->body()); $this->assertEquals('TestTheme', $Pages->viewVars['page']); $this->assertEquals('Posts', $Pages->viewVars['subpage']); } diff --git a/lib/Cake/Test/Case/Controller/ScaffoldTest.php b/lib/Cake/Test/Case/Controller/ScaffoldTest.php index 57db334..c88b607 100644 --- a/lib/Cake/Test/Case/Controller/ScaffoldTest.php +++ b/lib/Cake/Test/Case/Controller/ScaffoldTest.php @@ -303,7 +303,7 @@ public function testScaffoldFlashMessages() { new Scaffold($this->Controller, $this->Controller->request); $this->Controller->response->send(); $result = ob_get_clean(); - $this->assertRegExp('/Scaffold Mock has been updated/', $result); + $this->assertMatchesRegularExpression('/Scaffold Mock has been updated/', $result); } /** @@ -336,7 +336,7 @@ public function testHabtmFieldAdditionWithScaffoldForm() { $Scaffold = new Scaffold($this->Controller, $this->Controller->request); $this->Controller->response->send(); $result = ob_get_clean(); - $this->assertRegExp('/name="data\[ScaffoldTag\]\[ScaffoldTag\]"/', $result); + $this->assertMatchesRegularExpression('/name="data\[ScaffoldTag\]\[ScaffoldTag\]"/', $result); $result = $Scaffold->controller->viewVars; $this->assertEquals(array('id', 'user_id', 'title', 'body', 'published', 'created', 'updated', 'ScaffoldTag'), $result['scaffoldFields']); @@ -376,7 +376,7 @@ public function testEditScaffoldWithScaffoldFields() { $this->Controller->response->send(); $result = ob_get_clean(); - $this->assertNotRegExp('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result); + $this->assertDoesNotMatchRegularExpression('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result); } /** @@ -413,6 +413,6 @@ public function testScaffoldError() { $this->Controller->response->send(); $result = ob_get_clean(); - $this->assertRegExp('/Scaffold Error/', $result); + $this->assertMatchesRegularExpression('/Scaffold Error/', $result); } } diff --git a/lib/Cake/Test/Case/Core/CakeObjectTest.php b/lib/Cake/Test/Case/Core/CakeObjectTest.php index 4a2317d..7d944ae 100644 --- a/lib/Cake/Test/Case/Core/CakeObjectTest.php +++ b/lib/Cake/Test/Case/Core/CakeObjectTest.php @@ -321,21 +321,21 @@ public function testLog() { $this->assertTrue($this->object->log('Test warning 1')); $this->assertTrue($this->object->log(array('Test' => 'warning 2'))); $result = file(LOGS . 'error.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Test warning 1$/', $result[0]); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Array$/', $result[1]); - $this->assertRegExp('/^\($/', $result[2]); - $this->assertRegExp('/\[Test\] => warning 2$/', $result[3]); - $this->assertRegExp('/^\)$/', $result[4]); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Test warning 1$/', $result[0]); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Array$/', $result[1]); + $this->assertMatchesRegularExpression('/^\($/', $result[2]); + $this->assertMatchesRegularExpression('/\[Test\] => warning 2$/', $result[3]); + $this->assertMatchesRegularExpression('/^\)$/', $result[4]); unlink(LOGS . 'error.log'); $this->assertTrue($this->object->log('Test warning 1', LOG_WARNING)); $this->assertTrue($this->object->log(array('Test' => 'warning 2'), LOG_WARNING)); $result = file(LOGS . 'error.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1$/', $result[0]); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Array$/', $result[1]); - $this->assertRegExp('/^\($/', $result[2]); - $this->assertRegExp('/\[Test\] => warning 2$/', $result[3]); - $this->assertRegExp('/^\)$/', $result[4]); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1$/', $result[0]); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Array$/', $result[1]); + $this->assertMatchesRegularExpression('/^\($/', $result[2]); + $this->assertMatchesRegularExpression('/\[Test\] => warning 2$/', $result[3]); + $this->assertMatchesRegularExpression('/^\)$/', $result[4]); unlink(LOGS . 'error.log'); } diff --git a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php index 9fc4f13..ba90a9d 100644 --- a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php +++ b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php @@ -99,9 +99,9 @@ public function testHandleErrorDebugOn() { $wrong .= ''; $result = ob_get_clean(); - $this->assertRegExp('/
/', $result);
-		$this->assertRegExp('/(Notice|Warning)<\/b>/', $result);
-		$this->assertRegExp('/variable\:?\s+\$?wrong/', $result);
+		$this->assertMatchesRegularExpression('/
/', $result);
+		$this->assertMatchesRegularExpression('/(Notice|Warning)<\/b>/', $result);
+		$this->assertMatchesRegularExpression('/variable\:?\s+\$?wrong/', $result);
 		restore_error_handler();
 	}
 
@@ -133,7 +133,7 @@ public function testErrorMapping($error, $expected) {
 		trigger_error('Test error', $error);
 
 		$result = ob_get_clean();
-		$this->assertRegExp('/' . $expected . '<\/b>/', $result);
+		$this->assertMatchesRegularExpression('/' . $expected . '<\/b>/', $result);
 		restore_error_handler();
 	}
 
@@ -181,7 +181,7 @@ public function testHandleErrorDebugOff() {
 		$result = file(LOGS . 'debug.log');
 		$this->assertIsArray($result);
 		$this->assertEquals(1, count($result));
-		$this->assertRegExp(
+		$this->assertMatchesRegularExpression(
 			'/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (Notice|Debug): Notice \(8\): Undefined variable:\s+out in \[.+ line \d+\]$/',
 			$result[0]
 		);
@@ -207,7 +207,7 @@ public function testHandleErrorDebugOffPHP8() {
 		$result = file(LOGS . 'error.log');
 		$this->assertIsArray($result);
 		$this->assertEquals(1, count($result));
-		$this->assertRegExp(
+		$this->assertMatchesRegularExpression(
 			'/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} Warning: Warning \(2\): Undefined variable \$out in \[.+ line \d+\]$/',
 			$result[0]
 		);
@@ -237,12 +237,12 @@ public function testHandleErrorLoggingTrace() {
 		$out .= '';
 
 		$result = file(LOGS . 'debug.log');
-		$this->assertRegExp(
+		$this->assertMatchesRegularExpression(
 			'/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (Notice|Debug): Notice \(8\): Undefined variable:\s+out in \[.+ line \d+\]$/',
 			$result[0]
 		);
-		$this->assertRegExp('/^Trace:/', $result[1]);
-		$this->assertRegExp('/^ErrorHandlerTest\:\:testHandleErrorLoggingTrace\(\)/', $result[3]);
+		$this->assertMatchesRegularExpression('/^Trace:/', $result[1]);
+		$this->assertMatchesRegularExpression('/^ErrorHandlerTest\:\:testHandleErrorLoggingTrace\(\)/', $result[3]);
 		if (file_exists(LOGS . 'debug.log')) {
 			unlink(LOGS . 'debug.log');
 		}
@@ -265,12 +265,12 @@ public function testHandleErrorLoggingTracePHP8() {
 
 		$result = file(LOGS . 'error.log');
 
-		$this->assertRegExp(
+		$this->assertMatchesRegularExpression(
 			'/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} Warning: Warning \(2\): Undefined variable \$out in \[.+ line \d+\]$/',
 			$result[0]
 		);
-		$this->assertRegExp('/^Trace:/', $result[1]);
-		$this->assertRegExp('/^ErrorHandlerTest\:\:testHandleErrorLoggingTracePHP8\(\)/', $result[3]);
+		$this->assertMatchesRegularExpression('/^Trace:/', $result[1]);
+		$this->assertMatchesRegularExpression('/^ErrorHandlerTest\:\:testHandleErrorLoggingTracePHP8\(\)/', $result[3]);
 		if (file_exists(LOGS . 'error.log')) {
 			unlink(LOGS . 'error.log');
 		}
@@ -287,7 +287,7 @@ public function testHandleException() {
 		ob_start();
 		ErrorHandler::handleException($error);
 		$result = ob_get_clean();
-		$this->assertRegExp('/Kaboom!/', $result, 'message missing.');
+		$this->assertMatchesRegularExpression('/Kaboom!/', $result, 'message missing.');
 	}
 
 /**
@@ -305,7 +305,7 @@ public function testHandleExceptionLog() {
 		ob_start();
 		ErrorHandler::handleException($error);
 		$result = ob_get_clean();
-		$this->assertRegExp('/Kaboom!/', $result, 'message missing.');
+		$this->assertMatchesRegularExpression('/Kaboom!/', $result, 'message missing.');
 
 		$log = file(LOGS . 'error.log');
 		$this->assertStringContainsString('[NotFoundException] Kaboom!', $log[0], 'message missing.');
@@ -329,12 +329,12 @@ public function testHandleExceptionLogSkipping() {
 		ob_start();
 		ErrorHandler::handleException($notFound);
 		$result = ob_get_clean();
-		$this->assertRegExp('/Kaboom!/', $result, 'message missing.');
+		$this->assertMatchesRegularExpression('/Kaboom!/', $result, 'message missing.');
 
 		ob_start();
 		ErrorHandler::handleException($forbidden);
 		$result = ob_get_clean();
-		$this->assertRegExp('/Fooled you!/', $result, 'message missing.');
+		$this->assertMatchesRegularExpression('/Fooled you!/', $result, 'message missing.');
 
 		$log = file(LOGS . 'error.log');
 		$this->assertStringNotContainsString('[NotFoundException] Kaboom!', $log[0], 'message should not be logged.');
diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
index 3b0f835..cd04979 100644
--- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
+++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -237,7 +237,7 @@ public function testSubclassConvertingFrameworkErrors() {
 		$ExceptionRenderer->render();
 		$result = ob_get_clean();
 
-		$this->assertRegExp('/Not Found/', $result, 'Method declared in error handler not converted to error400. %s');
+		$this->assertMatchesRegularExpression('/Not Found/', $result, 'Method declared in error handler not converted to error400. %s');
 	}
 
 /**
@@ -405,8 +405,8 @@ public function testError400() {
 		$ExceptionRenderer->render();
 		$result = ob_get_clean();
 
-		$this->assertRegExp('/

Custom message<\/h2>/', $result); - $this->assertRegExp("/'.*?\/posts\/view\/1000'<\/strong>/", $result); + $this->assertMatchesRegularExpression('/

Custom message<\/h2>/', $result); + $this->assertMatchesRegularExpression("/'.*?\/posts\/view\/1000'<\/strong>/", $result); } /** @@ -452,8 +452,8 @@ public function testError400NoInjection() { $ExceptionRenderer->render(); $result = ob_get_clean(); - $this->assertNotRegExp('##', $result); + $this->assertDoesNotMatchRegularExpression('##', $result); } /** @@ -471,7 +471,7 @@ public function testError500Message() { $ExceptionRenderer->render(); $result = ob_get_clean(); - $this->assertRegExp('/

An Internal Error Has Occurred<\/h2>/', $result); + $this->assertMatchesRegularExpression('/

An Internal Error Has Occurred<\/h2>/', $result); } /** @@ -508,8 +508,8 @@ public function testMissingController() { $ExceptionRenderer->render(); $result = ob_get_clean(); - $this->assertRegExp('/

Missing Controller<\/h2>/', $result); - $this->assertRegExp('/PostsController<\/em>/', $result); + $this->assertMatchesRegularExpression('/

Missing Controller<\/h2>/', $result); + $this->assertMatchesRegularExpression('/PostsController<\/em>/', $result); } /** @@ -672,7 +672,7 @@ public function testCakeExceptionHandling($exception, $patterns, $code) { $result = ob_get_clean(); foreach ($patterns as $pattern) { - $this->assertRegExp($pattern, $result); + $this->assertMatchesRegularExpression($pattern, $result); } } diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index f7fbbfd..d5a2165 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -160,7 +160,7 @@ public function testConfig() { $this->assertTrue(file_exists(LOGS . 'error.log')); $result = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning/', $result); unlink(LOGS . 'error.log'); } @@ -203,8 +203,8 @@ public function testLogFileWriting() { CakeLog::write(LOG_WARNING, 'Test warning 1'); CakeLog::write(LOG_WARNING, 'Test warning 2'); $result = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1/', $result); - $this->assertRegExp('/2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 2$/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1/', $result); + $this->assertMatchesRegularExpression('/2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 2$/', $result); unlink(LOGS . 'error.log'); } @@ -607,14 +607,14 @@ public function testConvenienceMethods() { $testMessage = 'emergency message'; CakeLog::emergency($testMessage); $contents = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/(Emergency|Critical): ' . $testMessage . '/', $contents); + $this->assertMatchesRegularExpression('/(Emergency|Critical): ' . $testMessage . '/', $contents); $this->assertFalse(file_exists(LOGS . 'debug.log')); $this->_deleteLogs(); $testMessage = 'alert message'; CakeLog::alert($testMessage); $contents = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/(Alert|Critical): ' . $testMessage . '/', $contents); + $this->assertMatchesRegularExpression('/(Alert|Critical): ' . $testMessage . '/', $contents); $this->assertFalse(file_exists(LOGS . 'debug.log')); $this->_deleteLogs(); @@ -642,14 +642,14 @@ public function testConvenienceMethods() { $testMessage = 'notice message'; CakeLog::notice($testMessage); $contents = file_get_contents(LOGS . 'debug.log'); - $this->assertRegExp('/(Notice|Debug): ' . $testMessage . '/', $contents); + $this->assertMatchesRegularExpression('/(Notice|Debug): ' . $testMessage . '/', $contents); $this->assertFalse(file_exists(LOGS . 'error.log')); $this->_deleteLogs(); $testMessage = 'info message'; CakeLog::info($testMessage); $contents = file_get_contents(LOGS . 'debug.log'); - $this->assertRegExp('/(Info|Debug): ' . $testMessage . '/', $contents); + $this->assertMatchesRegularExpression('/(Info|Debug): ' . $testMessage . '/', $contents); $this->assertFalse(file_exists(LOGS . 'error.log')); $this->_deleteLogs(); diff --git a/lib/Cake/Test/Case/Log/Engine/FileLogTest.php b/lib/Cake/Test/Case/Log/Engine/FileLogTest.php index 56df657..30a4349 100644 --- a/lib/Cake/Test/Case/Log/Engine/FileLogTest.php +++ b/lib/Cake/Test/Case/Log/Engine/FileLogTest.php @@ -38,19 +38,19 @@ public function testLogFileWriting() { $this->assertTrue(file_exists(LOGS . 'error.log')); $result = file_get_contents(LOGS . 'error.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning/', $result); $log->write('debug', 'Test warning'); $this->assertTrue(file_exists(LOGS . 'debug.log')); $result = file_get_contents(LOGS . 'debug.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Debug: Test warning/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Debug: Test warning/', $result); $log->write('random', 'Test warning'); $this->assertTrue(file_exists(LOGS . 'random.log')); $result = file_get_contents(LOGS . 'random.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Random: Test warning/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Random: Test warning/', $result); } /** @@ -86,7 +86,7 @@ public function testRotation() { $this->assertTrue(file_exists($path . 'error.log')); $result = file_get_contents($path . 'error.log'); - $this->assertRegExp('/Warning: Test warning one/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning one/', $result); $this->assertEquals(0, count(glob($path . 'error.log.*'))); clearstatcache(); @@ -96,24 +96,24 @@ public function testRotation() { $this->assertEquals(1, count($files)); $result = file_get_contents($files[0]); - $this->assertRegExp('/this text is under 35 bytes/', $result); - $this->assertRegExp('/Warning: Test warning one/', $result); + $this->assertMatchesRegularExpression('/this text is under 35 bytes/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning one/', $result); sleep(1); clearstatcache(); $log->write('warning', 'Test warning third'); $result = file_get_contents($path . 'error.log'); - $this->assertRegExp('/Warning: Test warning third/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning third/', $result); $files = glob($path . 'error.log.*'); $this->assertEquals(2, count($files)); $result = file_get_contents($files[0]); - $this->assertRegExp('/this text is under 35 bytes/', $result); + $this->assertMatchesRegularExpression('/this text is under 35 bytes/', $result); $result = file_get_contents($files[1]); - $this->assertRegExp('/Warning: Test warning second/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning second/', $result); file_put_contents($path . 'error.log.0000000000', "The oldest log file with over 35 bytes.\n"); @@ -126,13 +126,13 @@ public function testRotation() { $this->assertEquals(2, count($files)); $result = file_get_contents($path . 'error.log'); - $this->assertRegExp('/Warning: Test warning fourth/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning fourth/', $result); $result = file_get_contents(array_pop($files)); - $this->assertRegExp('/Warning: Test warning third/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning third/', $result); $result = file_get_contents(array_pop($files)); - $this->assertRegExp('/Warning: Test warning second/', $result); + $this->assertMatchesRegularExpression('/Warning: Test warning second/', $result); file_put_contents($path . 'debug.log', "this text is just greater than 35 bytes\n"); $log = new FileLog(array( @@ -145,7 +145,7 @@ public function testRotation() { $this->assertTrue(file_exists($path . 'debug.log')); $result = file_get_contents($path . 'debug.log'); - $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Debug: Test debug/', $result); + $this->assertMatchesRegularExpression('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Debug: Test debug/', $result); $this->assertFalse(strstr($result, 'greater than 5 bytes')); $this->assertEquals(0, count(glob($path . 'debug.log.*'))); } diff --git a/lib/Cake/Test/Case/Model/CakeSchemaTest.php b/lib/Cake/Test/Case/Model/CakeSchemaTest.php index 102e178..bf38c69 100644 --- a/lib/Cake/Test/Case/Model/CakeSchemaTest.php +++ b/lib/Cake/Test/Case/Model/CakeSchemaTest.php @@ -737,7 +737,7 @@ public function testGenerateTable() { 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => true)), ); $result = $this->Schema->generateTable('posts', $posts); - $this->assertRegExp('/public \$posts/', $result); + $this->assertMatchesRegularExpression('/public \$posts/', $result); $posts = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), @@ -753,8 +753,8 @@ public function testGenerateTable() { ) ); $result = $this->Schema->generateTable('fields', $posts); - $this->assertRegExp('/public \$fields/', $result); - $this->assertRegExp('/\'type\' \=\> \'fulltext\'/', $result); + $this->assertMatchesRegularExpression('/public \$fields/', $result); + $this->assertMatchesRegularExpression('/\'type\' \=\> \'fulltext\'/', $result); } /** @@ -1155,11 +1155,11 @@ public function testSchemaCreateTable() { $col = $Schema->tables['testdescribes']['int_null']; $col['name'] = 'int_null'; $column = $this->db->buildColumn($col); - $this->assertRegExp('/' . preg_quote($column, '/') . '/', $sql); + $this->assertMatchesRegularExpression('/' . preg_quote($column, '/') . '/', $sql); $col = $Schema->tables['testdescribes']['int_not_null']; $col['name'] = 'int_not_null'; $column = $this->db->buildColumn($col); - $this->assertRegExp('/' . preg_quote($column, '/') . '/', $sql); + $this->assertMatchesRegularExpression('/' . preg_quote($column, '/') . '/', $sql); } } diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 6591e02..056614a 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -1211,7 +1211,7 @@ public function testGenerateAssociationQuerySelfJoin() { } $query = $this->Dbo->buildAssociationQuery($this->Model->Category2, $queryData); - $this->assertRegExp('/^SELECT\s+(.+)FROM(.+)`Category2`\.`group_id`\s+=\s+`Group`\.`id`\)\s+LEFT JOIN(.+)WHERE\s+1 = 1\s*$/', $query); + $this->assertMatchesRegularExpression('/^SELECT\s+(.+)FROM(.+)`Category2`\.`group_id`\s+=\s+`Group`\.`id`\)\s+LEFT JOIN(.+)WHERE\s+1 = 1\s*$/', $query); $this->Model = new TestModel4(); $this->Model->schema(); @@ -1258,10 +1258,10 @@ public function testGenerateAssociationQuerySelfJoin() { $this->assertEquals($expected, $queryData); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel4Parent`\.`id`, `TestModel4Parent`\.`name`, `TestModel4Parent`\.`created`, `TestModel4Parent`\.`updated`\s+/', $result); - $this->assertRegExp('/FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4Parent`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+1 = 1$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel4Parent`\.`id`, `TestModel4Parent`\.`name`, `TestModel4Parent`\.`created`, `TestModel4Parent`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4Parent`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+1 = 1$/', $result); $params['assocData']['type'] = 'INNER'; $this->Model->belongsTo['TestModel4Parent']['type'] = 'INNER'; @@ -1421,10 +1421,10 @@ public function testGenerateAssociationQuerySelfJoinWithConditionsInHasOneBindin $this->assertTrue($result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel8`\.`id`, `TestModel8`\.`test_model9_id`, `TestModel8`\.`name`, `TestModel8`\.`created`, `TestModel8`\.`updated`, `TestModel9`\.`id`, `TestModel9`\.`test_model8_id`, `TestModel9`\.`name`, `TestModel9`\.`created`, `TestModel9`\.`updated`\s+/', $result); - $this->assertRegExp('/FROM\s+\S+`test_model8` AS `TestModel8`\s+LEFT JOIN\s+\S+`test_model9` AS `TestModel9`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel9`\.`name` != \'mariano\'\s+AND\s+`TestModel9`.`test_model8_id` = `TestModel8`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel8`\.`id`, `TestModel8`\.`test_model9_id`, `TestModel8`\.`name`, `TestModel8`\.`created`, `TestModel8`\.`updated`, `TestModel9`\.`id`, `TestModel9`\.`test_model8_id`, `TestModel9`\.`name`, `TestModel9`\.`created`, `TestModel9`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/FROM\s+\S+`test_model8` AS `TestModel8`\s+LEFT JOIN\s+\S+`test_model9` AS `TestModel9`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel9`\.`name` != \'mariano\'\s+AND\s+`TestModel9`.`test_model8_id` = `TestModel8`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); } /** @@ -1445,10 +1445,10 @@ public function testGenerateAssociationQuerySelfJoinWithConditionsInBelongsToBin $this->assertTrue($result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel9`\.`id`, `TestModel9`\.`test_model8_id`, `TestModel9`\.`name`, `TestModel9`\.`created`, `TestModel9`\.`updated`, `TestModel8`\.`id`, `TestModel8`\.`test_model9_id`, `TestModel8`\.`name`, `TestModel8`\.`created`, `TestModel8`\.`updated`\s+/', $result); - $this->assertRegExp('/FROM\s+\S+`test_model9` AS `TestModel9`\s+LEFT JOIN\s+\S+`test_model8` AS `TestModel8`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel8`\.`name` != \'larry\'\s+AND\s+`TestModel9`.`test_model8_id` = `TestModel8`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel9`\.`id`, `TestModel9`\.`test_model8_id`, `TestModel9`\.`name`, `TestModel9`\.`created`, `TestModel9`\.`updated`, `TestModel8`\.`id`, `TestModel8`\.`test_model9_id`, `TestModel8`\.`name`, `TestModel8`\.`created`, `TestModel8`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/FROM\s+\S+`test_model9` AS `TestModel9`\s+LEFT JOIN\s+\S+`test_model8` AS `TestModel8`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel8`\.`name` != \'larry\'\s+AND\s+`TestModel9`.`test_model8_id` = `TestModel8`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); } /** @@ -1470,10 +1470,10 @@ public function testGenerateAssociationQuerySelfJoinWithConditions() { $this->assertTrue($result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel4Parent`\.`id`, `TestModel4Parent`\.`name`, `TestModel4Parent`\.`created`, `TestModel4Parent`\.`updated`\s+/', $result); - $this->assertRegExp('/FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4Parent`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?`TestModel4Parent`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel4Parent`\.`id`, `TestModel4Parent`\.`name`, `TestModel4Parent`\.`created`, `TestModel4Parent`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4Parent`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?`TestModel4Parent`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); $this->Featured2 = new Featured2(); $this->Featured2->schema(); @@ -1498,7 +1498,7 @@ public function testGenerateAssociationQuerySelfJoinWithConditions() { $this->assertTrue($result); $result = $this->Dbo->buildAssociationQuery($this->Featured2, $queryData); - $this->assertRegExp( + $this->assertMatchesRegularExpression( '/^SELECT\s+`Featured2`\.`id`, `Featured2`\.`article_id`, `Featured2`\.`category_id`, `Featured2`\.`name`,\s+' . '`ArticleFeatured2`\.`id`, `ArticleFeatured2`\.`title`, `ArticleFeatured2`\.`user_id`, `ArticleFeatured2`\.`published`\s+' . 'FROM\s+\S+`featured2` AS `Featured2`\s+LEFT JOIN\s+\S+`article_featured` AS `ArticleFeatured2`' . @@ -1533,10 +1533,10 @@ public function testGenerateAssociationQueryHasOne() { $this->assertEquals(trim($expected), trim($result)); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+/', $result); - $this->assertRegExp('/`test_model5` AS `TestModel5`\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+/', $result); + $this->assertMatchesRegularExpression('/`test_model5` AS `TestModel5`\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); } /** @@ -1560,10 +1560,10 @@ public function testGenerateAssociationQueryHasOneWithConditions() { $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model5` AS `TestModel5`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel5`.`test_model4_id`\s+=\s+`TestModel4`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?\s*`TestModel5`.`name`\s+!=\s+\'mariano\'\s*(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model5` AS `TestModel5`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel5`.`test_model4_id`\s+=\s+`TestModel4`.`id`\)\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?\s*`TestModel5`.`name`\s+!=\s+\'mariano\'\s*(?:\))?\s*$/', $result); } /** @@ -1590,10 +1590,10 @@ public function testGenerateAssociationQueryBelongsTo() { $this->assertEquals(trim($expected), trim($result)); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`, `TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`, `TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); } /** @@ -1620,10 +1620,10 @@ public function testGenerateAssociationQueryBelongsToWithConditions() { $this->assertEquals(trim($expected), trim($result)); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`, `TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+`TestModel5`.`name` != \'mariano\'\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`, `TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel5`.`test_model4_id` = `TestModel4`.`id`\)\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+`TestModel5`.`name` != \'mariano\'\s*$/', $result); } /** @@ -1643,14 +1643,14 @@ public function testGenerateAssociationQueryHasMany() { $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+`TestModel6`.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+`TestModel6`.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?\s*1 = 1\s*(?:\))?\s*$/', $result); } /** @@ -1671,7 +1671,7 @@ public function testGenerateAssociationQueryHasManyWithLimit() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp( + $this->assertMatchesRegularExpression( '/^SELECT\s+' . '`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+' . 'FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+' . @@ -1681,7 +1681,7 @@ public function testGenerateAssociationQueryHasManyWithLimit() { ); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp( + $this->assertMatchesRegularExpression( '/^SELECT\s+' . '`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+' . 'FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+' . @@ -1706,14 +1706,14 @@ public function testGenerateAssociationQueryHasManyWithConditions() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?`TestModel5`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?`TestModel5`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); } /** @@ -1738,15 +1738,15 @@ public function testGenerateAssociationQueryHasManyWithOffsetAndLimit() { $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); - $this->assertRegExp('/\s+LIMIT 2,\s*5\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/\s+LIMIT 2,\s*5\s*$/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $this->Model->hasMany['TestModel6'] = $backup; } @@ -1771,15 +1771,15 @@ public function testGenerateAssociationQueryHasManyWithPageAndLimit() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); - $this->assertRegExp('/\s+LIMIT 5,\s*5\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/\s+LIMIT 5,\s*5\s*$/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $this->Model->hasMany['TestModel6'] = $backup; } @@ -1800,14 +1800,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`name`, `TestModel5`\.`id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`name`, `TestModel5`\.`id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $binding = array('type' => 'hasMany', 'model' => 'TestModel6'); $queryData = array('fields' => array('`TestModel5`.`id`, `TestModel5`.`name`')); @@ -1815,14 +1815,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $binding = array('type' => 'hasMany', 'model' => 'TestModel6'); $queryData = array('fields' => array('`TestModel5`.`name`', '`TestModel5`.`created`')); @@ -1830,14 +1830,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`test_model5_id`, `TestModel6`\.`name`, `TestModel6`\.`created`, `TestModel6`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $this->Model->hasMany['TestModel6']['fields'] = array('name'); @@ -1847,14 +1847,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`name`, `TestModel6`\.`test_model5_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`name`, `TestModel6`\.`test_model5_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); unset($this->Model->hasMany['TestModel6']['fields']); @@ -1866,14 +1866,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`name`, `TestModel6`\.`test_model5_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`id`, `TestModel6`\.`name`, `TestModel6`\.`test_model5_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); unset($this->Model->hasMany['TestModel6']['fields']); @@ -1885,14 +1885,14 @@ public function testGenerateAssociationQueryHasManyWithFields() { $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel6`\.`test_model5_id`, `TestModel6`\.`name`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel6`\.`test_model5_id`, `TestModel6`\.`name`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+=\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`name`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); unset($this->Model->hasMany['TestModel6']['fields']); } @@ -1913,7 +1913,7 @@ public function testGenerateAssociationQueryHasManyAndAggregateFunction() { $this->Model->recursive = 0; $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+MIN\(`TestModel5`\.`test_model4_id`\)\s+FROM/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+MIN\(`TestModel5`\.`test_model4_id`\)\s+FROM/', $result); } /** @@ -1933,16 +1933,16 @@ public function testGenerateAssociationQueryHasAndBelongsToMany() { $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); $assocTable = $this->Dbo->fullTableName($this->Model->TestModel4TestModel7, true, true); - $this->assertRegExp('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model7` AS `TestModel7`\s+JOIN\s+' . $assocTable . '/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}\s+AND/', $result); - $this->assertRegExp('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)/', $result); - $this->assertRegExp('/WHERE\s+(?:\()?1 = 1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model7` AS `TestModel7`\s+JOIN\s+' . $assocTable . '/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}\s+AND/', $result); + $this->assertMatchesRegularExpression('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)/', $result); + $this->assertMatchesRegularExpression('/WHERE\s+(?:\()?1 = 1(?:\))?\s*$/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+(?:\()?1 = 1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE/', $result); + $this->assertMatchesRegularExpression('/\s+WHERE\s+(?:\()?1 = 1(?:\))?\s*$/', $result); } /** @@ -1961,14 +1961,14 @@ public function testGenerateAssociationQueryHasAndBelongsToManyWithConditions() $params = $this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}/', $result); - $this->assertRegExp('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}/', $result); + $this->assertMatchesRegularExpression('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?`TestModel4`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?`TestModel4`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); } /** @@ -1992,15 +1992,15 @@ public function testGenerateAssociationQueryHasAndBelongsToManyWithOffsetAndLimi $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}\s+/', $result); - $this->assertRegExp('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 2,\s*5\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}\s+/', $result); + $this->assertMatchesRegularExpression('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 2,\s*5\s*$/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $this->Model->hasAndBelongsToMany['TestModel7'] = $backup; } @@ -2026,15 +2026,15 @@ public function testGenerateAssociationQueryHasAndBelongsToManyWithPageAndLimit( $params = &$this->_prepareAssociationQuery($this->Model, $queryData, $binding); $result = $this->Dbo->generateAssociationQuery($this->Model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external']); - $this->assertRegExp('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); - $this->assertRegExp('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}/', $result); - $this->assertRegExp('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); - $this->assertRegExp('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 5,\s*5\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`, `TestModel4TestModel7`\.`test_model4_id`, `TestModel4TestModel7`\.`test_model7_id`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model7`\s+AS\s+`TestModel7`\s+JOIN\s+\S+`test_model4_test_model7`\s+AS\s+`TestModel4TestModel7`/', $result); + $this->assertMatchesRegularExpression('/\s+ON\s+\(`TestModel4TestModel7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}/', $result); + $this->assertMatchesRegularExpression('/\s+AND\s+`TestModel4TestModel7`\.`test_model7_id`\s+=\s+`TestModel7`\.`id`\)\s+WHERE\s+/', $result); + $this->assertMatchesRegularExpression('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 5,\s*5\s*$/', $result); $result = $this->Dbo->buildAssociationQuery($this->Model, $queryData); - $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); - $this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); + $this->assertMatchesRegularExpression('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); + $this->assertMatchesRegularExpression('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); $this->Model->hasAndBelongsToMany['TestModel7'] = $backup; } @@ -2105,7 +2105,7 @@ public function testStringConditionsParsing() { $result = $this->Dbo->conditions('Sportstaette.sportstaette LIKE "%ru%" AND Sportstaette.sportstaettenart_id = 2'); $expected = ' WHERE `Sportstaette`.`sportstaette` LIKE "%ru%" AND `Sportstaette`.`sportstaettenart_id` = 2'; - $this->assertRegExp('/\s*WHERE\s+`Sportstaette`\.`sportstaette`\s+LIKE\s+"%ru%"\s+AND\s+`Sports/', $result); + $this->assertMatchesRegularExpression('/\s*WHERE\s+`Sportstaette`\.`sportstaette`\s+LIKE\s+"%ru%"\s+AND\s+`Sports/', $result); $this->assertEquals($expected, $result); $result = $this->Dbo->conditions('Sportstaette.sportstaettenart_id = 2 AND Sportstaette.sportstaette LIKE "%ru%"'); @@ -2223,46 +2223,46 @@ public function testHypenInStringConditionsAndFieldNames() { */ public function testParenthesisInStringConditions() { $result = $this->Dbo->conditions('Member.name = \'(lu\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(lu\'$/', $result); $result = $this->Dbo->conditions('Member.name = \')lu\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\)lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\)lu\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'va(lu\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'va)lu\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\)lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\)lu\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'va(lu)\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'va(lu)e\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)e\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)e\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano)\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano)iglesias\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)iglesias\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano) iglesias\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\) iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\) iglesias\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano word) iglesias\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano word\) iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano word\) iglesias\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano.iglesias)\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\)\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'Mariano Iglesias (mariano.iglesias)\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'Mariano Iglesias (mariano.iglesias) CakePHP\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\) CakePHP\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\) CakePHP\'$/', $result); $result = $this->Dbo->conditions('Member.name = \'(mariano.iglesias) CakePHP\''); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\) CakePHP\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\) CakePHP\'$/', $result); } /** @@ -2272,46 +2272,46 @@ public function testParenthesisInStringConditions() { */ public function testParenthesisInArrayConditions() { $result = $this->Dbo->conditions(array('Member.name' => '(lu')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(lu\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => ')lu')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\)lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\)lu\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'va(lu')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'va)lu')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\)lu\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\)lu\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'va(lu)')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'va(lu)e')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)e\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'va\(lu\)e\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano)')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano)iglesias')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\)iglesias\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano) iglesias')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\) iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano\) iglesias\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano word) iglesias')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano word\) iglesias\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano word\) iglesias\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano.iglesias)')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\)\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'Mariano Iglesias (mariano.iglesias)')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\)\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => 'Mariano Iglesias (mariano.iglesias) CakePHP')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\) CakePHP\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'Mariano Iglesias \(mariano.iglesias\) CakePHP\'$/', $result); $result = $this->Dbo->conditions(array('Member.name' => '(mariano.iglesias) CakePHP')); - $this->assertRegExp('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\) CakePHP\'$/', $result); + $this->assertMatchesRegularExpression('/^\s+WHERE\s+`Member`.`name`\s+=\s+\'\(mariano.iglesias\) CakePHP\'$/', $result); } /** @@ -2322,10 +2322,10 @@ public function testParenthesisInArrayConditions() { public function testArrayConditionsParsing() { $this->loadFixtures('Post', 'Author'); $result = $this->Dbo->conditions(array('Stereo.type' => 'in dash speakers')); - $this->assertRegExp("/^\s+WHERE\s+`Stereo`.`type`\s+=\s+'in dash speakers'/", $result); + $this->assertMatchesRegularExpression("/^\s+WHERE\s+`Stereo`.`type`\s+=\s+'in dash speakers'/", $result); $result = $this->Dbo->conditions(array('Candy.name LIKE' => 'a', 'HardCandy.name LIKE' => 'c')); - $this->assertRegExp("/^\s+WHERE\s+`Candy`.`name` LIKE\s+'a'\s+AND\s+`HardCandy`.`name`\s+LIKE\s+'c'/", $result); + $this->assertMatchesRegularExpression("/^\s+WHERE\s+`Candy`.`name` LIKE\s+'a'\s+AND\s+`HardCandy`.`name`\s+LIKE\s+'c'/", $result); $result = $this->Dbo->conditions(array('HardCandy.name LIKE' => 'a', 'Candy.name LIKE' => 'c')); $expected = " WHERE `HardCandy`.`name` LIKE 'a' AND `Candy`.`name` LIKE 'c'"; @@ -2473,10 +2473,10 @@ public function testArrayConditionsParsing() { 'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912, 999)), 'Enrollment.yearcompleted >' => '0') ); - $this->assertRegExp('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS NULL\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(`level_of_education_id` IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS NULL\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(`level_of_education_id` IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result); $result = $this->Dbo->conditions(array('id <>' => '8')); - $this->assertRegExp('/^\s*WHERE\s+`id`\s+<>\s+\'8\'\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*WHERE\s+`id`\s+<>\s+\'8\'\s*$/', $result); $result = $this->Dbo->conditions(array('TestModel.field =' => 'gribe$@()lu')); $expected = " WHERE `TestModel`.`field` = 'gribe$@()lu'"; @@ -2649,7 +2649,7 @@ public function testMixedConditionsParsing() { '1=1 GROUP BY Thread.project_id' ); $result = $this->Dbo->conditions($conditions); - $this->assertRegExp('/^\s*WHERE\s+`Thread`.`project_id`\s*=\s*5\s+AND\s+`Thread`.`buyer_id`\s*=\s*14\s+AND\s+1\s*=\s*1\s+GROUP BY `Thread`.`project_id`$/', $result); + $this->assertMatchesRegularExpression('/^\s*WHERE\s+`Thread`.`project_id`\s*=\s*5\s+AND\s+`Thread`.`buyer_id`\s*=\s*14\s+AND\s+1\s*=\s*1\s+GROUP BY `Thread`.`project_id`$/', $result); } /** @@ -2659,10 +2659,10 @@ public function testMixedConditionsParsing() { */ public function testConditionsOptionalArguments() { $result = $this->Dbo->conditions(array('Member.name' => 'Mariano'), true, false); - $this->assertRegExp('/^\s*`Member`.`name`\s*=\s*\'Mariano\'\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*`Member`.`name`\s*=\s*\'Mariano\'\s*$/', $result); $result = $this->Dbo->conditions(array(), true, false); - $this->assertRegExp('/^\s*1\s*=\s*1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*1\s*=\s*1\s*$/', $result); } /** @@ -2849,19 +2849,19 @@ public function testRenderStatement() { 'fields' => 'id', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => '', 'joins' => '', 'order' => '', 'limit' => '', 'group' => '' )); - $this->assertRegExp('/^\s*SELECT\s+id\s+FROM\s+table\s+WHERE\s+1=1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*SELECT\s+id\s+FROM\s+table\s+WHERE\s+1=1\s*$/', $result); $result = $this->Dbo->renderStatement('update', array('fields' => 'value=2', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => '')); - $this->assertRegExp('/^\s*UPDATE\s+table\s+SET\s+value=2\s+WHERE\s+1=1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*UPDATE\s+table\s+SET\s+value=2\s+WHERE\s+1=1\s*$/', $result); $result = $this->Dbo->renderStatement('update', array('fields' => 'value=2', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => 'alias', 'joins' => '')); - $this->assertRegExp('/^\s*UPDATE\s+table\s+AS\s+alias\s+SET\s+value=2\s+WHERE\s+1=1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*UPDATE\s+table\s+AS\s+alias\s+SET\s+value=2\s+WHERE\s+1=1\s*$/', $result); $result = $this->Dbo->renderStatement('delete', array('fields' => 'value=2', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => '')); - $this->assertRegExp('/^\s*DELETE\s+FROM\s+table\s+WHERE\s+1=1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*DELETE\s+FROM\s+table\s+WHERE\s+1=1\s*$/', $result); $result = $this->Dbo->renderStatement('delete', array('fields' => 'value=2', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => 'alias', 'joins' => '')); - $this->assertRegExp('/^\s*DELETE\s+alias\s+FROM\s+table\s+AS\s+alias\s+WHERE\s+1=1\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*DELETE\s+alias\s+FROM\s+table\s+AS\s+alias\s+WHERE\s+1=1\s*$/', $result); } /** @@ -2877,7 +2877,7 @@ public function testSchema() { $this->assertTrue(empty($result)); $result = $this->Dbo->dropSchema($Schema, 'table'); - $this->assertRegExp('/^\s*DROP TABLE IF EXISTS\s+' . $this->Dbo->fullTableName('table') . ';\s*$/s', $result); + $this->assertMatchesRegularExpression('/^\s*DROP TABLE IF EXISTS\s+' . $this->Dbo->fullTableName('table') . ';\s*$/s', $result); } /** @@ -2907,56 +2907,56 @@ public function testOrderParsing() { $this->assertEquals($expected, $result); $result = $this->Dbo->order("title, id"); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); $result = $this->Dbo->order("title desc, id desc"); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+desc,\s+`id`\s+desc\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+desc,\s+`id`\s+desc\s*$/', $result); $result = $this->Dbo->order(array("title desc, id desc")); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+desc,\s+`id`\s+desc\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+desc,\s+`id`\s+desc\s*$/', $result); $result = $this->Dbo->order(array("title", "id")); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); $result = $this->Dbo->order(array(array('title'), array('id'))); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+ASC,\s+`id`\s+ASC\s*$/', $result); $result = $this->Dbo->order(array("Post.title" => 'asc', "Post.id" => 'desc')); - $this->assertRegExp('/^\s*ORDER BY\s+`Post`.`title`\s+asc,\s+`Post`.`id`\s+desc\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`Post`.`title`\s+asc,\s+`Post`.`id`\s+desc\s*$/', $result); $result = $this->Dbo->order(array(array("Post.title" => 'asc', "Post.id" => 'desc'))); - $this->assertRegExp('/^\s*ORDER BY\s+`Post`.`title`\s+asc,\s+`Post`.`id`\s+desc\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`Post`.`title`\s+asc,\s+`Post`.`id`\s+desc\s*$/', $result); $result = $this->Dbo->order(array("title")); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+ASC\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+ASC\s*$/', $result); $result = $this->Dbo->order(array(array("title"))); - $this->assertRegExp('/^\s*ORDER BY\s+`title`\s+ASC\s*$/', $result); + $this->assertMatchesRegularExpression('/^\s*ORDER BY\s+`title`\s+ASC\s*$/', $result); $result = $this->Dbo->order("Dealer.id = 7 desc, Dealer.id = 3 desc, Dealer.title asc"); $expected = " ORDER BY `Dealer`.`id` = 7 desc, `Dealer`.`id` = 3 desc, `Dealer`.`title` asc"; $this->assertEquals($expected, $result); $result = $this->Dbo->order(array("Page.name" => "='test' DESC")); - $this->assertRegExp("/^\s*ORDER BY\s+`Page`\.`name`\s*='test'\s+DESC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+`Page`\.`name`\s*='test'\s+DESC\s*$/", $result); $result = $this->Dbo->order("Page.name = 'view' DESC"); - $this->assertRegExp("/^\s*ORDER BY\s+`Page`\.`name`\s*=\s*'view'\s+DESC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+`Page`\.`name`\s*=\s*'view'\s+DESC\s*$/", $result); $result = $this->Dbo->order("(Post.views)"); - $this->assertRegExp("/^\s*ORDER BY\s+\(`Post`\.`views`\)\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+\(`Post`\.`views`\)\s+ASC\s*$/", $result); $result = $this->Dbo->order("(Post.views)*Post.views"); - $this->assertRegExp("/^\s*ORDER BY\s+\(`Post`\.`views`\)\*`Post`\.`views`\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+\(`Post`\.`views`\)\*`Post`\.`views`\s+ASC\s*$/", $result); $result = $this->Dbo->order("(Post.views) * Post.views"); - $this->assertRegExp("/^\s*ORDER BY\s+\(`Post`\.`views`\) \* `Post`\.`views`\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+\(`Post`\.`views`\) \* `Post`\.`views`\s+ASC\s*$/", $result); $result = $this->Dbo->order("(Model.field1 + Model.field2) * Model.field3"); - $this->assertRegExp("/^\s*ORDER BY\s+\(`Model`\.`field1` \+ `Model`\.`field2`\) \* `Model`\.`field3`\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+\(`Model`\.`field1` \+ `Model`\.`field2`\) \* `Model`\.`field3`\s+ASC\s*$/", $result); $result = $this->Dbo->order("Model.name+0 ASC"); - $this->assertRegExp("/^\s*ORDER BY\s+`Model`\.`name`\+0\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+`Model`\.`name`\+0\s+ASC\s*$/", $result); $result = $this->Dbo->order("Anuncio.destaque & 2 DESC"); $expected = ' ORDER BY `Anuncio`.`destaque` & 2 DESC'; @@ -2978,7 +2978,7 @@ public function testOrderParsing() { */ public function testComplexSortExpression() { $result = $this->Dbo->order(array('(Model.field > 100) DESC', 'Model.field ASC')); - $this->assertRegExp("/^\s*ORDER BY\s+\(`Model`\.`field`\s+>\s+100\)\s+DESC,\s+`Model`\.`field`\s+ASC\s*$/", $result); + $this->assertMatchesRegularExpression("/^\s*ORDER BY\s+\(`Model`\.`field`\s+>\s+100\)\s+DESC,\s+`Model`\.`field`\s+ASC\s*$/", $result); } /** @@ -3581,9 +3581,9 @@ public function testConditionsWithComplexVirtualFields() { $conditions = array('distance >=' => 20); $result = $this->Dbo->conditions($conditions, true, true, $Article); - $this->assertRegExp('/\) >= 20/', $result); - $this->assertRegExp('/[`\'"]Article[`\'"].[`\'"]latitude[`\'"]/', $result); - $this->assertRegExp('/[`\'"]Article[`\'"].[`\'"]longitude[`\'"]/', $result); + $this->assertMatchesRegularExpression('/\) >= 20/', $result); + $this->assertMatchesRegularExpression('/[`\'"]Article[`\'"].[`\'"]latitude[`\'"]/', $result); + $this->assertMatchesRegularExpression('/[`\'"]Article[`\'"].[`\'"]longitude[`\'"]/', $result); } /** @@ -3625,7 +3625,7 @@ public function testReadVirtualFieldsWithNewLines() { ); $result = $this->Dbo->fields($Article, null, array()); $result = $this->Dbo->fields($Article, $Article->alias, $result); - $this->assertRegExp('/[`\"]User[`\"]\.[`\"]id[`\"] \+ [`\"]User[`\"]\.[`\"]id[`\"]/', $result[7]); + $this->assertMatchesRegularExpression('/[`\"]User[`\"]\.[`\"]id[`\"] \+ [`\"]User[`\"]\.[`\"]id[`\"]/', $result[7]); } /** @@ -3667,9 +3667,9 @@ public function testFieldsWithComplexVirtualFields() { $qe = $this->Dbo->endQuote; $this->assertEquals("{$qs}Article{$qe}.{$qs}id{$qe}", $result[0]); - $this->assertRegExp('/Article__distance/', $result[1]); - $this->assertRegExp('/[`\'"]Article[`\'"].[`\'"]latitude[`\'"]/', $result[1]); - $this->assertRegExp('/[`\'"]Article[`\'"].[`\'"]longitude[`\'"]/', $result[1]); + $this->assertMatchesRegularExpression('/Article__distance/', $result[1]); + $this->assertMatchesRegularExpression('/[`\'"]Article[`\'"].[`\'"]latitude[`\'"]/', $result[1]); + $this->assertMatchesRegularExpression('/[`\'"]Article[`\'"].[`\'"]longitude[`\'"]/', $result[1]); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 2dcd6d0..ad8f766 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -530,7 +530,7 @@ public function testSchemaIndexSyntax() { )); $result = $this->Dbo->createSchema($schema); - $this->assertNotRegExp('/^CREATE INDEX(.+);,$/', $result); + $this->assertDoesNotMatchRegularExpression('/^CREATE INDEX(.+);,$/', $result); } /** @@ -566,8 +566,8 @@ public function testCakeSchema() { ); $result = $db1->createSchema($schema, 'datatype_tests'); - $this->assertNotRegExp('/timestamp DEFAULT/', $result); - $this->assertRegExp('/\"full_length\"\s*text\s.*,/', $result); + $this->assertDoesNotMatchRegularExpression('/timestamp DEFAULT/', $result); + $this->assertMatchesRegularExpression('/\"full_length\"\s*text\s.*,/', $result); $this->assertContains('timestamp ,', $result); $this->assertContains('"huge_int" bigint NOT NULL,', $result); @@ -709,7 +709,7 @@ public function testAlterSchema() { ) )); $result = $this->Dbo->alterSchema($New->compare($Old), 'alter_posts'); - $this->assertNotRegExp('/varchar\(36\) NOT NULL/i', $result); + $this->assertDoesNotMatchRegularExpression('/varchar\(36\) NOT NULL/i', $result); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php index 8cfef90..68c68f9 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php @@ -400,14 +400,14 @@ public function testDistinctWithLimit() { 'limit' => 5 )); $result = $this->db->getLastQuery(); - $this->assertRegExp('/^SELECT DISTINCT TOP 5/', $result); + $this->assertMatchesRegularExpression('/^SELECT DISTINCT TOP 5/', $result); $this->db->read($this->model, array( 'fields' => array('DISTINCT SqlserverTestModel.city', 'SqlserverTestModel.country'), 'limit' => '5' )); $result = $this->db->getLastQuery(); - $this->assertRegExp('/^SELECT DISTINCT TOP 5/', $result); + $this->assertMatchesRegularExpression('/^SELECT DISTINCT TOP 5/', $result); } /** @@ -645,9 +645,9 @@ public function testUpdateAllSyntax() { $this->db->update($this->model, $fields, null, $conditions); $result = $this->db->getLastQuery(); - $this->assertNotRegExp('/SqlserverTestModel/', $result); - $this->assertRegExp('/^UPDATE \[sqlserver_test_models\]/', $result); - $this->assertRegExp('/SET \[client_id\] = \[client_id\] \+ 1/', $result); + $this->assertDoesNotMatchRegularExpression('/SqlserverTestModel/', $result); + $this->assertMatchesRegularExpression('/^UPDATE \[sqlserver_test_models\]/', $result); + $this->assertMatchesRegularExpression('/SET \[client_id\] = \[client_id\] \+ 1/', $result); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index b22d6dc..cf83d2c 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -996,15 +996,15 @@ public function testLog() { $this->testDb->showLog(); $contents = ob_get_clean(); - $this->assertRegExp('/Query 1/s', $contents); - $this->assertRegExp('/Query 2/s', $contents); + $this->assertMatchesRegularExpression('/Query 1/s', $contents); + $this->assertMatchesRegularExpression('/Query 2/s', $contents); ob_start(); $this->testDb->showLog(true); $contents = ob_get_clean(); - $this->assertRegExp('/Query 1/s', $contents); - $this->assertRegExp('/Query 2/s', $contents); + $this->assertMatchesRegularExpression('/Query 1/s', $contents); + $this->assertMatchesRegularExpression('/Query 2/s', $contents); Configure::write('debug', $oldDebug); } diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index a9b4124..c7eda51 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -7351,7 +7351,7 @@ public function testFindCount() { $log = $this->db->getLog(); $this->assertTrue(isset($log['log'][0]['query'])); - $this->assertNotRegExp('/ORDER\s+BY/', $log['log'][0]['query']); + $this->assertDoesNotMatchRegularExpression('/ORDER\s+BY/', $log['log'][0]['query']); $Article = new Article(); $Article->order = null; diff --git a/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php b/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php index da621c1..e755795 100644 --- a/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php +++ b/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php @@ -121,7 +121,7 @@ public function testQop() { $auth = array('user' => 'admin', 'pass' => '1234'); DigestAuthentication::authentication($this->HttpSocket, $auth); $expected = '@Digest username="admin", realm="The batcave", nonce="4cded326c6c51", uri="/", response="[a-z0-9]{32}", qop="auth", nc=00000001, cnonce="[a-z0-9]+"@'; - $this->assertRegExp($expected, $this->HttpSocket->request['header']['Authorization']); + $this->assertMatchesRegularExpression($expected, $this->HttpSocket->request['header']['Authorization']); $this->assertEquals('auth', $auth['qop']); $this->assertEquals(2, $auth['nc']); } diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index 4fbe1f2..30c652f 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -635,7 +635,7 @@ public function testParseParamsWithSingleZero() { $this->assertSame($test['controller'], 'testcontroller'); $this->assertSame($test['action'], 'testaction'); $this->assertSame($test['pass'][0], '1'); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][1]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][1]); $this->assertSame($test['pass'][2], '23'); } @@ -651,12 +651,12 @@ public function testParseParamsWithManySingleZeros() { $event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $test)); $Dispatcher->parseParams($event); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][0]); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][1]); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][2]); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][3]); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][4]); - $this->assertRegExp('/\\A(?:0)\\z/', $test['pass'][5]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][0]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][1]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][2]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][3]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][4]); + $this->assertMatchesRegularExpression('/\\A(?:0)\\z/', $test['pass'][5]); } /** @@ -671,12 +671,12 @@ public function testParseParamsWithManyZerosInEachSectionOfUrl() { $event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $test)); $Dispatcher->parseParams($event); - $this->assertRegExp('/\\A(?:000)\\z/', $test['pass'][0]); - $this->assertRegExp('/\\A(?:0000)\\z/', $test['pass'][1]); - $this->assertRegExp('/\\A(?:00000)\\z/', $test['pass'][2]); - $this->assertRegExp('/\\A(?:000000)\\z/', $test['pass'][3]); - $this->assertRegExp('/\\A(?:000000)\\z/', $test['pass'][4]); - $this->assertRegExp('/\\A(?:0000000)\\z/', $test['pass'][5]); + $this->assertMatchesRegularExpression('/\\A(?:000)\\z/', $test['pass'][0]); + $this->assertMatchesRegularExpression('/\\A(?:0000)\\z/', $test['pass'][1]); + $this->assertMatchesRegularExpression('/\\A(?:00000)\\z/', $test['pass'][2]); + $this->assertMatchesRegularExpression('/\\A(?:000000)\\z/', $test['pass'][3]); + $this->assertMatchesRegularExpression('/\\A(?:000000)\\z/', $test['pass'][4]); + $this->assertMatchesRegularExpression('/\\A(?:0000000)\\z/', $test['pass'][5]); } /** @@ -691,12 +691,12 @@ public function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() { $event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $test)); $Dispatcher->parseParams($event); - $this->assertRegExp('/\\A(?:01)\\z/', $test['pass'][0]); - $this->assertRegExp('/\\A(?:0403)\\z/', $test['pass'][1]); - $this->assertRegExp('/\\A(?:04010)\\z/', $test['pass'][2]); - $this->assertRegExp('/\\A(?:000002)\\z/', $test['pass'][3]); - $this->assertRegExp('/\\A(?:000030)\\z/', $test['pass'][4]); - $this->assertRegExp('/\\A(?:0000400)\\z/', $test['pass'][5]); + $this->assertMatchesRegularExpression('/\\A(?:01)\\z/', $test['pass'][0]); + $this->assertMatchesRegularExpression('/\\A(?:0403)\\z/', $test['pass'][1]); + $this->assertMatchesRegularExpression('/\\A(?:04010)\\z/', $test['pass'][2]); + $this->assertMatchesRegularExpression('/\\A(?:000002)\\z/', $test['pass'][3]); + $this->assertMatchesRegularExpression('/\\A(?:000030)\\z/', $test['pass'][4]); + $this->assertMatchesRegularExpression('/\\A(?:0000400)\\z/', $test['pass'][5]); } /** @@ -718,8 +718,8 @@ public function testQueryStringOnRoot() { $event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $request)); $Dispatcher->parseParams($event); - $this->assertRegExp('/posts/', $request['controller']); - $this->assertRegExp('/home/', $request['action']); + $this->assertMatchesRegularExpression('/posts/', $request['controller']); + $this->assertMatchesRegularExpression('/home/', $request['action']); $this->assertTrue(isset($request['url']['sleep'])); $this->assertTrue(isset($request['url']['coffee'])); @@ -728,8 +728,8 @@ public function testQueryStringOnRoot() { $event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $request)); $Dispatcher->parseParams($event); - $this->assertRegExp('/pages/', $request['controller']); - $this->assertRegExp('/display/', $request['action']); + $this->assertMatchesRegularExpression('/pages/', $request['controller']); + $this->assertMatchesRegularExpression('/display/', $request['action']); $this->assertTrue(isset($request['url']['sleep'])); $this->assertTrue(isset($request['url']['coffee'])); $this->assertEquals('life', $request['url']['coffee']); diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index 5d61cce..b6cb2aa 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -65,26 +65,26 @@ public function testBasicRouteCompiling() { $route = new CakeRoute('/:controller/:action', array('controller' => 'posts')); $result = $route->compile(); - $this->assertRegExp($result, '/posts/edit'); - $this->assertRegExp($result, '/posts/super_delete'); - $this->assertNotRegExp($result, '/posts'); - $this->assertNotRegExp($result, '/posts/super_delete/1'); + $this->assertMatchesRegularExpression($result, '/posts/edit'); + $this->assertMatchesRegularExpression($result, '/posts/super_delete'); + $this->assertDoesNotMatchRegularExpression($result, '/posts'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/super_delete/1'); $route = new CakeRoute('/posts/foo:id', array('controller' => 'posts', 'action' => 'view')); $result = $route->compile(); - $this->assertRegExp($result, '/posts/foo:1'); - $this->assertRegExp($result, '/posts/foo:param'); - $this->assertNotRegExp($result, '/posts'); - $this->assertNotRegExp($result, '/posts/'); + $this->assertMatchesRegularExpression($result, '/posts/foo:1'); + $this->assertMatchesRegularExpression($result, '/posts/foo:param'); + $this->assertDoesNotMatchRegularExpression($result, '/posts'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/'); $this->assertEquals(array('id'), $route->keys); $route = new CakeRoute('/:plugin/:controller/:action/*', array('plugin' => 'test_plugin', 'action' => 'index')); $result = $route->compile(); - $this->assertRegExp($result, '/test_plugin/posts/index'); - $this->assertRegExp($result, '/test_plugin/posts/edit/5'); - $this->assertRegExp($result, '/test_plugin/posts/edit/5/name:value/nick:name'); + $this->assertMatchesRegularExpression($result, '/test_plugin/posts/index'); + $this->assertMatchesRegularExpression($result, '/test_plugin/posts/edit/5'); + $this->assertMatchesRegularExpression($result, '/test_plugin/posts/edit/5/name:value/nick:name'); } /** @@ -95,11 +95,11 @@ public function testBasicRouteCompiling() { public function testRouteParameterOverlap() { $route = new CakeRoute('/invoices/add/:idd/:id', array('controller' => 'invoices', 'action' => 'add')); $result = $route->compile(); - $this->assertRegExp($result, '/invoices/add/1/3'); + $this->assertMatchesRegularExpression($result, '/invoices/add/1/3'); $route = new CakeRoute('/invoices/add/:id/:idd', array('controller' => 'invoices', 'action' => 'add')); $result = $route->compile(); - $this->assertRegExp($result, '/invoices/add/1/3'); + $this->assertMatchesRegularExpression($result, '/invoices/add/1/3'); } /** @@ -114,10 +114,10 @@ public function testRouteCompilingWithParamPatterns() { array('id' => Router::ID) ); $result = $route->compile(); - $this->assertRegExp($result, '/posts/edit/1'); - $this->assertRegExp($result, '/posts/view/518098'); - $this->assertNotRegExp($result, '/posts/edit/name-of-post'); - $this->assertNotRegExp($result, '/posts/edit/4/other:param'); + $this->assertMatchesRegularExpression($result, '/posts/edit/1'); + $this->assertMatchesRegularExpression($result, '/posts/view/518098'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/edit/name-of-post'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/edit/4/other:param'); $this->assertEquals(array('id', 'controller', 'action'), $route->keys); $route = new CakeRoute( @@ -126,20 +126,20 @@ public function testRouteCompilingWithParamPatterns() { array('id' => Router::ID, 'lang' => '[a-z]{3}') ); $result = $route->compile(); - $this->assertRegExp($result, '/eng/posts/edit/1'); - $this->assertRegExp($result, '/cze/articles/view/1'); - $this->assertNotRegExp($result, '/language/articles/view/2'); - $this->assertNotRegExp($result, '/eng/articles/view/name-of-article'); + $this->assertMatchesRegularExpression($result, '/eng/posts/edit/1'); + $this->assertMatchesRegularExpression($result, '/cze/articles/view/1'); + $this->assertDoesNotMatchRegularExpression($result, '/language/articles/view/2'); + $this->assertDoesNotMatchRegularExpression($result, '/eng/articles/view/name-of-article'); $this->assertEquals(array('lang', 'id', 'controller', 'action'), $route->keys); foreach (array(':', '@', ';', '$', '-') as $delim) { $route = new CakeRoute('/posts/:id' . $delim . ':title'); $result = $route->compile(); - $this->assertRegExp($result, '/posts/1' . $delim . 'name-of-article'); - $this->assertRegExp($result, '/posts/13244' . $delim . 'name-of_Article[]'); - $this->assertNotRegExp($result, '/posts/11!nameofarticle'); - $this->assertNotRegExp($result, '/posts/11'); + $this->assertMatchesRegularExpression($result, '/posts/1' . $delim . 'name-of-article'); + $this->assertMatchesRegularExpression($result, '/posts/13244' . $delim . 'name-of_Article[]'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/11!nameofarticle'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/11'); $this->assertEquals(array('title', 'id'), $route->keys); } @@ -150,11 +150,11 @@ public function testRouteCompilingWithParamPatterns() { array('id' => Router::ID, 'year' => Router::YEAR, 'title' => '[a-z-_]+') ); $result = $route->compile(); - $this->assertRegExp($result, '/posts/1:name-of-article/2009/'); - $this->assertRegExp($result, '/posts/13244:name-of-article/1999'); - $this->assertNotRegExp($result, '/posts/hey_now:nameofarticle'); - $this->assertNotRegExp($result, '/posts/:nameofarticle/2009'); - $this->assertNotRegExp($result, '/posts/:nameofarticle/01'); + $this->assertMatchesRegularExpression($result, '/posts/1:name-of-article/2009/'); + $this->assertMatchesRegularExpression($result, '/posts/13244:name-of-article/1999'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/hey_now:nameofarticle'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/:nameofarticle/2009'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/:nameofarticle/01'); $this->assertEquals(array('year', 'title', 'id'), $route->keys); $route = new CakeRoute( @@ -163,11 +163,11 @@ public function testRouteCompilingWithParamPatterns() { array('pass' => array('id', 'url_title'), 'id' => Router::ID) ); $result = $route->compile(); - $this->assertRegExp($result, '/posts/some_title_for_article-(uuid:12534)/'); - $this->assertRegExp($result, '/posts/some_title_for_article-(uuid:12534)'); - $this->assertNotRegExp($result, '/posts/'); - $this->assertNotRegExp($result, '/posts/nameofarticle'); - $this->assertNotRegExp($result, '/posts/nameofarticle-12347'); + $this->assertMatchesRegularExpression($result, '/posts/some_title_for_article-(uuid:12534)/'); + $this->assertMatchesRegularExpression($result, '/posts/some_title_for_article-(uuid:12534)'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/nameofarticle'); + $this->assertDoesNotMatchRegularExpression($result, '/posts/nameofarticle-12347'); $this->assertEquals(array('url_title', 'id'), $route->keys); } @@ -184,7 +184,7 @@ public function testComplexRouteCompilingAndParsing() { array('year' => Router::YEAR, 'month' => Router::MONTH, 'day' => Router::DAY) ); $result = $route->compile(); - $this->assertRegExp($result, '/posts/08/01/2007/title-of-post'); + $this->assertMatchesRegularExpression($result, '/posts/08/01/2007/title-of-post'); $result = $route->parse('/posts/08/01/2007/title-of-post'); $this->assertEquals(7, count($result)); @@ -202,8 +202,8 @@ public function testComplexRouteCompilingAndParsing() { ); $result = $route->compile(); - $this->assertRegExp($result, '/some_extra/page/this_is_the_slug'); - $this->assertRegExp($result, '/page/this_is_the_slug'); + $this->assertMatchesRegularExpression($result, '/some_extra/page/this_is_the_slug'); + $this->assertMatchesRegularExpression($result, '/page/this_is_the_slug'); $this->assertEquals(array('slug', 'extra'), $route->keys); $this->assertEquals(array('extra' => '[a-z1-9_]*', 'slug' => '[a-z1-9_]+', 'action' => 'view'), $route->options); $expected = array( @@ -223,11 +223,11 @@ public function testComplexRouteCompilingAndParsing() { $this->assertFalse($route->parse('/chaw_test/wiki')); $result = $route->compile(); - $this->assertNotRegExp($result, '/some_project/source'); - $this->assertRegExp($result, '/source/view'); - $this->assertRegExp($result, '/source/view/other/params'); - $this->assertNotRegExp($result, '/chaw_test/wiki'); - $this->assertNotRegExp($result, '/source/wierd_action'); + $this->assertDoesNotMatchRegularExpression($result, '/some_project/source'); + $this->assertMatchesRegularExpression($result, '/source/view'); + $this->assertMatchesRegularExpression($result, '/source/view/other/params'); + $this->assertDoesNotMatchRegularExpression($result, '/chaw_test/wiki'); + $this->assertDoesNotMatchRegularExpression($result, '/source/wierd_action'); } /** diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index d9ffb3b..36c3f62 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -58,9 +58,9 @@ public function tearDown(): void { * @return void */ public function testFullBaseUrl() { - $this->assertRegExp('/^http(s)?:\/\//', Router::url('/', true)); - $this->assertRegExp('/^http(s)?:\/\//', Router::url(null, true)); - $this->assertRegExp('/^http(s)?:\/\//', Router::url(array('full_base' => true))); + $this->assertMatchesRegularExpression('/^http(s)?:\/\//', Router::url('/', true)); + $this->assertMatchesRegularExpression('/^http(s)?:\/\//', Router::url(null, true)); + $this->assertMatchesRegularExpression('/^http(s)?:\/\//', Router::url(array('full_base' => true))); $this->assertSame(FULL_BASE_URL . '/', Router::url(array('full_base' => true))); } @@ -2551,7 +2551,7 @@ public function testReverseFull() { 'url' => array('url' => 'eng/posts/view/1'), ); $result = Router::reverse($params, true); - $this->assertRegExp('/^http(s)?:\/\//', $result); + $this->assertMatchesRegularExpression('/^http(s)?:\/\//', $result); } public function testReverseToArrayNamed() { diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index 78ca15f..8a15e4e 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -332,7 +332,7 @@ public function testTestAction() { $this->assertEquals($expected, $results); $result = $this->Case->controller->response->body(); - $this->assertRegExp('/This is the TestsAppsController index view/', $result); + $this->assertMatchesRegularExpression('/This is the TestsAppsController index view/', $result); $Controller = $this->Case->generate('TestsApps'); $this->Case->testAction('/tests_apps/redirect_to'); @@ -439,9 +439,9 @@ public function testBCSetReturn() { $result = $this->Case->testAction('/tests_apps/set_action', array( 'return' => 'contents' )); - $this->assertRegExp('/assertRegExp('/This is the TestsAppsController index view/', $result); - $this->assertRegExp('/<\/html>/', $result); + $this->assertMatchesRegularExpression('/assertMatchesRegularExpression('/This is the TestsAppsController index view/', $result); + $this->assertMatchesRegularExpression('/<\/html>/', $result); } /** @@ -585,9 +585,9 @@ public function testNoMocking() { $result = $this->Case->testAction('/tests_apps/set_action', array( 'return' => 'contents' )); - $this->assertRegExp('/assertRegExp('/This is the TestsAppsController index view/', $result); - $this->assertRegExp('/<\/html>/', $result); + $this->assertMatchesRegularExpression('/assertMatchesRegularExpression('/This is the TestsAppsController index view/', $result); + $this->assertMatchesRegularExpression('/<\/html>/', $result); } /** diff --git a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php index c97d621..9db4ed3 100644 --- a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php +++ b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php @@ -118,9 +118,9 @@ public function testGenerateDiff() { 10 => array(array('id' => 'HtmlCoverageReportTest::testGenerateDiff')) ); $result = $this->Coverage->generateDiff('myfile.php', $file, $coverage); - $this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result); - $this->assertRegExp('/
assertRegExp('/
/', $result);
+		$this->assertMatchesRegularExpression('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
+		$this->assertMatchesRegularExpression('/
assertMatchesRegularExpression('/
/', $result);
 		foreach ($file as $i => $line) {
 			$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);
 			$class = 'covered';
@@ -166,9 +166,9 @@ public function testPhpunit36Compatibility() {
 		);
 
 		$result = $this->Coverage->generateDiff('myfile.php', $file, $coverage);
-		$this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
-		$this->assertRegExp('/
assertRegExp('/
/', $result);
+		$this->assertMatchesRegularExpression('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
+		$this->assertMatchesRegularExpression('/
assertMatchesRegularExpression('/
/', $result);
 		foreach ($file as $i => $line) {
 			$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);
 			$class = 'covered';
diff --git a/lib/Cake/Test/Case/Utility/CakeTimeTest.php b/lib/Cake/Test/Case/Utility/CakeTimeTest.php
index b652548..519ae48 100644
--- a/lib/Cake/Test/Case/Utility/CakeTimeTest.php
+++ b/lib/Cake/Test/Case/Utility/CakeTimeTest.php
@@ -285,13 +285,13 @@ public function testTimeAgoInWordsWithFormat() {
 			strtotime('+2 weeks +2 days'),
 			'Y-m-d'
 		);
-		$this->assertRegExp('/^in 2 weeks, [1|2] day(s)?$/', $result);
+		$this->assertMatchesRegularExpression('/^in 2 weeks, [1|2] day(s)?$/', $result);
 
 		$result = $this->Time->timeAgoInWords(
 			strtotime('+2 weeks +2 days'),
 			'%x'
 		);
-		$this->assertRegExp('/^in 2 weeks, [1|2] day(s)?$/', $result);
+		$this->assertMatchesRegularExpression('/^in 2 weeks, [1|2] day(s)?$/', $result);
 
 		$result = $this->Time->timeAgoInWords(
 			strtotime('+2 months +2 days'),
diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php
index 3b9b3b3..a83555f 100644
--- a/lib/Cake/Test/Case/Utility/DebuggerTest.php
+++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -80,20 +80,23 @@ public function testExcerpt() {
 		$result = Debugger::excerpt(__FILE__, __LINE__, 2);
 		$this->assertTrue(is_array($result));
 		$this->assertEquals(5, count($result));
-		$this->assertRegExp('/function(.+)testExcerpt/', $result[1]);
+		$this->assertMatchesRegularExpression('/function(.+)testExcerpt/', $result[1]);
 
 		$result = Debugger::excerpt(__FILE__, 2, 2);
 		$this->assertTrue(is_array($result));
 		$this->assertEquals(4, count($result));
 
 		$pattern = '/.*?.*?<\?php/';
-		$this->assertRegExp($pattern, $result[0]);
+		if (version_compare(PHP_VERSION, '8.3.0') >= 0) {
+			$pattern = '/.*?.*?<\?php/';
+		}
+		$this->assertMatchesRegularExpression($pattern, $result[0]);
 
 		$result = Debugger::excerpt(__FILE__, 11, 2);
 		$this->assertEquals(5, count($result));
 
 		$pattern = '/\*<\/span>/';
-		$this->assertRegExp($pattern, $result[0]);
+		$this->assertMatchesRegularExpression($pattern, $result[0]);
 
 		$return = Debugger::excerpt('[internal]', 2, 2);
 		$this->assertTrue(empty($return));
@@ -116,14 +119,14 @@ public function testOutput() {
 		$type = $this->isPHP7() ? 'Notice' : 'Warning';
 		$this->assertEquals($type, $result[0]['error']);
 		if ($this->isPHP8()) {
-			$this->assertRegExp('/Undefined variable \$out/', $result[0]['description']);
+			$this->assertMatchesRegularExpression('/Undefined variable \$out/', $result[0]['description']);
 		}
 
 		if ($this->isPHP7()) {
-			$this->assertRegExp('/Undefined variable\:\s+out/', $result[0]['description']);
+			$this->assertMatchesRegularExpression('/Undefined variable\:\s+out/', $result[0]['description']);
 		}
 
-		$this->assertRegExp('/DebuggerTest::testOutput/i', $result[0]['trace']);
+		$this->assertMatchesRegularExpression('/DebuggerTest::testOutput/i', $result[0]['trace']);
 
 		ob_start();
 		Debugger::output('txt');
@@ -131,29 +134,29 @@ public function testOutput() {
 		$result = ob_get_clean();
 
 		if ($this->isPHP7()) {
-			$this->assertRegExp('/Undefined variable:\s+other/', $result);
+			$this->assertMatchesRegularExpression('/Undefined variable:\s+other/', $result);
 		}
 
 		if ($this->isPHP8()) {
-			$this->assertRegExp('/Undefined variable \$other/', $result);
+			$this->assertMatchesRegularExpression('/Undefined variable \$other/', $result);
 		}
 
-		$this->assertRegExp('/Trace:/', $result);
-		$this->assertRegExp('/DebuggerTest::testOutput/i', $result);
+		$this->assertMatchesRegularExpression('/Trace:/', $result);
+		$this->assertMatchesRegularExpression('/DebuggerTest::testOutput/i', $result);
 
 		ob_start();
 		Debugger::output('html');
 		$wrong .= '';
 		$result = ob_get_clean();
-		$this->assertRegExp('/
.+<\/pre>/', $result);
+		$this->assertMatchesRegularExpression('/
.+<\/pre>/', $result);
 		if ($this->isPHP7()) {
-			$this->assertRegExp('/Notice<\/b>/', $result);
-			$this->assertRegExp('/variable:\s+wrong/', $result);
+			$this->assertMatchesRegularExpression('/Notice<\/b>/', $result);
+			$this->assertMatchesRegularExpression('/variable:\s+wrong/', $result);
 		}
 
 		if ($this->isPHP8()) {
-			$this->assertRegExp('/Warning<\/b>/', $result);
-			$this->assertRegExp('/variable \$wrong/', $result);
+			$this->assertMatchesRegularExpression('/Warning<\/b>/', $result);
+			$this->assertMatchesRegularExpression('/variable \$wrong/', $result);
 		}
 
 
@@ -190,9 +193,9 @@ public function testOutput() {
 		if ($this->isPHP8()) {
 			$pattern = '/Undefined variable \$buzz/';
 		}
-		$this->assertRegExp($pattern, $result[1]);
-		$this->assertRegExp('/]+>Code/', $result[1]);
-		$this->assertRegExp('/]+>Context/', $result[2]);
+		$this->assertMatchesRegularExpression($pattern, $result[1]);
+		$this->assertMatchesRegularExpression('/]+>Code/', $result[1]);
+		$this->assertMatchesRegularExpression('/]+>Context/', $result[2]);
 		if (!$this->isPHP8()) {
 			$this->assertStringContainsString('$wrong = ''', $result[3], 'Context should be HTML escaped.');
 		}
@@ -232,7 +235,7 @@ public function testChangeOutputFormats() {
 				'&line={:line}">{:path}, line {:line}'
 		));
 		$result = Debugger::trace();
-		$this->assertRegExp('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
+		$this->assertMatchesRegularExpression('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
 
 		Debugger::output('xml', array(
 			'error' => '{:code}{:file}{:line}' .
@@ -305,7 +308,7 @@ public function testAddFormat() {
 		Debugger::outputAs('js');
 
 		$result = Debugger::trace();
-		$this->assertRegExp('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
+		$this->assertMatchesRegularExpression('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
 
 		Debugger::addFormat('xml', array(
 			'error' => '{:code}{:file}{:line}' .
@@ -713,11 +716,11 @@ public function testExportVarRecursion() {
  */
 	public function testTraceExclude() {
 		$result = Debugger::trace();
-		$this->assertRegExp('/^DebuggerTest::testTraceExclude/', $result);
+		$this->assertMatchesRegularExpression('/^DebuggerTest::testTraceExclude/', $result);
 
 		$result = Debugger::trace(array(
 			'exclude' => array('DebuggerTest::testTraceExclude')
 		));
-		$this->assertNotRegExp('/^DebuggerTest::testTraceExclude/', $result);
+		$this->assertDoesNotMatchRegularExpression('/^DebuggerTest::testTraceExclude/', $result);
 	}
 }
diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php
index 427cb48..c9b126b 100644
--- a/lib/Cake/Test/Case/Utility/XmlTest.php
+++ b/lib/Cake/Test/Case/Utility/XmlTest.php
@@ -164,7 +164,7 @@ public function testBuild() {
 		$this->assertEquals('value', $obj->firstChild->nodeValue);
 
 		$obj = Xml::build($xml, array('return' => 'domdocument', 'encoding' => null));
-		$this->assertNotRegExp('/encoding/', $obj->saveXML());
+		$this->assertDoesNotMatchRegularExpression('/encoding/', $obj->saveXML());
 	}
 
 /**
diff --git a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
index 0f2a852..b5369cf 100644
--- a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
@@ -118,16 +118,16 @@ public function testLayoutCacheParsingNoTagsInView() {
 
 		$View = new View($this->Controller);
 		$result = $View->render('index');
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
 
 		$contents = file_get_contents($filename);
-		$this->assertRegExp('/php echo \$variable/', $contents);
-		$this->assertRegExp('/php echo microtime()/', $contents);
-		$this->assertRegExp('/clark kent/', $result);
+		$this->assertMatchesRegularExpression('/php echo \$variable/', $contents);
+		$this->assertMatchesRegularExpression('/php echo microtime()/', $contents);
+		$this->assertMatchesRegularExpression('/clark kent/', $result);
 
 		unlink($filename);
 	}
@@ -177,17 +177,17 @@ public function testLayoutCacheParsingWithTagsInView() {
 
 		$View = new View($this->Controller);
 		$result = $View->render('test_nocache_tags');
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
 
 		$contents = file_get_contents($filename);
-		$this->assertRegExp('/if \(is_writable\(TMP\)\)\:/', $contents);
-		$this->assertRegExp('/php echo \$variable/', $contents);
-		$this->assertRegExp('/php echo microtime()/', $contents);
-		$this->assertNotRegExp('/cake:nocache/', $contents);
+		$this->assertMatchesRegularExpression('/if \(is_writable\(TMP\)\)\:/', $contents);
+		$this->assertMatchesRegularExpression('/php echo \$variable/', $contents);
+		$this->assertMatchesRegularExpression('/php echo microtime()/', $contents);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $contents);
 
 		unlink($filename);
 	}
@@ -212,14 +212,14 @@ public function testMultipleNoCacheTagsInViewfile() {
 		$View = new View($this->Controller);
 		$result = $View->render('multiple_nocache');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
 
 		$contents = file_get_contents($filename);
-		$this->assertNotRegExp('/cake:nocache/', $contents);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $contents);
 		unlink($filename);
 	}
 
@@ -245,42 +245,42 @@ public function testComplexNoCache() {
 		$View = new View($this->Controller);
 		$result = $View->render('sequencial_nocache');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
-		$this->assertRegExp('/A\. Layout Before Content/', $result);
-		$this->assertRegExp('/B\. In Plain Element/', $result);
-		$this->assertRegExp('/C\. Layout After Test Element/', $result);
-		$this->assertRegExp('/D\. In View File/', $result);
-		$this->assertRegExp('/E\. Layout After Content/', $result);
-		$this->assertRegExp('/F\. In Element With No Cache Tags/', $result);
-		$this->assertRegExp('/G\. Layout After Content And After Element With No Cache Tags/', $result);
-		$this->assertNotRegExp('/1\. layout before content/', $result);
-		$this->assertNotRegExp('/2\. in plain element/', $result);
-		$this->assertNotRegExp('/3\. layout after test element/', $result);
-		$this->assertNotRegExp('/4\. in view file/', $result);
-		$this->assertNotRegExp('/5\. layout after content/', $result);
-		$this->assertNotRegExp('/6\. in element with no cache tags/', $result);
-		$this->assertNotRegExp('/7\. layout after content and after element with no cache tags/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
+		$this->assertMatchesRegularExpression('/A\. Layout Before Content/', $result);
+		$this->assertMatchesRegularExpression('/B\. In Plain Element/', $result);
+		$this->assertMatchesRegularExpression('/C\. Layout After Test Element/', $result);
+		$this->assertMatchesRegularExpression('/D\. In View File/', $result);
+		$this->assertMatchesRegularExpression('/E\. Layout After Content/', $result);
+		$this->assertMatchesRegularExpression('/F\. In Element With No Cache Tags/', $result);
+		$this->assertMatchesRegularExpression('/G\. Layout After Content And After Element With No Cache Tags/', $result);
+		$this->assertDoesNotMatchRegularExpression('/1\. layout before content/', $result);
+		$this->assertDoesNotMatchRegularExpression('/2\. in plain element/', $result);
+		$this->assertDoesNotMatchRegularExpression('/3\. layout after test element/', $result);
+		$this->assertDoesNotMatchRegularExpression('/4\. in view file/', $result);
+		$this->assertDoesNotMatchRegularExpression('/5\. layout after content/', $result);
+		$this->assertDoesNotMatchRegularExpression('/6\. in element with no cache tags/', $result);
+		$this->assertDoesNotMatchRegularExpression('/7\. layout after content and after element with no cache tags/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_complex.php';
 		$this->assertTrue(file_exists($filename));
 		$contents = file_get_contents($filename);
 		unlink($filename);
 
-		$this->assertRegExp('/A\. Layout Before Content/', $contents);
-		$this->assertNotRegExp('/B\. In Plain Element/', $contents);
-		$this->assertRegExp('/C\. Layout After Test Element/', $contents);
-		$this->assertRegExp('/D\. In View File/', $contents);
-		$this->assertRegExp('/E\. Layout After Content/', $contents);
-		$this->assertRegExp('/F\. In Element With No Cache Tags/', $contents);
-		$this->assertRegExp('/G\. Layout After Content And After Element With No Cache Tags/', $contents);
-		$this->assertRegExp('/1\. layout before content/', $contents);
-		$this->assertNotRegExp('/2\. in plain element/', $contents);
-		$this->assertRegExp('/3\. layout after test element/', $contents);
-		$this->assertRegExp('/4\. in view file/', $contents);
-		$this->assertRegExp('/5\. layout after content/', $contents);
-		$this->assertRegExp('/6\. in element with no cache tags/', $contents);
-		$this->assertRegExp('/7\. layout after content and after element with no cache tags/', $contents);
+		$this->assertMatchesRegularExpression('/A\. Layout Before Content/', $contents);
+		$this->assertDoesNotMatchRegularExpression('/B\. In Plain Element/', $contents);
+		$this->assertMatchesRegularExpression('/C\. Layout After Test Element/', $contents);
+		$this->assertMatchesRegularExpression('/D\. In View File/', $contents);
+		$this->assertMatchesRegularExpression('/E\. Layout After Content/', $contents);
+		$this->assertMatchesRegularExpression('/F\. In Element With No Cache Tags/', $contents);
+		$this->assertMatchesRegularExpression('/G\. Layout After Content And After Element With No Cache Tags/', $contents);
+		$this->assertMatchesRegularExpression('/1\. layout before content/', $contents);
+		$this->assertDoesNotMatchRegularExpression('/2\. in plain element/', $contents);
+		$this->assertMatchesRegularExpression('/3\. layout after test element/', $contents);
+		$this->assertMatchesRegularExpression('/4\. in view file/', $contents);
+		$this->assertMatchesRegularExpression('/5\. layout after content/', $contents);
+		$this->assertMatchesRegularExpression('/6\. in element with no cache tags/', $contents);
+		$this->assertMatchesRegularExpression('/7\. layout after content and after element with no cache tags/', $contents);
 	}
 
 /**
@@ -301,16 +301,16 @@ public function testCacheViewVars() {
 
 		$View = new View($this->Controller);
 		$result = $View->render('index');
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
 
 		$contents = file_get_contents($filename);
-		$this->assertRegExp('/\$this\-\>viewVars/', $contents);
-		$this->assertRegExp('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
-		$this->assertRegExp('/php echo \$variable/', $contents);
+		$this->assertMatchesRegularExpression('/\$this\-\>viewVars/', $contents);
+		$this->assertMatchesRegularExpression('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
+		$this->assertMatchesRegularExpression('/php echo \$variable/', $contents);
 
 		unlink($filename);
 	}
@@ -344,7 +344,7 @@ public function testCacheCallbacks() {
 
 		$contents = file_get_contents($filename);
 
-		$this->assertRegExp('/\$controller->startupProcess\(\);/', $contents);
+		$this->assertMatchesRegularExpression('/\$controller->startupProcess\(\);/', $contents);
 
 		unlink($filename);
 	}
@@ -371,8 +371,8 @@ public function testCacheActionArray() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
@@ -400,8 +400,8 @@ public function testCacheActionArrayCamelCase() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
@@ -434,8 +434,8 @@ public function testCacheWithNamedAndPassedArgs() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing_1_2_name_mark_ice_cream.php';
 		$this->assertTrue(file_exists($filename));
@@ -466,8 +466,8 @@ public function testCacheWithQueryStringParams() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing_q_cakephp.php';
 		$this->assertTrue(file_exists($filename), 'Missing cache file ' . $filename);
@@ -500,8 +500,8 @@ public function testCacheWithCustomRoutes() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'en_cache_test_cache_parsing.php';
 		$this->assertTrue(file_exists($filename));
@@ -535,8 +535,8 @@ public function testCacheBaseNameControllerName() {
 		$View = new View($this->Controller);
 		$result = $View->render('index');
 
-		$this->assertNotRegExp('/cake:nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
+		$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
 
 		$filename = CACHE . 'views' . DS . 'cache_cachetest_cache_name.php';
 		$this->assertTrue(file_exists($filename));
@@ -620,9 +620,9 @@ public function testCacheEmptySections() {
 
 		$View = new View($this->Controller);
 		$result = $View->render('cache_empty_sections');
-		$this->assertNotRegExp('/nocache/', $result);
-		$this->assertNotRegExp('/php echo/', $result);
-		$this->assertRegExp(
+		$this->assertDoesNotMatchRegularExpression('/nocache/', $result);
+		$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
+		$this->assertMatchesRegularExpression(
 			'@\s*\s*' .
 			'\s*' .
 			'View Content\s*' .
@@ -632,8 +632,8 @@ public function testCacheEmptySections() {
 		$filename = CACHE . 'views' . DS . 'cachetest_cache_empty_sections.php';
 		$this->assertTrue(file_exists($filename));
 		$contents = file_get_contents($filename);
-		$this->assertNotRegExp('/nocache/', $contents);
-		$this->assertRegExp(
+		$this->assertDoesNotMatchRegularExpression('/nocache/', $contents);
+		$this->assertMatchesRegularExpression(
 			'@\s*Posts\s*' .
 			'<\?php \$x \= 1; \?>\s*' .
 			'\s*' .
diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
index 2c8a8e0..3474e60 100644
--- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -639,7 +639,7 @@ public function testCreateClearingFields() {
 	public function testValidateHashNoModel() {
 		$this->Form->request['_Token'] = array('key' => 'foo');
 		$result = $this->Form->secure(array('anything'));
-		$this->assertRegExp('/540ac9c60d323c22bafe997b72c0790f39a8bdef/', $result);
+		$this->assertMatchesRegularExpression('/540ac9c60d323c22bafe997b72c0790f39a8bdef/', $result);
 	}
 
 /**
@@ -656,18 +656,18 @@ public function testDuplicateFieldNameResolution() {
 
 		$result = $this->Form->input('ValidateUser.name');
 		$this->assertEquals(array('ValidateUser', 'name'), $this->Form->entity());
-		$this->assertRegExp('/name="data\[ValidateUser\]\[name\]"/', $result);
-		$this->assertRegExp('/type="text"/', $result);
+		$this->assertMatchesRegularExpression('/name="data\[ValidateUser\]\[name\]"/', $result);
+		$this->assertMatchesRegularExpression('/type="text"/', $result);
 
 		$result = $this->Form->input('ValidateItem.name');
 		$this->assertEquals(array('ValidateItem', 'name'), $this->Form->entity());
-		$this->assertRegExp('/name="data\[ValidateItem\]\[name\]"/', $result);
-		$this->assertRegExp('/