From 1e8586bac91b46987cb144f4fe5b87856ba735b7 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Sat, 18 Feb 2017 15:35:10 +0100 Subject: [PATCH 01/23] Adds more info to suggestions This commit adds more infos why separate packages are suggested. This is especially of interest as different Validators are only usable with additional packages. This addresses #147 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index e8830774b..781bb6039 100644 --- a/composer.json +++ b/composer.json @@ -32,13 +32,13 @@ "phpunit/PHPUnit": "^4.0" }, "suggest": { - "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-db": "Zend\\Db component, required by the (No)RecordExists validator", "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator", - "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages as well as to use the various Date validators", - "zendframework/zend-math": "Zend\\Math component", + "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages", + "zendframework/zend-math": "Zend\\Math component, required by the Csrf validator", "zendframework/zend-i18n-resources": "Translations of validator messages", "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", - "zendframework/zend-session": "Zend\\Session component", + "zendframework/zend-session": "Zend\\Session component, required by the Csrf validator", "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators" }, "minimum-stability": "dev", From 8dfb1d5d5ee6ae24e6a70eae9553b52bb254737d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 18 Feb 2017 18:42:29 +0100 Subject: [PATCH 02/23] #147 #148 adding changelog entry --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c201d83..c9e4328c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,10 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#147](https://github.com/zendframework/zend-validator/issues/147) + [#148](https://github.com/zendframework/zend-validator/pull/110) adds further + `"suggest"` clauses in `composer.json`, since some dependencies are not always + required, and may lead to runtime failures. ## 2.8.2 - 2017-01-29 From db3af3f4caad8bc5657bf69fc8c02ff100882624 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Tue, 14 Mar 2017 21:37:53 +1000 Subject: [PATCH 03/23] Bump php to minimum supported 5.6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6bba02378..b1f154ba7 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } }, "require": { - "php": "^5.5 || ^7.0", + "php": "^5.6 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0", "container-interop/container-interop": "^1.1" }, From 008f1356ac8d3bc7f7b25e6f540ba4a0b78337b7 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Tue, 14 Mar 2017 21:43:58 +1000 Subject: [PATCH 04/23] Update phpunit to 5.7 || 6.0 --- .gitignore | 1 - composer.json | 2 +- composer.lock | 2293 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2294 insertions(+), 2 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 28d2d11c0..1f2615af0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ doc/html/ zf-mkdoc-theme/ clover.xml -composer.lock coveralls-upload.json phpunit.xml vendor diff --git a/composer.json b/composer.json index b1f154ba7..91ba040da 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", "zendframework/zend-session": "^2.6.2", "zendframework/zend-uri": "^2.5", - "phpunit/PHPUnit": "^4.0", + "phpunit/PHPUnit": "^6.0.8 || ^5.7.15", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..e2f3796c9 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2293 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "26a4395b24ebf7f41fde5c85e5e51725", + "packages": [ + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2016-09-13T14:38:50+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-01-26T22:05:40+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "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", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30T07:12:33+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-11-25T06:54:22+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02T20:05:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-03-01T09:12:17+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "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" + ], + "time": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b99112aecc01f62acf3d81a3f59646700a1849e5", + "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "~1.2", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-03-02T15:22:43+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-12-08T20:27:08+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08T07:14:41+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "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" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-03-01T22:17:45+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-03-07T16:47:02+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-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" + ], + "time": "2016-11-23T20:04:58+00:00" + }, + { + "name": "zendframework/zend-cache", + "version": "2.7.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-cache.git", + "reference": "c98331b96d3b9d9b24cf32d02660602edb34d039" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/c98331b96d3b9d9b24cf32d02660602edb34d039", + "reference": "c98331b96d3b9d9b24cf32d02660602edb34d039", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpbench/phpbench": "^0.10.0", + "phpunit/phpunit": "^4.8", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-serializer": "^2.6", + "zendframework/zend-session": "^2.6.2" + }, + "suggest": { + "ext-apc": "APC or compatible extension, to use the APC storage adapter", + "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter", + "ext-dba": "DBA, to use the DBA storage adapter", + "ext-memcache": "Memcache >= 2.0.0 to use the Memcache storage adapter", + "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", + "ext-mongo": "Mongo, to use MongoDb storage adapter", + "ext-redis": "Redis, to use Redis storage adapter", + "ext-wincache": "WinCache, to use the WinCache storage adapter", + "ext-xcache": "XCache, to use the XCache storage adapter", + "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\Cache", + "config-provider": "Zend\\Cache\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a generic way to cache any data", + "homepage": "https://github.com/zendframework/zend-cache", + "keywords": [ + "cache", + "zf2" + ], + "time": "2016-12-16T11:35:47+00:00" + }, + { + "name": "zendframework/zend-coding-standard", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-coding-standard.git", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-coding-standard/zipball/893316d2904e93f1c74c1384b6d7d57778299cb6", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework coding standard", + "keywords": [ + "Coding Standard", + "zf" + ], + "time": "2016-11-09T21:30:43+00:00" + }, + { + "name": "zendframework/zend-config", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-i18n": "^2.5", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zend-config", + "keywords": [ + "config", + "zf2" + ], + "time": "2016-02-04T23:01:10+00:00" + }, + { + "name": "zendframework/zend-db", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-db.git", + "reference": "5926a1a2e7e035546b690cb7d4c11a3c47db2c98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-db/zipball/5926a1a2e7e035546b690cb7d4c11a3c47db2c98", + "reference": "5926a1a2e7e035546b690cb7d4c11a3c47db2c98", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-hydrator": "^1.1 || ^2.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "Zend\\EventManager component", + "zendframework/zend-hydrator": "Zend\\Hydrator component for using HydratingResultSets", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev", + "dev-develop": "2.9-dev" + }, + "zf": { + "component": "Zend\\Db", + "config-provider": "Zend\\Db\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Db\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-db", + "keywords": [ + "db", + "zf2" + ], + "time": "2016-08-09T19:28:55+00:00" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ], + "time": "2016-06-30T19:48:38+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/c3bce7b7d47c54040b9ae51bc55491c72513b75d", + "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.6", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2016-12-19T21:47:12+00:00" + }, + { + "name": "zendframework/zend-filter", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-filter.git", + "reference": "84c50246428efb0a1e52868e162dab3e149d5b80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/84c50246428efb0a1e52868e162dab3e149d5b80", + "reference": "84c50246428efb0a1e52868e162dab3e149d5b80", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "pear/archive_tar": "^1.4", + "phpunit/phpunit": "~4.0", + "zendframework/zend-crypt": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component, for encryption filters", + "zendframework/zend-i18n": "Zend\\I18n component for filters depending on i18n functionality", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for using the filter chain functionality", + "zendframework/zend-uri": "Zend\\Uri component, for the UriNormalize filter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\Filter", + "config-provider": "Zend\\Filter\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed data filters", + "homepage": "https://github.com/zendframework/zend-filter", + "keywords": [ + "filter", + "zf2" + ], + "time": "2016-04-18T18:32:43+00:00" + }, + { + "name": "zendframework/zend-http", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-http.git", + "reference": "09f4d279f46d86be63171ff62ee0f79eca878678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/09f4d279f46d86be63171ff62ee0f79eca878678", + "reference": "09f4d279f46d86be63171ff62ee0f79eca878678", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-loader": "^2.5", + "zendframework/zend-stdlib": "^2.5 || ^3.0", + "zendframework/zend-uri": "^2.5", + "zendframework/zend-validator": "^2.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Http\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", + "homepage": "https://github.com/zendframework/zend-http", + "keywords": [ + "http", + "zf2" + ], + "time": "2017-01-31T14:41:02+00:00" + }, + { + "name": "zendframework/zend-i18n", + "version": "2.7.3", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-i18n.git", + "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/b2db0d8246a865c659f93199f90f5fc2cd2f3cd8", + "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-config": "^2.6", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.6", + "zendframework/zend-view": "^2.6.3" + }, + "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", + "zendframework/zend-filter": "You should install this package to use the provided filters", + "zendframework/zend-i18n-resources": "Translation resources", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "You should install this package to use the provided validators", + "zendframework/zend-view": "You should install this package to use the provided view helpers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\I18n", + "config-provider": "Zend\\I18n\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-i18n", + "keywords": [ + "i18n", + "zf2" + ], + "time": "2016-06-07T21:08:30+00:00" + }, + { + "name": "zendframework/zend-loader", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-loader.git", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-loader", + "keywords": [ + "loader", + "zf2" + ], + "time": "2015-06-03T14:05:47+00:00" + }, + { + "name": "zendframework/zend-math", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-math.git", + "reference": "f4358090d5d23973121f1ed0b376184b66d9edec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-math/zipball/f4358090d5d23973121f1ed0b376184b66d9edec", + "reference": "f4358090d5d23973121f1ed0b376184b66d9edec", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "ircmaxell/random-lib": "~1.1", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-bcmath": "If using the bcmath functionality", + "ext-gmp": "If using the gmp functionality", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if Mcrypt extensions is unavailable" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-math", + "keywords": [ + "math", + "zf2" + ], + "time": "2016-04-07T16:29:53+00:00" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-servicemanager.git", + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.6 || ^7.0", + "psr/container": "^1.0", + "zendframework/zend-stdlib": "^3.1" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "ocramius/proxy-manager": "^1.0 || ^2.0", + "phpbench/phpbench": "^0.10.0", + "phpunit/phpunit": "^5.7 || ^6.0.6", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "suggest": { + "ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services", + "zendframework/zend-stdlib": "zend-stdlib ^2.5 if you wish to use the MergeReplaceKey or MergeRemoveKey features in Config instances" + }, + "bin": [ + "bin/generate-deps-for-config-factory", + "bin/generate-factory-for-class" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev", + "dev-develop": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ServiceManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-servicemanager", + "keywords": [ + "service-manager", + "servicemanager", + "zf" + ], + "time": "2017-03-01T22:08:02+00:00" + }, + { + "name": "zendframework/zend-session", + "version": "2.7.3", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-session.git", + "reference": "346e9709657b81a5d53d70ce754730a26d1f02f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-session/zipball/346e9709657b81a5d53d70ce754730a26d1f02f2", + "reference": "346e9709657b81a5d53d70ce754730a26d1f02f2", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "container-interop/container-interop": "^1.1", + "fabpot/php-cs-fixer": "1.7.*", + "mongodb/mongodb": "^1.0.1", + "phpunit/phpunit": "~4.0", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-db": "^2.7", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.6" + }, + "suggest": { + "mongodb/mongodb": "If you want to use the MongoDB session save handler", + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\Session", + "config-provider": "Zend\\Session\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Session\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client", + "homepage": "https://github.com/zendframework/zend-session", + "keywords": [ + "session", + "zf2" + ], + "time": "2016-07-05T18:32:50+00:00" + }, + { + "name": "zendframework/zend-uri", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-uri.git", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/0bf717a239432b1a1675ae314f7c4acd742749ed", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-validator": "^2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "a component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)", + "homepage": "https://github.com/zendframework/zend-uri", + "keywords": [ + "uri", + "zf2" + ], + "time": "2016-02-17T22:38:51+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^5.6 || ^7.0" + }, + "platform-dev": [] +} From e5288f905f956b4e16493a15db3d5a47c5d3c706 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Tue, 14 Mar 2017 21:59:17 +1000 Subject: [PATCH 05/23] Update travis config --- .travis.yml | 87 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index d13ffce21..acb92e3f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,55 +15,88 @@ cache: env: global: + - COMPOSER_ARGS="--no-interaction" + - COVERAGE_DEPS="satooshi/php-coveralls" + - LEGACY_DEPS="phpunit/phpunit" - TESTS_ZEND_VALIDATOR_ONLINE_ENABLED=true - - SITE_URL: https://zendframework.github.io/zend-validator - - GH_USER_NAME: "Matthew Weier O'Phinney" - - GH_USER_EMAIL: matthew@weierophinney.net - - GH_REF: github.com/zendframework/zend-validator.git - - secure: "SoUsUxBFCuC0rVQyDJ/+IB38glC5WeWvg0XxtNj79di7wsQ92Jofp6Uu3NJBB8H1+at1pHetphRm4N+GPQmZGMFTG7LyF5u8duV8t4nDpAz5WfoP1y0IyacP6IrWzANeszOTZ04dlHu3dBdHusNpNxxUHl97bSx4XQUAm2GUTqNkuXNgQJFAAxx91jb5txG4W8KeMnfRm9jeDHP17BCnBMaSkYEXeLpHkYa9wA4lBJ7ZD6LuSC+MhrJCtREBTsWKLJY6xeBjRorUug+uCrNyArPtcOAaOLMSDJ1XIi3L5/Q7HdoldV7aC3V5HjNlpdIEFl33IGiCOyictFCpT1KaKx7TL8zDTMCiqe0cCyfTnq28lzULz2hXg0Kov7BFcRr2Ht/1f96RgrakWQiYTmk+C3YYYA16Fb+MndkMI3WH7WI0suC+5nhPdGl53MCWsd5x2+dDk/ifB/VvxHdGhhgxzAxsYJ41gV/LlzjbCQJNDCnTaL/GHCTUGJEPgwLrn2W52uZx6VggE9wl5z4XkiPqBy6zAAdwF55RRJgCxFttGOMVGdegFLHTf6+13S4sEImNmyVTeuJBZEHxaYRJ21wweOocjC2StKC9V54uPysDcEYwhu8WOsYU34fQdpMx3OHfPmXvhNGqoZ1rVsd5HM0QZZMT+7SI0r3UNKxrPC8LEAU=" + - SITE_URL=https://zendframework.github.io/zend-validator + - GH_USER_NAME="Matthew Weier O'Phinney" + - GH_USER_EMAIL=matthew@weierophinney.net + - GH_REF=github.com/zendframework/zend-validator.git + - secure="SoUsUxBFCuC0rVQyDJ/+IB38glC5WeWvg0XxtNj79di7wsQ92Jofp6Uu3NJBB8H1+at1pHetphRm4N+GPQmZGMFTG7LyF5u8duV8t4nDpAz5WfoP1y0IyacP6IrWzANeszOTZ04dlHu3dBdHusNpNxxUHl97bSx4XQUAm2GUTqNkuXNgQJFAAxx91jb5txG4W8KeMnfRm9jeDHP17BCnBMaSkYEXeLpHkYa9wA4lBJ7ZD6LuSC+MhrJCtREBTsWKLJY6xeBjRorUug+uCrNyArPtcOAaOLMSDJ1XIi3L5/Q7HdoldV7aC3V5HjNlpdIEFl33IGiCOyictFCpT1KaKx7TL8zDTMCiqe0cCyfTnq28lzULz2hXg0Kov7BFcRr2Ht/1f96RgrakWQiYTmk+C3YYYA16Fb+MndkMI3WH7WI0suC+5nhPdGl53MCWsd5x2+dDk/ifB/VvxHdGhhgxzAxsYJ41gV/LlzjbCQJNDCnTaL/GHCTUGJEPgwLrn2W52uZx6VggE9wl5z4XkiPqBy6zAAdwF55RRJgCxFttGOMVGdegFLHTf6+13S4sEImNmyVTeuJBZEHxaYRJ21wweOocjC2StKC9V54uPysDcEYwhu8WOsYU34fQdpMx3OHfPmXvhNGqoZ1rVsd5HM0QZZMT+7SI0r3UNKxrPC8LEAU=" matrix: - fast_finish: true include: - - php: 5.5 - env: - - CS_CHECK=true - - EXECUTE_HOSTNAME_CHECK=true - - php: 5.5 + - php: 5.6 env: - - SERVICE_MANAGER_VERSION="^2.7.5" + - DEPS=lowest - php: 5.6 env: + - DEPS=locked + - EXECUTE_HOSTNAME_CHECK=true - TEST_COVERAGE=true - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)" - PATH="$HOME/.local/bin:$PATH" - php: 5.6 env: + - DEPS=locked - SERVICE_MANAGER_VERSION="^2.7.5" + - php: 5.6 + env: + - DEPS=latest - php: 7 + env: + - DEPS=lowest - php: 7 env: + - DEPS=locked + - CS_CHECK=true + - php: 7 + env: + - DEPS=locked - SERVICE_MANAGER_VERSION="^2.7.5" - - php: hhvm + - php: 7 + env: + - DEPS=latest + - php: 7.1 + env: + - DEPS=lowest + - php: 7.1 + env: + - DEPS=locked + - php: 7.1 + env: + - DEPS=latest + - php: hhvm + env: + - DEPS=lowest + - php: hhvm + env: + - DEPS=locked + - php: hhvm + env: + - DEPS=latest - php: hhvm env: + - DEPS=locked - SERVICE_MANAGER_VERSION="^2.7.5" allow_failures: - - php: hhvm - -notifications: - irc: "irc.freenode.org#zftalk.dev" - email: false + - php: hhvm: before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - - composer self-update - - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi - - if [[ $SERVICE_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi - - if [[ $SERVICE_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi + - travis_retry composer self-update install: - - travis_retry composer install --no-interaction --ignore-platform-reqs + - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs + - if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi + - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi + - if [[ $SERVICE_MANAGER_VERSION != '' ]]; then travis_retry composer require --dev --no-update $COMPOSER_ARGS "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi + - if [[ $SERVICE_MANAGER_VERSION == '' ]]; then travis_retry composer require --dev --no-update $COMPOSER_ARGS "zendframework/zend-servicemanager:^3.0.3" ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi + - stty cols 120 + - COLUMNS=120 composer show script: - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi @@ -71,8 +104,12 @@ script: - if [[ $EXECUTE_HOSTNAME_CHECK == "true" && $TRAVIS_PULL_REQUEST == "false" ]]; then php bin/update_hostname_validator.php --check-only; fi - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi +after_script: + - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi + after_success: - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi -after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi +notifications: + irc: "irc.freenode.org#zftalk.dev" + email: false From a34770d8124c947aab78a3ef1bde3dac5891c507 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Tue, 14 Mar 2017 22:39:38 +0100 Subject: [PATCH 06/23] replace \PHPUnit_Framework_TestCase with PHPUnit\Framework\TestCase replace setExpectedException() and @expectedException with expectException() --- test/AbstractTest.php | 17 +++++----- test/BarcodeTest.php | 10 ++++-- test/BetweenTest.php | 10 +++--- test/BitwiseTest.php | 3 +- test/CallbackTest.php | 13 ++++---- test/CreditCardTest.php | 7 ++-- test/CsrfTest.php | 3 +- test/DateStepTest.php | 3 +- test/DateTest.php | 3 +- test/Db/AbstractDbTest.php | 16 ++++------ test/Db/NoRecordExistsTest.php | 10 +++--- test/Db/RecordExistsTest.php | 10 +++--- test/DigitsTest.php | 3 +- test/EmailAddressTest.php | 3 +- test/ExplodeTest.php | 15 ++++----- test/File/CountTest.php | 26 +++++++-------- test/File/Crc32Test.php | 6 ++-- test/File/ExcludeExtensionTest.php | 10 +++--- test/File/ExcludeMimeTypeTest.php | 10 +++--- test/File/ExistsTest.php | 16 ++++------ test/File/ExtensionTest.php | 10 +++--- test/File/FilesSizeTest.php | 24 +++++++------- test/File/HashTest.php | 19 ++++++----- test/File/ImageSizeTest.php | 31 ++++++++++-------- test/File/IsCompressedTest.php | 3 +- test/File/IsImageTest.php | 3 +- test/File/Md5Test.php | 6 ++-- test/File/MimeTypeTest.php | 27 +++++++--------- test/File/NotExistsTest.php | 12 +++---- test/File/Sha1Test.php | 10 +++--- test/File/SizeTest.php | 26 +++++++-------- test/File/UploadFileTest.php | 7 ++-- test/File/UploadTest.php | 7 ++-- test/File/WordCountTest.php | 32 +++++++++---------- test/GPSPointTest.php | 3 +- test/GreaterThanTest.php | 3 +- test/HexTest.php | 3 +- test/HostnameTest.php | 3 +- test/IbanTest.php | 10 ++++-- test/IdenticalTest.php | 6 ++-- test/InArrayTest.php | 10 +++--- test/IpTest.php | 7 ++-- test/IsInstanceOfTest.php | 29 +++++++++-------- test/IsbnTest.php | 10 ++++-- test/LessThanTest.php | 3 +- test/MessageTest.php | 16 ++++------ test/NotEmptyTest.php | 7 ++-- test/RegexTest.php | 11 ++++--- test/Sitemap/ChangefreqTest.php | 3 +- test/Sitemap/LastmodTest.php | 3 +- test/Sitemap/LocTest.php | 3 +- test/Sitemap/PriorityTest.php | 3 +- test/StaticValidatorTest.php | 6 ++-- test/StepTest.php | 3 +- test/StringLengthTest.php | 16 ++++------ test/TimezoneTest.php | 8 +++-- test/UriTest.php | 11 +++---- test/UuidTest.php | 2 +- test/ValidatorChainTest.php | 6 ++-- ...alidatorPluginManagerCompatibilityTest.php | 2 +- test/ValidatorPluginManagerFactoryTest.php | 2 +- test/ValidatorPluginManagerTest.php | 3 +- 62 files changed, 326 insertions(+), 277 deletions(-) diff --git a/test/AbstractTest.php b/test/AbstractTest.php index d10857d96..06792107a 100644 --- a/test/AbstractTest.php +++ b/test/AbstractTest.php @@ -9,15 +9,17 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use ReflectionMethod; use Zend\Validator\AbstractValidator; use Zend\Validator\EmailAddress; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\Hostname; /** * @group Zend_Validator */ -class AbstractTest extends \PHPUnit_Framework_TestCase +class AbstractTest extends TestCase { /** @var AbstractValidator */ public $validator; @@ -292,10 +294,9 @@ public function errorHandlerIgnore($errno, $errstr, $errfile, $errline, array $e public function testRetrievingUnknownOptionRaisesException() { $option = 'foo'; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - sprintf("Invalid option '%s'", $option) - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage(sprintf("Invalid option '%s'", $option)); + $this->validator->getOption($option); } @@ -319,10 +320,8 @@ public function invalidOptionsArguments() */ public function testSettingOptionsWithNonTraversableRaisesException($options) { - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'setOptions expects an array or Traversable' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('setOptions expects an array or Traversable'); $this->validator->setOptions($options); } } diff --git a/test/BarcodeTest.php b/test/BarcodeTest.php index e569ddb2f..92029286d 100644 --- a/test/BarcodeTest.php +++ b/test/BarcodeTest.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Barcode; +use Zend\Validator\Exception\InvalidArgumentException; /** * \Zend\Barcode * * @group Zend_Validator */ -class BarcodeTest extends \PHPUnit_Framework_TestCase +class BarcodeTest extends TestCase { public function provideBarcodeConstructor() { @@ -36,7 +38,8 @@ public function testBarcodeConstructor($options, $expectedInstance) public function testNoneExisting() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'not found'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('not found'); $barcode = new Barcode('\Zend\Validate\BarcodeTest\NonExistentClassName'); } @@ -136,7 +139,8 @@ public function testInvalidAdapter() { $barcode = new Barcode('Ean13'); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'does not implement'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('does not implement'); require_once __DIR__ . "/_files/MyBarcode5.php"; $barcode->setAdapter('MyBarcode5'); } diff --git a/test/BetweenTest.php b/test/BetweenTest.php index ace8526c9..bf86e4e5f 100644 --- a/test/BetweenTest.php +++ b/test/BetweenTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Between; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class BetweenTest extends \PHPUnit_Framework_TestCase +class BetweenTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -114,10 +116,8 @@ public function testEqualsMessageVariables() */ public function testMissingMinOrMax(array $args) { - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - "Missing option. 'min' and 'max' have to be given" - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Missing option. 'min' and 'max' have to be given"); new Between($args); } diff --git a/test/BitwiseTest.php b/test/BitwiseTest.php index 7a301ae78..334ffa3dc 100644 --- a/test/BitwiseTest.php +++ b/test/BitwiseTest.php @@ -9,9 +9,10 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Bitwise; -class BitwiseTest extends \PHPUnit_Framework_TestCase +class BitwiseTest extends TestCase { /** * @var \Zend\Validator\Bitwise diff --git a/test/CallbackTest.php b/test/CallbackTest.php index 1da5bfcf8..bd0ad3a44 100644 --- a/test/CallbackTest.php +++ b/test/CallbackTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Callback; use ReflectionProperty; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class CallbackTest extends \PHPUnit_Framework_TestCase +class CallbackTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -61,7 +63,8 @@ public function testInvalidCallback() { $valid = new Callback([$this, 'objectCallback']); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Invalid callback given'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid callback given'); $valid->setCallback('invalidcallback'); } @@ -133,10 +136,8 @@ public function testIsValidRaisesExceptionWhenNoCallbackPresent() $r->setValue($validator, $options); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'No callback given' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('No callback given'); $validator->isValid('test'); } } diff --git a/test/CreditCardTest.php b/test/CreditCardTest.php index e22a9561b..fe224435c 100644 --- a/test/CreditCardTest.php +++ b/test/CreditCardTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Config; use Zend\Validator\CreditCard; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class CreditCardTest extends \PHPUnit_Framework_TestCase +class CreditCardTest extends TestCase { public static function basicValues() { @@ -261,7 +263,8 @@ public function testInvalidServiceClass() $validator = new CreditCard(); $this->assertEquals(null, $validator->getService()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Invalid callback given'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid callback given'); $validator->setService(['ZendTest\Validator\CreditCardTest', 'nocallback']); } diff --git a/test/CsrfTest.php b/test/CsrfTest.php index a93e6cf79..a72e179f5 100644 --- a/test/CsrfTest.php +++ b/test/CsrfTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Session\Config\StandardConfig; use Zend\Session\Container; use Zend\Validator\Csrf; @@ -18,7 +19,7 @@ * * @group Zend_Validator */ -class CsrfTest extends \PHPUnit_Framework_TestCase +class CsrfTest extends TestCase { /** @var Csrf */ public $validator; diff --git a/test/DateStepTest.php b/test/DateStepTest.php index 10adee8d2..be2169a44 100644 --- a/test/DateStepTest.php +++ b/test/DateStepTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator; use DateTime; use DateInterval; @@ -18,7 +19,7 @@ /** * @group Zend_Validator */ -class DateStepTest extends \PHPUnit_Framework_TestCase +class DateStepTest extends TestCase { public function stepTestsDataProvider() { diff --git a/test/DateTest.php b/test/DateTest.php index a8bb0c625..c4398d9ca 100644 --- a/test/DateTest.php +++ b/test/DateTest.php @@ -11,13 +11,14 @@ use DateTime; use DateTimeImmutable; +use PHPUnit\Framework\TestCase; use stdClass; use Zend\Validator; /** * @group Zend_Validator */ -class DateTest extends \PHPUnit_Framework_TestCase +class DateTest extends TestCase { /** * @var Validator\Date diff --git a/test/Db/AbstractDbTest.php b/test/Db/AbstractDbTest.php index bcd01c7c0..84a0731dc 100644 --- a/test/Db/AbstractDbTest.php +++ b/test/Db/AbstractDbTest.php @@ -9,15 +9,17 @@ namespace ZendTest\Validator\Db; +use PHPUnit\Framework\TestCase; use ZendTest\Validator\Db\TestAsset\ConcreteDbValidator; use Zend\Db\Adapter\AdapterAwareInterface; use Zend\Db\Adapter\Adapter; use Zend\Db\Sql\Select; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class AbstractDbTest extends \PHPUnit_Framework_TestCase +class AbstractDbTest extends TestCase { protected $validator; @@ -33,10 +35,8 @@ public function setUp() public function testConstructorWithNoTableAndSchemaKey() { - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Table or Schema option missing!' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Table or Schema option missing!'); $this->validator = new ConcreteDbValidator([ 'field' => 'field', ]); @@ -44,10 +44,8 @@ public function testConstructorWithNoTableAndSchemaKey() public function testConstructorWithNoFieldKey() { - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Field option missing!' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Field option missing!'); $validator = new ConcreteDbValidator([ 'schema' => 'schema', 'table' => 'table', diff --git a/test/Db/NoRecordExistsTest.php b/test/Db/NoRecordExistsTest.php index 8c1d41407..8147f847a 100644 --- a/test/Db/NoRecordExistsTest.php +++ b/test/Db/NoRecordExistsTest.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator\Db; +use PHPUnit\Framework\TestCase; use Zend\Validator\Db\NoRecordExists; use Zend\Db\Adapter\ParameterContainer; use ArrayObject; +use Zend\Validator\Exception\RuntimeException; /** * @group Zend_Validator */ -class NoRecordExistsTest extends \PHPUnit_Framework_TestCase +class NoRecordExistsTest extends TestCase { /** * Return a Mock object for a Db result with rows @@ -180,10 +182,8 @@ public function testExcludeWithStringNoRecord() public function testThrowsExceptionWithNoAdapter() { $validator = new NoRecordExists('users', 'field1', 'id != 1'); - $this->setExpectedException( - 'Zend\Validator\Exception\RuntimeException', - 'No database adapter present' - ); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('No database adapter present'); $validator->isValid('nosuchvalue'); } diff --git a/test/Db/RecordExistsTest.php b/test/Db/RecordExistsTest.php index a2bd5fae1..623395c50 100644 --- a/test/Db/RecordExistsTest.php +++ b/test/Db/RecordExistsTest.php @@ -10,16 +10,18 @@ namespace ZendTest\Validator\Db; use ArrayObject; +use PHPUnit\Framework\TestCase; use Zend\Db\Adapter\Adapter; use Zend\Db\Adapter\ParameterContainer; use Zend\Db\Sql\Sql; use Zend\Validator\Db\RecordExists; use ZendTest\Validator\Db\TestAsset\TrustingSql92Platform; +use Zend\Validator\Exception\RuntimeException; /** * @group Zend_Validator */ -class RecordExistsTest extends \PHPUnit_Framework_TestCase +class RecordExistsTest extends TestCase { /** * Return a Mock object for a Db result with rows @@ -199,10 +201,8 @@ public function testExcludeConstructor() public function testThrowsExceptionWithNoAdapter() { $validator = new RecordExists('users', 'field1', 'id != 1'); - $this->setExpectedException( - 'Zend\Validator\Exception\RuntimeException', - 'No database adapter present' - ); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('No database adapter present'); $validator->isValid('nosuchvalue'); } diff --git a/test/DigitsTest.php b/test/DigitsTest.php index 8927d2dce..5efb7f9d3 100644 --- a/test/DigitsTest.php +++ b/test/DigitsTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Digits; /** * @group Zend_Validator */ -class DigitsTest extends \PHPUnit_Framework_TestCase +class DigitsTest extends TestCase { /** * @var Digits diff --git a/test/EmailAddressTest.php b/test/EmailAddressTest.php index ef3a84919..14fb94adf 100644 --- a/test/EmailAddressTest.php +++ b/test/EmailAddressTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\EmailAddress; use Zend\Validator\Hostname; /** * @group Zend_Validator */ -class EmailAddressTest extends \PHPUnit_Framework_TestCase +class EmailAddressTest extends TestCase { /** * @var EmailAddress diff --git a/test/ExplodeTest.php b/test/ExplodeTest.php index 47b45e875..0bbb275f3 100644 --- a/test/ExplodeTest.php +++ b/test/ExplodeTest.php @@ -9,19 +9,22 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Explode; use Zend\Validator\Regex; use Zend\Validator\Callback; +use Zend\Validator\Exception\RuntimeException; /** * @group Zend_Validator */ -class ExplodeTest extends \PHPUnit_Framework_TestCase +class ExplodeTest extends TestCase { public function testRaisesExceptionWhenValidatorIsMissing() { $validator = new Explode(); - $this->setExpectedException('Zend\Validator\Exception\RuntimeException', 'validator'); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('validator'); $validator->isValid('foo,bar'); } @@ -126,12 +129,10 @@ public function testSetValidatorAsArray() ); } - /** - * @expectedException \Zend\Validator\Exception\RuntimeException - */ public function testSetValidatorMissingName() { $validator = new Explode(); + $this->expectException(RuntimeException::class); $validator->setValidator( [ 'options' => [] @@ -139,12 +140,10 @@ public function testSetValidatorMissingName() ); } - /** - * @expectedException \Zend\Validator\Exception\RuntimeException - */ public function testSetValidatorInvalidParam() { $validator = new Explode(); + $this->expectException(RuntimeException::class); $validator->setValidator('inarray'); } diff --git a/test/File/CountTest.php b/test/File/CountTest.php index ac5f4f18e..6ba829acc 100644 --- a/test/File/CountTest.php +++ b/test/File/CountTest.php @@ -9,14 +9,15 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; -use Zend\Validator; use ReflectionClass; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class CountTest extends \PHPUnit_Framework_TestCase +class CountTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -71,7 +72,8 @@ public function testGetMin() public function testGetMinGreaterThanOrEqualThrowsException() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\Count(['min' => 5, 'max' => 1]); } @@ -86,7 +88,8 @@ public function testSetMin() $validator->setMin(100); $this->assertEquals(100, $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setMin(20000); } @@ -100,7 +103,8 @@ public function testGetMax() $validator = new File\Count(['min' => 1, 'max' => 100]); $this->assertEquals(100, $validator->getMax()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\Count(['min' => 5, 'max' => 1]); } @@ -147,10 +151,8 @@ public function invalidMinMaxValues() public function testSettingMaxWithInvalidArgumentRaisesException($max) { $validator = new File\Count(['min' => 1000, 'max' => 10000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMax($max); } @@ -171,10 +173,8 @@ public function testCanSetMinUsingAnArrayWithAMinKey() public function testSettingMinWithInvalidArgumentRaisesException($min) { $validator = new File\Count(['min' => 1000, 'max' => 10000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMin($min); } diff --git a/test/File/Crc32Test.php b/test/File/Crc32Test.php index 71c9d4f01..9d0ae01bf 100644 --- a/test/File/Crc32Test.php +++ b/test/File/Crc32Test.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class Crc32Test extends \PHPUnit_Framework_TestCase +class Crc32Test extends TestCase { /** * @return array @@ -215,7 +217,7 @@ public function testShouldThrowInvalidArgumentExceptionForArrayValueNotInFilesFo { $validator = new File\Crc32(); $invalidArray = ['foo' => 'bar']; - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $validator->isValid($invalidArray); } } diff --git a/test/File/ExcludeExtensionTest.php b/test/File/ExcludeExtensionTest.php index fecb8a8ca..5ac2a2243 100644 --- a/test/File/ExcludeExtensionTest.php +++ b/test/File/ExcludeExtensionTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class ExcludeExtensionTest extends \PHPUnit_Framework_TestCase +class ExcludeExtensionTest extends TestCase { /** * @return array @@ -186,10 +188,8 @@ public function testIsValidRaisesExceptionWithArrayNotInFilesFormat() $validator = new File\ExcludeExtension('12345'); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } diff --git a/test/File/ExcludeMimeTypeTest.php b/test/File/ExcludeMimeTypeTest.php index 169f97832..dde57dfb9 100644 --- a/test/File/ExcludeMimeTypeTest.php +++ b/test/File/ExcludeMimeTypeTest.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File\ExcludeMimeType; +use Zend\Validator\Exception\InvalidArgumentException; /** * ExcludeMimeType testbed * * @group Zend_Validator */ -class ExcludeMimeTypeTest extends \PHPUnit_Framework_TestCase +class ExcludeMimeTypeTest extends TestCase { /** * @return array @@ -172,10 +174,8 @@ public function testIsValidRaisesExceptionWithArrayNotInFilesFormat() { $validator = new ExcludeMimeType('image\gif'); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } } diff --git a/test/File/ExistsTest.php b/test/File/ExistsTest.php index 84f14fb16..90edf7751 100644 --- a/test/File/ExistsTest.php +++ b/test/File/ExistsTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class ExistsTest extends \PHPUnit_Framework_TestCase +class ExistsTest extends TestCase { /** * @return array @@ -161,10 +163,8 @@ public function testIsValidShouldThrowInvalidArgumentExceptionForArrayNotInFiles { $validator = new File\Exists(); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } @@ -188,10 +188,8 @@ public function invalidDirectoryArguments() public function testAddDirectoryShouldRaiseExceptionForInvalidArgument($value) { $validator = new File\Exists(); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->addDirectory($value); } } diff --git a/test/File/ExtensionTest.php b/test/File/ExtensionTest.php index 8627d280d..3b6231f19 100644 --- a/test/File/ExtensionTest.php +++ b/test/File/ExtensionTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class ExtensionTest extends \PHPUnit_Framework_TestCase +class ExtensionTest extends TestCase { /** * @return array @@ -188,10 +190,8 @@ public function testIsValidRaisesExceptionForArrayNotInFilesFormat() { $validator = new File\Extension('foo'); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } } diff --git a/test/File/FilesSizeTest.php b/test/File/FilesSizeTest.php index 52852b80a..48bb2b5e5 100644 --- a/test/File/FilesSizeTest.php +++ b/test/File/FilesSizeTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; use Zend\Validator; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class FilesSizeTest extends \PHPUnit_Framework_TestCase +class FilesSizeTest extends TestCase { /** @var bool */ public $multipleOptionsDetected; @@ -86,7 +88,8 @@ public function testGetMin() $validator = new File\FilesSize(['min' => 1, 'max' => 100]); $this->assertEquals('1B', $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\FilesSize(['min' => 100, 'max' => 1]); } @@ -101,7 +104,8 @@ public function testSetMin() $validator->setMin(100); $this->assertEquals('100B', $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setMin(20000); } @@ -123,7 +127,8 @@ public function testGetMax() $test = $validator->getMax(); $this->assertEquals('2000', $test); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\FilesSize(['min' => 100, 'max' => 1]); } @@ -226,13 +231,10 @@ public function testFilesFormat() ])); } - /** - * @expectedException InvalidArgumentException - */ public function testIllegalFilesFormat() { $validator = new File\FilesSize(['min' => 0, 'max' => 2000]); - + $this->expectException(InvalidArgumentException::class); $validator->isValid([ [ 'error' => 0 @@ -268,10 +270,8 @@ public function testIsValidRaisesExceptionForArrayValueNotInFilesFormat() { $validator = new File\FilesSize(['min' => 0, 'max' => 2000]); $value = [['foo' => 'bar']]; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } } diff --git a/test/File/HashTest.php b/test/File/HashTest.php index 138bb07cc..2288e34b2 100644 --- a/test/File/HashTest.php +++ b/test/File/HashTest.php @@ -9,15 +9,17 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; use ReflectionProperty; +use Zend\Validator\Exception\InvalidArgumentException; /** * Hash testbed * * @group Zend_Validator */ -class HashTest extends \PHPUnit_Framework_TestCase +class HashTest extends TestCase { /** * @return array @@ -203,7 +205,8 @@ public function invalidHashTypes() public function testAddHashRaisesExceptionForInvalidType($value) { $validator = new File\Hash('12345'); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'False parameter given'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('False parameter given'); $validator->addHash($value); } @@ -212,10 +215,8 @@ public function testAddHashRaisesExceptionWithInvalidAlgorithm() $validator = new File\Hash('12345'); $algorithm = 'foobar123'; $options = ['algorithm' => $algorithm]; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - sprintf("Unknown algorithm '%s'", $algorithm) - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage(sprintf("Unknown algorithm '%s'", $algorithm)); $validator->addHash($options); } @@ -223,10 +224,8 @@ public function testIsValidRaisesExceptionForArrayValueNotInFilesFormat() { $validator = new File\Hash('12345'); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } diff --git a/test/File/ImageSizeTest.php b/test/File/ImageSizeTest.php index 52b87a9df..e9d7a5c08 100644 --- a/test/File/ImageSizeTest.php +++ b/test/File/ImageSizeTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class ImageSizeTest extends \PHPUnit_Framework_TestCase +class ImageSizeTest extends TestCase { /** * @return array @@ -141,7 +143,8 @@ public function testGetImageMin() $validator = new File\ImageSize(['minWidth' => 1, 'minHeight' => 10, 'maxWidth' => 100, 'maxHeight' => 1000]); $this->assertEquals(['minWidth' => 1, 'minHeight' => 10], $validator->getImageMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\ImageSize(['minWidth' => 1000, 'minHeight' => 100, 'maxWidth' => 10, 'maxHeight' => 1]); } @@ -164,7 +167,8 @@ public function testSetImageMin() $validator->setImageMin(['minWidth' => 9, 'minHeight' => 100]); $this->assertEquals(['minWidth' => 9, 'minHeight' => 100], $validator->getImageMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setImageMin(['minWidth' => 20000, 'minHeight' => 20000]); } @@ -183,10 +187,8 @@ public function testGetImageMax() ]); $this->assertEquals(['maxWidth' => 1000, 'maxHeight' => 10000], $validator->getImageMax()); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'greater than or equal' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\ImageSize([ 'minWidth' => 10000, 'minHeight' => 1000, @@ -220,7 +222,8 @@ public function testSetImageMax() $validator->setImageMax(['maxWidth' => 120]); $this->assertEquals(['maxWidth' => 120, 'maxHeight' => 1100], $validator->getImageMax()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator->setImageMax(['maxWidth' => 10000, 'maxHeight' => 1]); } @@ -251,7 +254,8 @@ public function testSetImageWidth() $validator->setImageWidth(['minWidth' => 2000, 'maxWidth' => 2200]); $this->assertEquals(['minWidth' => 2000, 'maxWidth' => 2200], $validator->getImageWidth()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setImageWidth(['minWidth' => 20000, 'maxWidth' => 200]); } @@ -282,7 +286,8 @@ public function testSetImageHeight() $validator->setImageHeight(['minHeight' => 2000, 'maxHeight' => 2200]); $this->assertEquals(['minHeight' => 2000, 'maxHeight' => 2200], $validator->getImageHeight()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setImageHeight(['minHeight' => 20000, 'maxHeight' => 200]); } @@ -345,10 +350,8 @@ public function testIsValidRaisesExceptionForArrayNotInFilesFormat() ]); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } diff --git a/test/File/IsCompressedTest.php b/test/File/IsCompressedTest.php index 3cc6c84bf..ae6bc43ea 100644 --- a/test/File/IsCompressedTest.php +++ b/test/File/IsCompressedTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; /** @@ -16,7 +17,7 @@ * * @group Zend_Validator */ -class IsCompressedTest extends \PHPUnit_Framework_TestCase +class IsCompressedTest extends TestCase { protected function getMagicMime() { diff --git a/test/File/IsImageTest.php b/test/File/IsImageTest.php index 1e1faf35d..d54a94b9b 100644 --- a/test/File/IsImageTest.php +++ b/test/File/IsImageTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; /** @@ -16,7 +17,7 @@ * * @group Zend_Validator */ -class IsImageTest extends \PHPUnit_Framework_TestCase +class IsImageTest extends TestCase { protected function getMagicMime() { diff --git a/test/File/Md5Test.php b/test/File/Md5Test.php index 941cc49c3..d6539c66f 100644 --- a/test/File/Md5Test.php +++ b/test/File/Md5Test.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * Md5 testbed * * @group Zend_Validator */ -class Md5Test extends \PHPUnit_Framework_TestCase +class Md5Test extends TestCase { /** * @return array @@ -229,7 +231,7 @@ public function testIsValidShouldThrowInvalidArgumentExceptionForArrayNotInFiles { $validator = new File\Md5(); $value = ['foo' => 'bar']; - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $validator->isValid($value); } } diff --git a/test/File/MimeTypeTest.php b/test/File/MimeTypeTest.php index ba5bfb552..14d2075fd 100644 --- a/test/File/MimeTypeTest.php +++ b/test/File/MimeTypeTest.php @@ -9,16 +9,18 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; -use Zend\Validator; use ReflectionProperty; +use Zend\Validator\Exception\InvalidMagicMimeFileException; +use Zend\Validator\Exception\InvalidArgumentException; /** * MimeType testbed * * @group Zend_Validator */ -class MimeTypeTest extends \PHPUnit_Framework_TestCase +class MimeTypeTest extends TestCase { /** * @return array @@ -149,7 +151,8 @@ public function testSetAndGetMagicFile() $this->assertEquals($magic, $mimetype); } - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'could not be'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('could not be'); $validator->setMagicFile('/unknown/magic/file'); } @@ -159,10 +162,8 @@ public function testSetMagicFileWithinConstructor() $this->markTestSkipped('This PHP Version has no finfo installed'); } - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidMagicMimeFileException', - 'could not be used by ext/finfo' - ); + $this->expectException(InvalidMagicMimeFileException::class); + $this->expectExceptionMessage('could not be used by ext/finfo'); $validator = new File\MimeType(['image/gif', 'magicFile' => __FILE__]); } @@ -287,10 +288,8 @@ public function invalidMimeTypeTypes() public function testAddingMimeTypeWithInvalidTypeRaisesException($type) { $validator = new File\MimeType(); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->addMimeType($type); } @@ -313,10 +312,8 @@ public function testIsValidRaisesExceptionWithArrayNotInFilesFormat() { $validator = new File\MimeType('image\gif'); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } } diff --git a/test/File/NotExistsTest.php b/test/File/NotExistsTest.php index 4af9c58f2..ed0ebabbf 100644 --- a/test/File/NotExistsTest.php +++ b/test/File/NotExistsTest.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * NotExists testbed * * @group Zend_Validator */ -class NotExistsTest extends \PHPUnit_Framework_TestCase +class NotExistsTest extends TestCase { /** * @return array @@ -144,10 +146,8 @@ public function testIsValidShouldThrowInvalidArgumentExceptionForArrayNotInFiles { $validator = new File\NotExists(); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } @@ -171,7 +171,7 @@ public function invalidDirectoryArguments() public function testAddingDirectoryUsingInvalidTypeRaisesException($value) { $validator = new File\NotExists(); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $validator->addDirectory($value); } } diff --git a/test/File/Sha1Test.php b/test/File/Sha1Test.php index 4eab75304..e1a27024f 100644 --- a/test/File/Sha1Test.php +++ b/test/File/Sha1Test.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; +use Zend\Validator\Exception\InvalidArgumentException; /** * Sha1 testbed * * @group Zend_Validator */ -class Sha1Test extends \PHPUnit_Framework_TestCase +class Sha1Test extends TestCase { /** * @return array @@ -216,10 +218,8 @@ public function testIsValidShouldThrowInvalidArgumentExceptionForArrayNotInFiles { $validator = new File\Sha1(); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } } diff --git a/test/File/SizeTest.php b/test/File/SizeTest.php index 3e4194d2c..52dc015e5 100644 --- a/test/File/SizeTest.php +++ b/test/File/SizeTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; -use Zend\Validator; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class SizeTest extends \PHPUnit_Framework_TestCase +class SizeTest extends TestCase { /** * @return array @@ -86,7 +87,8 @@ public function testGetMin() $validator = new File\Size(['min' => 1, 'max' => 100, 'useByteString' => false]); $this->assertEquals(1, $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\Size(['min' => 100, 'max' => 1]); } @@ -105,7 +107,8 @@ public function testSetMin() $validator->setMin(100); $this->assertEquals(100, $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setMin(20000); } @@ -125,7 +128,8 @@ public function testGetMax() $validator = new File\Size(2000); $this->assertEquals('1.95kB', $validator->getMax()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\Size(['min' => 100, 'max' => 1]); } @@ -240,10 +244,8 @@ public function invalidMinMaxValues() public function testSetMinWithInvalidArgument($value) { $validator = new File\FilesSize(['min' => 0, 'max' => 2000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMin($value); } @@ -253,10 +255,8 @@ public function testSetMinWithInvalidArgument($value) public function testSetMaxWithInvalidArgument($value) { $validator = new File\FilesSize(['min' => 0, 'max' => 2000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMax($value); } } diff --git a/test/File/UploadFileTest.php b/test/File/UploadFileTest.php index 42af2ea92..e46825f4f 100644 --- a/test/File/UploadFileTest.php +++ b/test/File/UploadFileTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\File; /** * @group Zend_Validator */ -class UploadFileTest extends \PHPUnit_Framework_TestCase +class UploadFileTest extends TestCase { public function uploadErrorsTestDataProvider() { @@ -69,7 +71,8 @@ public function testBasic($fileInfo, $messageKey) public function testRaisesExceptionWhenValueArrayIsBad() { $validator = new File\UploadFile(); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', '$_FILES format'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('$_FILES format'); $validator->isValid(['foo', 'bar']); } diff --git a/test/File/UploadTest.php b/test/File/UploadTest.php index 51d55aeb0..c6a969dea 100644 --- a/test/File/UploadTest.php +++ b/test/File/UploadTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\File; /** * @group Zend_Validator */ -class UploadTest extends \PHPUnit_Framework_TestCase +class UploadTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -171,7 +173,8 @@ public function testGetFiles() $this->assertEquals($files, $validator->getFiles('test1')); $this->assertEquals($files1, $validator->getFiles('test3')); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'was not found'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('was not found'); $this->assertEquals([], $validator->getFiles('test5')); } diff --git a/test/File/WordCountTest.php b/test/File/WordCountTest.php index 805e1c755..b4892abf3 100644 --- a/test/File/WordCountTest.php +++ b/test/File/WordCountTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Validator\File; +use PHPUnit\Framework\TestCase; use Zend\Validator\File; -use Zend\Validator; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class WordCountTest extends \PHPUnit_Framework_TestCase +class WordCountTest extends TestCase { /** * @return array @@ -78,7 +79,8 @@ public function testGetMin() $validator = new File\WordCount(['min' => 1, 'max' => 5]); $this->assertEquals(1, $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\WordCount(['min' => 5, 'max' => 1]); } @@ -93,7 +95,8 @@ public function testSetMin() $validator->setMin(100); $this->assertEquals(100, $validator->getMin()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'less than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('less than or equal'); $validator->setMin(20000); } @@ -107,7 +110,8 @@ public function testGetMax() $validator = new File\WordCount(['min' => 1, 'max' => 100]); $this->assertEquals(100, $validator->getMax()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'greater than or equal'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('greater than or equal'); $validator = new File\WordCount(['min' => 5, 'max' => 1]); } @@ -184,10 +188,8 @@ public function invalidMinMaxValues() public function testSettingMinValueRaisesExceptionForInvalidType($value) { $validator = new File\WordCount(['min' => 1000, 'max' => 10000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMin($value); } @@ -207,10 +209,8 @@ public function testCanSetMaxValueUsingOptionsArray() public function testSettingMaxValueRaisesExceptionForInvalidType($value) { $validator = new File\WordCount(['min' => 1000, 'max' => 10000]); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Invalid options to validator provided' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid options to validator provided'); $validator->setMax($value); } @@ -218,10 +218,8 @@ public function testIsValidShouldThrowInvalidArgumentExceptionForArrayNotInFiles { $validator = new File\WordCount(['min' => 1, 'max' => 10000]); $value = ['foo' => 'bar']; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'Value array must be in $_FILES format' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value array must be in $_FILES format'); $validator->isValid($value); } diff --git a/test/GPSPointTest.php b/test/GPSPointTest.php index 67e36e2f2..7d7942c7c 100644 --- a/test/GPSPointTest.php +++ b/test/GPSPointTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\GpsPoint; /** * @group Zend_Validator */ -class GPSPointTest extends \PHPUnit_Framework_TestCase +class GPSPointTest extends TestCase { /** diff --git a/test/GreaterThanTest.php b/test/GreaterThanTest.php index ef4c62a26..5698b7e81 100644 --- a/test/GreaterThanTest.php +++ b/test/GreaterThanTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\GreaterThan; /** * @group Zend_Validator */ -class GreaterThanTest extends \PHPUnit_Framework_TestCase +class GreaterThanTest extends TestCase { /** * Ensures that the validator follows expected behavior diff --git a/test/HexTest.php b/test/HexTest.php index ff57d766e..df1b1fc8c 100644 --- a/test/HexTest.php +++ b/test/HexTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Hex; /** * @group Zend_Validator */ -class HexTest extends \PHPUnit_Framework_TestCase +class HexTest extends TestCase { /** * @var Hex diff --git a/test/HostnameTest.php b/test/HostnameTest.php index a29c50e8e..5c27c44cb 100644 --- a/test/HostnameTest.php +++ b/test/HostnameTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Hostname; /** * @group Zend_Validator */ -class HostnameTest extends \PHPUnit_Framework_TestCase +class HostnameTest extends TestCase { /** * Default instance created for all test methods diff --git a/test/IbanTest.php b/test/IbanTest.php index 8c57f177d..4559a3e1e 100644 --- a/test/IbanTest.php +++ b/test/IbanTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\Iban as IbanValidator; /** * @group Zend_Validator */ -class IbanTest extends \PHPUnit_Framework_TestCase +class IbanTest extends TestCase { public function ibanDataProvider() { @@ -114,7 +116,8 @@ public function testSettingAndGettingCountryCode() $validator->setCountryCode('DE'); $this->assertEquals('DE', $validator->getCountryCode()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'ISO 3166-1'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('ISO 3166-1'); $validator->setCountryCode('foo'); } @@ -123,7 +126,8 @@ public function testInstanceWithCountryCode() $validator = new IbanValidator(['country_code' => 'AT']); $this->assertEquals('AT', $validator->getCountryCode()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'ISO 3166-1'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('ISO 3166-1'); $validator = new IbanValidator(['country_code' => 'BAR']); } diff --git a/test/IdenticalTest.php b/test/IdenticalTest.php index b25dc5d91..4ecacee8d 100644 --- a/test/IdenticalTest.php +++ b/test/IdenticalTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Stdlib\Parameters; use Zend\Validator\Identical; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class IdenticalTest extends \PHPUnit_Framework_TestCase +class IdenticalTest extends TestCase { /** @var Identical */ public $validator; @@ -264,7 +266,7 @@ public function testLiteralParameterWorksWhenContextIsProvided() */ public function testIsValidThrowsExceptionOnInvalidContext($context) { - $this->setExpectedException('Zend\\Validator\\Exception\\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $this->validator->isValid('john@doe.com', $context); } diff --git a/test/InArrayTest.php b/test/InArrayTest.php index 755813025..dfae23762 100644 --- a/test/InArrayTest.php +++ b/test/InArrayTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\InArray; +use Zend\Validator\Exception\RuntimeException; /** * @group Zend_Validator */ -class InArrayTest extends \PHPUnit_Framework_TestCase +class InArrayTest extends TestCase { /** @var InArray */ protected $validator; @@ -51,10 +53,8 @@ public function testGetHaystack() public function testUnsetHaystackRaisesException() { $validator = new InArray(); - $this->setExpectedException( - 'Zend\Validator\Exception\RuntimeException', - 'haystack option is mandatory' - ); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('haystack option is mandatory'); $validator->getHaystack(); } diff --git a/test/IpTest.php b/test/IpTest.php index deada137c..9f70f78f9 100644 --- a/test/IpTest.php +++ b/test/IpTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\Ip; /** * @group Zend_Validator */ -class IpTest extends \PHPUnit_Framework_TestCase +class IpTest extends TestCase { /** * @var Ip @@ -132,7 +134,8 @@ public function testVersionsAllowedIpvfuture() public function testNoValidation() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Nothing to validate'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Nothing to validate'); $this->validator->setOptions($this->options); } diff --git a/test/IsInstanceOfTest.php b/test/IsInstanceOfTest.php index ff36ab465..6f6408f91 100644 --- a/test/IsInstanceOfTest.php +++ b/test/IsInstanceOfTest.php @@ -9,8 +9,10 @@ namespace ZendTest\Validator; use DateTime; +use PHPUnit\Framework\TestCase; use ReflectionClass; use Zend\Validator; +use Zend\Validator\Exception\InvalidArgumentException; /** * @covers Zend\Validator\IsInstanceOf @@ -18,7 +20,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validator */ -class IsInstanceOfTest extends \PHPUnit_Framework_TestCase +class IsInstanceOfTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -27,17 +29,17 @@ class IsInstanceOfTest extends \PHPUnit_Framework_TestCase */ public function testBasic() { - $validator = new Validator\IsInstanceOf('DateTime'); + $validator = new Validator\IsInstanceOf(DateTime::class); $this->assertTrue($validator->isValid(new DateTime())); // True $this->assertFalse($validator->isValid(null)); // False $this->assertFalse($validator->isValid($this)); // False - $validator = new Validator\IsInstanceOf('Exception'); + $validator = new Validator\IsInstanceOf(\Exception::class); $this->assertTrue($validator->isValid(new \Exception())); // True $this->assertFalse($validator->isValid(null)); // False $this->assertFalse($validator->isValid($this)); // False - $validator = new Validator\IsInstanceOf('PHPUnit_Framework_TestCase'); + $validator = new Validator\IsInstanceOf(TestCase::class); $this->assertTrue($validator->isValid($this)); // True } @@ -48,7 +50,7 @@ public function testBasic() */ public function testGetMessages() { - $validator = new Validator\IsInstanceOf('DateTime'); + $validator = new Validator\IsInstanceOf(DateTime::class); $this->assertEquals([], $validator->getMessages()); } @@ -59,13 +61,13 @@ public function testGetMessages() */ public function testGetClassName() { - $validator = new Validator\IsInstanceOf('DateTime'); - $this->assertEquals('DateTime', $validator->getClassName()); + $validator = new Validator\IsInstanceOf(DateTime::class); + $this->assertEquals(DateTime::class, $validator->getClassName()); } public function testEqualsMessageTemplates() { - $validator = new Validator\IsInstanceOf('DateTime'); + $validator = new Validator\IsInstanceOf(DateTime::class); $reflection = new ReflectionClass($validator); $property = $reflection->getProperty('messageTemplates'); @@ -79,7 +81,7 @@ public function testEqualsMessageTemplates() public function testEqualsMessageVariables() { - $validator = new Validator\IsInstanceOf('\DateTime'); + $validator = new Validator\IsInstanceOf(DateTime::class); $reflection = new ReflectionClass($validator); $property = $reflection->getProperty('messageVariables'); @@ -93,8 +95,8 @@ public function testEqualsMessageVariables() public function testPassTraversableToConstructor() { - $validator = new Validator\IsInstanceOf(new \ArrayIterator(['className' => 'DateTime'])); - $this->assertEquals('DateTime', $validator->getClassName()); + $validator = new Validator\IsInstanceOf(new \ArrayIterator(['className' => DateTime::class])); + $this->assertEquals(DateTime::class, $validator->getClassName()); $this->assertTrue($validator->isValid(new DateTime())); $this->assertFalse($validator->isValid(null)); $this->assertFalse($validator->isValid($this)); @@ -102,9 +104,10 @@ public function testPassTraversableToConstructor() public function testPassOptionsWithoutClassNameKey() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Missing option "className"'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Missing option "className"'); - $options = ['NotClassNameKey' => 'DateTime']; + $options = ['NotClassNameKey' => DateTime::class]; $validator = new Validator\IsInstanceOf($options); } } diff --git a/test/IsbnTest.php b/test/IsbnTest.php index fb5946311..2b4e21161 100644 --- a/test/IsbnTest.php +++ b/test/IsbnTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\Isbn; /** * @group Zend_Validator */ -class IsbnTest extends \PHPUnit_Framework_TestCase +class IsbnTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -64,7 +66,8 @@ public function testType() $validator->setType(Isbn::ISBN13); $this->assertEquals(Isbn::ISBN13, $validator->getType()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Invalid ISBN type'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid ISBN type'); $validator->setType('X'); } @@ -86,7 +89,8 @@ public function testSeparator() $validator->setSeparator(''); $this->assertEquals('', $validator->getSeparator()); - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Invalid ISBN separator'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid ISBN separator'); $validator->setSeparator('X'); } diff --git a/test/LessThanTest.php b/test/LessThanTest.php index 7e910c2fa..86ea58400 100644 --- a/test/LessThanTest.php +++ b/test/LessThanTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\LessThan; /** * @group Zend_Validator */ -class LessThanTest extends \PHPUnit_Framework_TestCase +class LessThanTest extends TestCase { /** * Ensures that the validator follows expected behavior diff --git a/test/MessageTest.php b/test/MessageTest.php index d40607379..060ce8f29 100644 --- a/test/MessageTest.php +++ b/test/MessageTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\StringLength; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class MessageTest extends \PHPUnit_Framework_TestCase +class MessageTest extends TestCase { /** * @var StringLength @@ -141,10 +143,8 @@ public function testSetMessageExceptionInvalidKey() { $keyInvalid = 'invalidKey'; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'No message template exists for key' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('No message template exists for key'); $this->validator->setMessage( 'Your value is too long', $keyInvalid @@ -219,10 +219,8 @@ public function testGetPropertyException() $messages = $this->validator->getMessages(); $this->assertEquals('Your value is too long', current($messages)); - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'No property exists by the name ' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('No property exists by the name '); $this->validator->unknownProperty; } diff --git a/test/NotEmptyTest.php b/test/NotEmptyTest.php index 6d8b4d687..650d6e5f8 100644 --- a/test/NotEmptyTest.php +++ b/test/NotEmptyTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use stdClass; +use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\NotEmpty; /** * @group Zend_Validator */ -class NotEmptyTest extends \PHPUnit_Framework_TestCase +class NotEmptyTest extends TestCase { /** * @var NotEmpty @@ -814,7 +816,8 @@ public function configObjectProvider() */ public function testSettingFalseType() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Unknown'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown'); $this->validator->setType(true); } diff --git a/test/RegexTest.php b/test/RegexTest.php index bec119f3a..8545b82ad 100644 --- a/test/RegexTest.php +++ b/test/RegexTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Regex; use ReflectionProperty; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class RegexTest extends \PHPUnit_Framework_TestCase +class RegexTest extends TestCase { /** * Ensures that the validator follows expected behavior @@ -71,7 +73,8 @@ public function testGetPattern() */ public function testBadPattern() { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException', 'Internal error parsing'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Internal error parsing'); $validator = new Regex('/'); } @@ -154,14 +157,14 @@ public function invalidConstructorArgumentsProvider() */ public function testConstructorRaisesExceptionWhenProvidedInvalidArguments($options) { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $validator = new Regex($options); } public function testConstructorRaisesExceptionWhenProvidedWithInvalidOptionsArray() { $options = ['foo' => 'bar']; - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $validator = new Regex($options); } diff --git a/test/Sitemap/ChangefreqTest.php b/test/Sitemap/ChangefreqTest.php index a2b09b5d4..88610affb 100644 --- a/test/Sitemap/ChangefreqTest.php +++ b/test/Sitemap/ChangefreqTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator\Sitemap; +use PHPUnit\Framework\TestCase; use Zend\Validator\Sitemap\Changefreq; /** * @group Zend_Validator */ -class ChangefreqTest extends \PHPUnit_Framework_TestCase +class ChangefreqTest extends TestCase { /** * @var Changefreq diff --git a/test/Sitemap/LastmodTest.php b/test/Sitemap/LastmodTest.php index 13a75c70d..9fe4e90cf 100644 --- a/test/Sitemap/LastmodTest.php +++ b/test/Sitemap/LastmodTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator\Sitemap; +use PHPUnit\Framework\TestCase; use Zend\Validator\Sitemap\Lastmod; /** * @group Zend_Validator */ -class LastmodTest extends \PHPUnit_Framework_TestCase +class LastmodTest extends TestCase { /** * @var Lastmod diff --git a/test/Sitemap/LocTest.php b/test/Sitemap/LocTest.php index e72abe878..30c0175a9 100644 --- a/test/Sitemap/LocTest.php +++ b/test/Sitemap/LocTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator\Sitemap; +use PHPUnit\Framework\TestCase; use Zend\Validator\Sitemap\Loc; /** * @group Zend_Validator */ -class LocTest extends \PHPUnit_Framework_TestCase +class LocTest extends TestCase { /** * @var Loc diff --git a/test/Sitemap/PriorityTest.php b/test/Sitemap/PriorityTest.php index e9f6dc197..7c03a78d1 100644 --- a/test/Sitemap/PriorityTest.php +++ b/test/Sitemap/PriorityTest.php @@ -9,12 +9,13 @@ namespace ZendTest\Validator\Sitemap; +use PHPUnit\Framework\TestCase; use Zend\Validator\Sitemap\Priority; /** * @group Zend_Validator */ -class PriorityTest extends \PHPUnit_Framework_TestCase +class PriorityTest extends TestCase { /** * @var Priority diff --git a/test/StaticValidatorTest.php b/test/StaticValidatorTest.php index 75fdac5d3..7597fd1e1 100644 --- a/test/StaticValidatorTest.php +++ b/test/StaticValidatorTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\AbstractValidator; use Zend\I18n\Validator\Alpha; use Zend\Validator\Between; @@ -18,7 +19,7 @@ /** * @group Zend_Validator */ -class StaticValidatorTest extends \PHPUnit_Framework_TestCase +class StaticValidatorTest extends TestCase { /** @var Alpha */ public $validator; @@ -161,7 +162,8 @@ public function invalidParameterizedData() */ public function testExecuteRaisesExceptionForIndexedOptionsArray($value, $validator, $options) { - $this->setExpectedException('InvalidArgumentException', 'options'); + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('options'); StaticValidator::execute($value, $validator, $options); } } diff --git a/test/StepTest.php b/test/StepTest.php index 1eb209373..cc109dec2 100644 --- a/test/StepTest.php +++ b/test/StepTest.php @@ -9,10 +9,11 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator; use ReflectionMethod; -class StepTest extends \PHPUnit_Framework_TestCase +class StepTest extends TestCase { /** * Step object diff --git a/test/StringLengthTest.php b/test/StringLengthTest.php index 4f7c5acd3..ac47ccfd9 100644 --- a/test/StringLengthTest.php +++ b/test/StringLengthTest.php @@ -9,12 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\StringLength; +use Zend\Validator\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class StringLengthTest extends \PHPUnit_Framework_TestCase +class StringLengthTest extends TestCase { /** * @var StringLength @@ -110,10 +112,8 @@ public function testSetMinExceptionGreaterThanMax() $max = 1; $min = 2; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'The minimum must be less than or equal to the maximum length, but' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The minimum must be less than or equal to the maximum length, but'); $this->validator->setMax($max)->setMin($min); } @@ -127,10 +127,8 @@ public function testSetMaxExceptionLessThanMin() $max = 1; $min = 2; - $this->setExpectedException( - 'Zend\Validator\Exception\InvalidArgumentException', - 'The maximum must be greater than or equal to the minimum length, but ' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The maximum must be greater than or equal to the minimum length, but '); $this->validator->setMin($min)->setMax($max); } diff --git a/test/TimezoneTest.php b/test/TimezoneTest.php index e00237ebd..d9c3a0ff4 100644 --- a/test/TimezoneTest.php +++ b/test/TimezoneTest.php @@ -9,14 +9,16 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\Timezone; +use Zend\Validator\Exception\InvalidArgumentException; /** * Tests for {@see \Zend\Validator\Timezone} * * @covers \Zend\Validator\Timezone */ -class TimezoneTest extends \PHPUnit_Framework_TestCase +class TimezoneTest extends TestCase { /** * @var Timezone @@ -272,7 +274,7 @@ public function testTypeThroughConstructor() */ public function testRejectsInvalidIntType($invalidType) { - $this->setExpectedException('Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); new Timezone(['type' => $invalidType]); } @@ -305,7 +307,7 @@ protected function checkValidationValue($value, $valid) */ protected function checkExpectedException($value) { - $this->setExpectedException('\Zend\Validator\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $this->validator->setType($value); } diff --git a/test/UriTest.php b/test/UriTest.php index 5df78a7b6..9269f8970 100644 --- a/test/UriTest.php +++ b/test/UriTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator; use Zend\Uri\Exception\InvalidArgumentException; /** * @group Zend_Validator */ -class UriTest extends \PHPUnit_Framework_TestCase +class UriTest extends TestCase { /** * @var \Zend\Validator\Uri @@ -142,19 +143,15 @@ public function testUriHandlerCanBeSpecifiedAsString() $this->assertInstanceOf('Zend\Uri\Http', $this->validator->getUriHandler()); } - /** - * @expectedException Zend\Validator\Exception\InvalidArgumentException - */ public function testUriHandlerStringInvalidClassThrowsException() { + $this->expectException(Validator\Exception\InvalidArgumentException::class); $this->validator->setUriHandler('stdClass'); } - /** - * @expectedException Zend\Validator\Exception\InvalidArgumentException - */ public function testUriHandlerInvalidTypeThrowsException() { + $this->expectException(Validator\Exception\InvalidArgumentException::class); $this->validator->setUriHandler(new \stdClass()); } diff --git a/test/UuidTest.php b/test/UuidTest.php index fbd7e9d38..c4fa538d0 100644 --- a/test/UuidTest.php +++ b/test/UuidTest.php @@ -7,7 +7,7 @@ namespace ZendTest\Validator; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use stdClass; use Zend\Validator\Uuid; diff --git a/test/ValidatorChainTest.php b/test/ValidatorChainTest.php index e2e34b660..31fcfb1fa 100644 --- a/test/ValidatorChainTest.php +++ b/test/ValidatorChainTest.php @@ -9,16 +9,18 @@ namespace ZendTest\Validator; +use PHPUnit\Framework\TestCase; use Zend\Validator\AbstractValidator; use Zend\Validator\Between; use Zend\Validator\NotEmpty; use Zend\Validator\StaticValidator; use Zend\Validator\ValidatorChain; +use Zend\ServiceManager\Exception\ServiceNotFoundException; /** * @group Zend_Validator */ -class ValidatorChainTest extends \PHPUnit_Framework_TestCase +class ValidatorChainTest extends TestCase { /** * @var ValidatorChain @@ -107,7 +109,7 @@ public function testBreakChainOnFailure() */ public function testStaticFactoryClassNotFound() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->expectException(ServiceNotFoundException::class); StaticValidator::execute('1234', 'UnknownValidator'); } diff --git a/test/ValidatorPluginManagerCompatibilityTest.php b/test/ValidatorPluginManagerCompatibilityTest.php index fb824d1a0..98de42cfd 100644 --- a/test/ValidatorPluginManagerCompatibilityTest.php +++ b/test/ValidatorPluginManagerCompatibilityTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Validator; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use ReflectionProperty; use Zend\Validator\Exception\RuntimeException; use Zend\Validator\ValidatorInterface; diff --git a/test/ValidatorPluginManagerFactoryTest.php b/test/ValidatorPluginManagerFactoryTest.php index 2bfbfd788..06ac39b5b 100644 --- a/test/ValidatorPluginManagerFactoryTest.php +++ b/test/ValidatorPluginManagerFactoryTest.php @@ -8,7 +8,7 @@ namespace ZendTest\Validator; use Interop\Container\ContainerInterface; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Validator\ValidatorInterface; use Zend\Validator\ValidatorPluginManager; use Zend\Validator\ValidatorPluginManagerFactory; diff --git a/test/ValidatorPluginManagerTest.php b/test/ValidatorPluginManagerTest.php index be18b80fe..09db5475d 100644 --- a/test/ValidatorPluginManagerTest.php +++ b/test/ValidatorPluginManagerTest.php @@ -10,6 +10,7 @@ namespace ZendTest\Validator; use Interop\Container\ContainerInterface; +use PHPUnit\Framework\TestCase; use Zend\Validator\Exception\RuntimeException; use Zend\Validator\ValidatorInterface; use Zend\Validator\ValidatorPluginManager; @@ -19,7 +20,7 @@ /** * @group Zend_Validator */ -class ValidatorPluginManagerTest extends \PHPUnit_Framework_TestCase +class ValidatorPluginManagerTest extends TestCase { public function setUp() { From 4ad882e6510dcf77c4447533558731a617b7b9f3 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Tue, 14 Mar 2017 23:15:03 +0100 Subject: [PATCH 07/23] Replace deprecated getMock() with createMock() or getMockBuilder() --- test/AbstractTest.php | 4 ++-- test/BarcodeTest.php | 5 +++-- test/Db/NoRecordExistsTest.php | 31 +++++++++++++++++++++---------- test/Db/RecordExistsTest.php | 30 ++++++++++++++++++++---------- test/ExplodeTest.php | 3 ++- test/UriTest.php | 14 +++++++------- test/ValidatorChainTest.php | 5 +++-- 7 files changed, 58 insertions(+), 34 deletions(-) diff --git a/test/AbstractTest.php b/test/AbstractTest.php index 06792107a..a7578ba3d 100644 --- a/test/AbstractTest.php +++ b/test/AbstractTest.php @@ -189,7 +189,7 @@ public function testInvokeProxiesToIsValid() public function testTranslatorMethods() { - $translatorMock = $this->getMock('ZendTest\Validator\TestAsset\Translator'); + $translatorMock = $this->createMock(TestAsset\Translator::class); $this->validator->setTranslator($translatorMock, 'foo'); $this->assertEquals($translatorMock, $this->validator->getTranslator()); @@ -209,7 +209,7 @@ public function testDefaultTranslatorMethods() $this->assertFalse($this->validator->hasTranslator()); - $translatorMock = $this->getMock('ZendTest\Validator\TestAsset\Translator'); + $translatorMock = $this->createMock(TestAsset\Translator::class); AbstractValidator::setDefaultTranslator($translatorMock, 'foo'); $this->assertEquals($translatorMock, AbstractValidator::getDefaultTranslator()); diff --git a/test/BarcodeTest.php b/test/BarcodeTest.php index 92029286d..e3124f37a 100644 --- a/test/BarcodeTest.php +++ b/test/BarcodeTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\TestCase; use Zend\Validator\Barcode; use Zend\Validator\Exception\InvalidArgumentException; +use Zend\Validator\Barcode\AdapterInterface; /** * \Zend\Barcode @@ -55,10 +56,10 @@ public function testSetAdapter() public function testSetCustomAdapter() { $barcode = new Barcode([ - 'adapter' => $this->getMock('Zend\Validator\Barcode\AdapterInterface') + 'adapter' => $this->createMock(AdapterInterface::class) ]); - $this->assertInstanceOf('Zend\Validator\Barcode\AdapterInterface', $barcode->getAdapter()); + $this->assertInstanceOf(AdapterInterface::class, $barcode->getAdapter()); } /** diff --git a/test/Db/NoRecordExistsTest.php b/test/Db/NoRecordExistsTest.php index 8147f847a..037c1c131 100644 --- a/test/Db/NoRecordExistsTest.php +++ b/test/Db/NoRecordExistsTest.php @@ -14,6 +14,11 @@ use Zend\Db\Adapter\ParameterContainer; use ArrayObject; use Zend\Validator\Exception\RuntimeException; +use Zend\Db\Adapter\Driver\ConnectionInterface; +use Zend\Db\Adapter\Driver\ResultInterface; +use Zend\Db\Adapter\Driver\StatementInterface; +use Zend\Db\Adapter\Driver\DriverInterface; +use Zend\Db\Adapter\Adapter; /** * @group Zend_Validator @@ -28,18 +33,18 @@ class NoRecordExistsTest extends TestCase protected function getMockHasResult() { // mock the adapter, driver, and parts - $mockConnection = $this->getMock('Zend\Db\Adapter\Driver\ConnectionInterface'); + $mockConnection = $this->createMock(ConnectionInterface::class); // Mock has result $mockHasResultRow = new ArrayObject(); $mockHasResultRow->one = 'one'; - $mockHasResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface'); + $mockHasResult = $this->createMock(ResultInterface::class); $mockHasResult->expects($this->any()) ->method('current') ->will($this->returnValue($mockHasResultRow)); - $mockHasResultStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); + $mockHasResultStatement = $this->createMock(StatementInterface::class); $mockHasResultStatement->expects($this->any()) ->method('execute') ->will($this->returnValue($mockHasResult)); @@ -48,7 +53,7 @@ protected function getMockHasResult() ->method('getParameterContainer') ->will($this->returnValue(new ParameterContainer())); - $mockHasResultDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface'); + $mockHasResultDriver = $this->createMock(DriverInterface::class); $mockHasResultDriver->expects($this->any()) ->method('createStatement') ->will($this->returnValue($mockHasResultStatement)); @@ -56,7 +61,10 @@ protected function getMockHasResult() ->method('getConnection') ->will($this->returnValue($mockConnection)); - return $this->getMock('Zend\Db\Adapter\Adapter', null, [$mockHasResultDriver]); + return $this->getMockBuilder(Adapter::class) + ->setMethods(null) + ->setConstructorArgs([$mockHasResultDriver]) + ->getMock(); } /** @@ -67,14 +75,14 @@ protected function getMockHasResult() protected function getMockNoResult() { // mock the adapter, driver, and parts - $mockConnection = $this->getMock('Zend\Db\Adapter\Driver\ConnectionInterface'); + $mockConnection = $this->createMock(ConnectionInterface::class); - $mockNoResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface'); + $mockNoResult = $this->createMock(ResultInterface::class); $mockNoResult->expects($this->any()) ->method('current') ->will($this->returnValue(null)); - $mockNoResultStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); + $mockNoResultStatement = $this->createMock(StatementInterface::class); $mockNoResultStatement->expects($this->any()) ->method('execute') ->will($this->returnValue($mockNoResult)); @@ -83,7 +91,7 @@ protected function getMockNoResult() ->method('getParameterContainer') ->will($this->returnValue(new ParameterContainer())); - $mockNoResultDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface'); + $mockNoResultDriver = $this->createMock(DriverInterface::class); $mockNoResultDriver->expects($this->any()) ->method('createStatement') ->will($this->returnValue($mockNoResultStatement)); @@ -91,7 +99,10 @@ protected function getMockNoResult() ->method('getConnection') ->will($this->returnValue($mockConnection)); - return $this->getMock('Zend\Db\Adapter\Adapter', null, [$mockNoResultDriver]); + return $this->getMockBuilder(Adapter::class) + ->setMethods(null) + ->setConstructorArgs([$mockNoResultDriver]) + ->getMock(); } /** diff --git a/test/Db/RecordExistsTest.php b/test/Db/RecordExistsTest.php index 623395c50..e929dcbc9 100644 --- a/test/Db/RecordExistsTest.php +++ b/test/Db/RecordExistsTest.php @@ -17,6 +17,10 @@ use Zend\Validator\Db\RecordExists; use ZendTest\Validator\Db\TestAsset\TrustingSql92Platform; use Zend\Validator\Exception\RuntimeException; +use Zend\Db\Adapter\Driver\ConnectionInterface; +use Zend\Db\Adapter\Driver\ResultInterface; +use Zend\Db\Adapter\Driver\StatementInterface; +use Zend\Db\Adapter\Driver\DriverInterface; /** * @group Zend_Validator @@ -31,18 +35,18 @@ class RecordExistsTest extends TestCase protected function getMockHasResult() { // mock the adapter, driver, and parts - $mockConnection = $this->getMock('Zend\Db\Adapter\Driver\ConnectionInterface'); + $mockConnection = $this->createMock(ConnectionInterface::class); // Mock has result $mockHasResultRow = new ArrayObject(); $mockHasResultRow->one = 'one'; - $mockHasResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface'); + $mockHasResult = $this->createMock(ResultInterface::class); $mockHasResult->expects($this->any()) ->method('current') ->will($this->returnValue($mockHasResultRow)); - $mockHasResultStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); + $mockHasResultStatement = $this->createMock(StatementInterface::class); $mockHasResultStatement->expects($this->any()) ->method('execute') ->will($this->returnValue($mockHasResult)); @@ -51,7 +55,7 @@ protected function getMockHasResult() ->method('getParameterContainer') ->will($this->returnValue(new ParameterContainer())); - $mockHasResultDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface'); + $mockHasResultDriver = $this->createMock(DriverInterface::class); $mockHasResultDriver->expects($this->any()) ->method('createStatement') ->will($this->returnValue($mockHasResultStatement)); @@ -59,7 +63,10 @@ protected function getMockHasResult() ->method('getConnection') ->will($this->returnValue($mockConnection)); - return $this->getMock('Zend\Db\Adapter\Adapter', null, [$mockHasResultDriver]); + return $this->getMockBuilder(Adapter::class) + ->setMethods(null) + ->setConstructorArgs([$mockHasResultDriver]) + ->getMock(); } /** @@ -70,14 +77,14 @@ protected function getMockHasResult() protected function getMockNoResult() { // mock the adapter, driver, and parts - $mockConnection = $this->getMock('Zend\Db\Adapter\Driver\ConnectionInterface'); + $mockConnection = $this->createMock(ConnectionInterface::class); - $mockNoResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface'); + $mockNoResult = $this->createMock(ResultInterface::class); $mockNoResult->expects($this->any()) ->method('current') ->will($this->returnValue(null)); - $mockNoResultStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface'); + $mockNoResultStatement = $this->createMock(StatementInterface::class); $mockNoResultStatement->expects($this->any()) ->method('execute') ->will($this->returnValue($mockNoResult)); @@ -86,7 +93,7 @@ protected function getMockNoResult() ->method('getParameterContainer') ->will($this->returnValue(new ParameterContainer())); - $mockNoResultDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface'); + $mockNoResultDriver = $this->createMock(DriverInterface::class); $mockNoResultDriver->expects($this->any()) ->method('createStatement') ->will($this->returnValue($mockNoResultStatement)); @@ -94,7 +101,10 @@ protected function getMockNoResult() ->method('getConnection') ->will($this->returnValue($mockConnection)); - return $this->getMock('Zend\Db\Adapter\Adapter', null, [$mockNoResultDriver]); + return $this->getMockBuilder(Adapter::class) + ->setMethods(null) + ->setConstructorArgs([$mockNoResultDriver]) + ->getMock(); } /** diff --git a/test/ExplodeTest.php b/test/ExplodeTest.php index 0bbb275f3..ece5140b4 100644 --- a/test/ExplodeTest.php +++ b/test/ExplodeTest.php @@ -14,6 +14,7 @@ use Zend\Validator\Regex; use Zend\Validator\Callback; use Zend\Validator\Exception\RuntimeException; +use Zend\Validator\ValidatorInterface; /** * @group Zend_Validator @@ -64,7 +65,7 @@ public function testExpectedBehavior( $messages, $expects ) { - $mockValidator = $this->getMock('Zend\Validator\ValidatorInterface'); + $mockValidator = $this->createMock(ValidatorInterface::class); $mockValidator->expects( $this->exactly($numIsValidCalls) )->method('isValid')->will($this->returnValue($isValidReturn)); diff --git a/test/UriTest.php b/test/UriTest.php index 9269f8970..f196f4666 100644 --- a/test/UriTest.php +++ b/test/UriTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\TestCase; use Zend\Validator; use Zend\Uri\Exception\InvalidArgumentException; +use Zend\Uri\Uri; /** * @group Zend_Validator @@ -44,7 +45,7 @@ public function testHasDefaultSettingsAndLazyLoadsUriHandler() public function testConstructorWithArraySetsOptions() { - $uriMock = $this->getMock('Zend\Uri\Uri'); + $uriMock = $this->createMock(Uri::class); $validator = new Validator\Uri([ 'uriHandler' => $uriMock, 'allowRelative' => false, @@ -57,7 +58,7 @@ public function testConstructorWithArraySetsOptions() public function testConstructorWithArgsSetsOptions() { - $uriMock = $this->getMock('Zend\Uri\Uri'); + $uriMock = $this->createMock(Uri::class); $validator = new Validator\Uri($uriMock, false, false); $this->assertEquals($uriMock, $validator->getUriHandler()); $this->assertFalse($validator->getAllowRelative()); @@ -91,10 +92,9 @@ public function testUriHandlerBehaviorWithAllowSettings( $isValid, $expects ) { - $uriMock = $this->getMock( - 'Zend\Uri\Uri', - ['parse', 'isValid', 'isAbsolute', 'isValidRelative'] - ); + $uriMock = $this->getMockBuilder(Uri::class) + ->setConstructorArgs(['parse', 'isValid', 'isAbsolute', 'isValidRelative']) + ->getMock(); $uriMock->expects($this->once()) ->method('isValid')->will($this->returnValue($isValid)); $uriMock->expects($this->any()) @@ -111,7 +111,7 @@ public function testUriHandlerBehaviorWithAllowSettings( public function testUriHandlerThrowsExceptionInParseMethodNotValid() { - $uriMock = $this->getMock('Zend\Uri\Uri'); + $uriMock = $this->createMock(Uri::class); $uriMock->expects($this->once()) ->method('parse') ->will($this->throwException(new InvalidArgumentException())); diff --git a/test/ValidatorChainTest.php b/test/ValidatorChainTest.php index 31fcfb1fa..42d3e5758 100644 --- a/test/ValidatorChainTest.php +++ b/test/ValidatorChainTest.php @@ -16,6 +16,7 @@ use Zend\Validator\StaticValidator; use Zend\Validator\ValidatorChain; use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\Validator\ValidatorInterface; /** * @group Zend_Validator @@ -237,7 +238,7 @@ public function handleNotFoundError($errnum, $errstr) */ public function getValidatorTrue() { - $validator = $this->getMock('Zend\Validator\ValidatorInterface'); + $validator = $this->createMock(ValidatorInterface::class); $validator->expects($this->any()) ->method('isValid') ->will($this->returnValue(true)); @@ -249,7 +250,7 @@ public function getValidatorTrue() */ public function getValidatorFalse() { - $validator = $this->getMock('Zend\Validator\ValidatorInterface'); + $validator = $this->createMock(ValidatorInterface::class); $validator->expects($this->any()) ->method('isValid') ->will($this->returnValue(false)); From 1118933b0fe3c85ea23f0c15f242680900c12a19 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Tue, 14 Mar 2017 23:25:02 +0100 Subject: [PATCH 08/23] Use ::class notation instead of strings --- test/BarcodeTest.php | 3 ++- test/CallbackTest.php | 2 +- test/CreditCardTest.php | 14 +++++++------- test/CsrfTest.php | 5 +++-- test/Db/RecordExistsTest.php | 10 ++++++---- test/EmailAddressTest.php | 2 +- test/ExplodeTest.php | 3 ++- test/NotEmptyTest.php | 4 ++-- test/StaticValidatorTest.php | 7 ++++--- test/TestAsset/SessionManager.php | 3 ++- test/UriTest.php | 9 +++++---- test/ValidatorChainTest.php | 5 +++-- test/bootstrap.php | 2 +- 13 files changed, 39 insertions(+), 30 deletions(-) diff --git a/test/BarcodeTest.php b/test/BarcodeTest.php index e3124f37a..718641186 100644 --- a/test/BarcodeTest.php +++ b/test/BarcodeTest.php @@ -13,6 +13,7 @@ use Zend\Validator\Barcode; use Zend\Validator\Exception\InvalidArgumentException; use Zend\Validator\Barcode\AdapterInterface; +use Zend\Validator\Barcode\Ean13; /** * \Zend\Barcode @@ -149,7 +150,7 @@ public function testInvalidAdapter() public function testArrayConstructAdapter() { $barcode = new Barcode(['adapter' => 'Ean13', 'options' => 'unknown', 'useChecksum' => false]); - $this->assertInstanceOf('Zend\Validator\Barcode\Ean13', $barcode->getAdapter()); + $this->assertInstanceOf(Ean13::class, $barcode->getAdapter()); $this->assertFalse($barcode->useChecksum()); } diff --git a/test/CallbackTest.php b/test/CallbackTest.php index bd0ad3a44..2c6184f17 100644 --- a/test/CallbackTest.php +++ b/test/CallbackTest.php @@ -33,7 +33,7 @@ public function testBasic() public function testStaticCallback() { $valid = new Callback( - ['\ZendTest\Validator\CallbackTest', 'staticCallback'] + [CallbackTest::class, 'staticCallback'] ); $this->assertTrue($valid->isValid('test')); } diff --git a/test/CreditCardTest.php b/test/CreditCardTest.php index fe224435c..29f764345 100644 --- a/test/CreditCardTest.php +++ b/test/CreditCardTest.php @@ -145,7 +145,7 @@ public function testServiceClass($input, $expected) { $validator = new CreditCard(); $this->assertEquals(null, $validator->getService()); - $validator->setService(['ZendTest\Validator\CreditCardTest', 'staticCallback']); + $validator->setService([CreditCardTest::class, 'staticCallback']); $this->assertEquals($expected, $validator->isValid($input)); } @@ -170,7 +170,7 @@ public function testConstructionWithOptions($input, $expected) $validator = new CreditCard( [ 'type' => CreditCard::VISA, - 'service' => ['ZendTest\Validator\CreditCardTest', 'staticCallback'] + 'service' => [CreditCardTest::class, 'staticCallback'] ] ); @@ -265,7 +265,7 @@ public function testInvalidServiceClass() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid callback given'); - $validator->setService(['ZendTest\Validator\CreditCardTest', 'nocallback']); + $validator->setService([CreditCardTest::class, 'nocallback']); } /** @@ -290,12 +290,12 @@ public function testConfigObject() public function testOptionalConstructorParameterByConfigObject() { $config = new Config\Config( - ['type' => 'Visa', 'service' => ['ZendTest\Validator\CreditCardTest', 'staticCallback']] + ['type' => 'Visa', 'service' => [CreditCardTest::class, 'staticCallback']] ); $validator = new CreditCard($config); $this->assertEquals(['Visa'], $validator->getType()); - $this->assertEquals(['ZendTest\Validator\CreditCardTest', 'staticCallback'], $validator->getService()); + $this->assertEquals([CreditCardTest::class, 'staticCallback'], $validator->getService()); } /** @@ -305,9 +305,9 @@ public function testOptionalConstructorParameterByConfigObject() */ public function testOptionalConstructorParameter() { - $validator = new CreditCard('Visa', ['ZendTest\Validator\CreditCardTest', 'staticCallback']); + $validator = new CreditCard('Visa', [CreditCardTest::class, 'staticCallback']); $this->assertEquals(['Visa'], $validator->getType()); - $this->assertEquals(['ZendTest\Validator\CreditCardTest', 'staticCallback'], $validator->getService()); + $this->assertEquals([CreditCardTest::class, 'staticCallback'], $validator->getService()); } /** diff --git a/test/CsrfTest.php b/test/CsrfTest.php index a72e179f5..d106f7233 100644 --- a/test/CsrfTest.php +++ b/test/CsrfTest.php @@ -13,6 +13,7 @@ use Zend\Session\Config\StandardConfig; use Zend\Session\Container; use Zend\Validator\Csrf; +use Zend\Session\Storage\ArrayStorage; /** * Zend\Csrf @@ -32,7 +33,7 @@ public function setUp() // Setup session handling $_SESSION = []; $sessionConfig = new StandardConfig([ - 'storage' => 'Zend\Session\Storage\ArrayStorage', + 'storage' => ArrayStorage::class, ]); $sessionManager = new TestAsset\SessionManager($sessionConfig); $this->sessionManager = $sessionManager; @@ -65,7 +66,7 @@ public function testSaltIsMutable() public function testSessionContainerIsLazyLoadedIfNotSet() { $container = $this->validator->getSession(); - $this->assertInstanceOf('Zend\Session\Container', $container); + $this->assertInstanceOf(Container::class, $container); } public function testSessionContainerIsMutable() diff --git a/test/Db/RecordExistsTest.php b/test/Db/RecordExistsTest.php index e929dcbc9..6907a3ca1 100644 --- a/test/Db/RecordExistsTest.php +++ b/test/Db/RecordExistsTest.php @@ -21,6 +21,8 @@ use Zend\Db\Adapter\Driver\ResultInterface; use Zend\Db\Adapter\Driver\StatementInterface; use Zend\Db\Adapter\Driver\DriverInterface; +use Zend\Db\Sql\Select; +use Zend\Db\Sql\TableIdentifier; /** * @group Zend_Validator @@ -255,7 +257,7 @@ public function testSelectAcknowledgesTableAndSchema() 'schema' => 'my' ], 'field1', null, $this->getMockHasResult()); $table = $validator->getSelect()->getRawState('table'); - $this->assertInstanceOf('Zend\Db\Sql\TableIdentifier', $table); + $this->assertInstanceOf(TableIdentifier::class, $table); $this->assertEquals(['users', 'my'], $table->getTableAndSchema()); } @@ -287,7 +289,7 @@ public function testGetSelect() $this->getMockHasResult() ); $select = $validator->getSelect(); - $this->assertInstanceOf('Zend\Db\Sql\Select', $select); + $this->assertInstanceOf(Select::class, $select); $this->assertEquals( 'SELECT "my"."users"."field1" AS "field1" FROM "my"."users" WHERE "field1" = \'\' AND "foo" != \'bar\'', $select->getSqlString(new TrustingSql92Platform()) @@ -319,7 +321,7 @@ public function testGetSelectWithSameValidatorTwice() $this->getMockHasResult() ); $select = $validator->getSelect(); - $this->assertInstanceOf('Zend\Db\Sql\Select', $select); + $this->assertInstanceOf(Select::class, $select); $this->assertEquals( 'SELECT "my"."users"."field1" AS "field1" FROM "my"."users" WHERE "field1" = \'\' AND "foo" != \'bar\'', $select->getSqlString(new TrustingSql92Platform()) @@ -334,7 +336,7 @@ public function testGetSelectWithSameValidatorTwice() 'value' => 'fieldvalueexclude', ]); $select = $validator->getSelect(); - $this->assertInstanceOf('Zend\Db\Sql\Select', $select); + $this->assertInstanceOf(Select::class, $select); $this->assertEquals( 'SELECT "otherschema"."othertable"."fieldother" AS "fieldother" FROM "otherschema"."othertable" ' . 'WHERE "fieldother" = \'\' AND "fieldexclude" != \'fieldvalueexclude\'', diff --git a/test/EmailAddressTest.php b/test/EmailAddressTest.php index 14fb94adf..63a71a8ac 100644 --- a/test/EmailAddressTest.php +++ b/test/EmailAddressTest.php @@ -674,7 +674,7 @@ public function testEmailAddressesWithTrailingDotInHostPartAreRejected() public function testNotSetHostnameValidator() { $hostname = $this->validator->getHostnameValidator(); - $this->assertInstanceOf('Zend\Validator\Hostname', $hostname); + $this->assertInstanceOf(Hostname::class, $hostname); } /** diff --git a/test/ExplodeTest.php b/test/ExplodeTest.php index ece5140b4..e8ae70909 100644 --- a/test/ExplodeTest.php +++ b/test/ExplodeTest.php @@ -15,6 +15,7 @@ use Zend\Validator\Callback; use Zend\Validator\Exception\RuntimeException; use Zend\Validator\ValidatorInterface; +use Zend\Validator\InArray; /** * @group Zend_Validator @@ -123,7 +124,7 @@ public function testSetValidatorAsArray() /** @var $inArrayValidator \Zend\Validator\InArray */ $inArrayValidator = $validator->getValidator(); - $this->assertInstanceOf('Zend\Validator\InArray', $inArrayValidator); + $this->assertInstanceOf(InArray::class, $inArrayValidator); $this->assertSame( ['a', 'b', 'c'], $inArrayValidator->getHaystack() diff --git a/test/NotEmptyTest.php b/test/NotEmptyTest.php index 650d6e5f8..337447afd 100644 --- a/test/NotEmptyTest.php +++ b/test/NotEmptyTest.php @@ -894,7 +894,7 @@ public function testStringObjects() { $valid = new NotEmpty(NotEmpty::STRING); - $object = $this->getMockBuilder('\stdClass') + $object = $this->getMockBuilder(stdClass::class) ->setMethods(['__toString']) ->getMock(); @@ -907,7 +907,7 @@ public function testStringObjects() $valid = new NotEmpty(NotEmpty::OBJECT_STRING); $this->assertTrue($valid->isValid($object)); - $object = $this->getMockBuilder('\stdClass') + $object = $this->getMockBuilder(stdClass::class) ->setMethods(['__toString']) ->getMock(); $object->expects($this->atLeastOnce()) diff --git a/test/StaticValidatorTest.php b/test/StaticValidatorTest.php index 7597fd1e1..7ebf03c26 100644 --- a/test/StaticValidatorTest.php +++ b/test/StaticValidatorTest.php @@ -15,6 +15,7 @@ use Zend\Validator\Between; use Zend\Validator\StaticValidator; use Zend\Validator\ValidatorPluginManager; +use Zend\ServiceManager\ServiceManager; /** * @group Zend_Validator @@ -112,19 +113,19 @@ public function testSetGetDefaultTranslator() public function testLazyLoadsValidatorPluginManagerByDefault() { $plugins = StaticValidator::getPluginManager(); - $this->assertInstanceOf('Zend\Validator\ValidatorPluginManager', $plugins); + $this->assertInstanceOf(ValidatorPluginManager::class, $plugins); } public function testCanSetCustomPluginManager() { - $plugins = new ValidatorPluginManager($this->getMockBuilder('Zend\ServiceManager\ServiceManager')->getMock()); + $plugins = new ValidatorPluginManager($this->getMockBuilder(ServiceManager::class)->getMock()); StaticValidator::setPluginManager($plugins); $this->assertSame($plugins, StaticValidator::getPluginManager()); } public function testPassingNullWhenSettingPluginManagerResetsPluginManager() { - $plugins = new ValidatorPluginManager($this->getMockBuilder('Zend\ServiceManager\ServiceManager')->getMock()); + $plugins = new ValidatorPluginManager($this->getMockBuilder(ServiceManager::class)->getMock()); StaticValidator::setPluginManager($plugins); $this->assertSame($plugins, StaticValidator::getPluginManager()); StaticValidator::setPluginManager(null); diff --git a/test/TestAsset/SessionManager.php b/test/TestAsset/SessionManager.php index f0dc14ba7..9594e97e6 100644 --- a/test/TestAsset/SessionManager.php +++ b/test/TestAsset/SessionManager.php @@ -11,13 +11,14 @@ use Zend\Session\AbstractManager; use Zend\EventManager\EventManagerInterface; +use Zend\Session\Storage\ArrayStorage; class SessionManager extends AbstractManager { public $started = false; protected $configDefaultClass = 'Zend\Session\Configuration\StandardConfiguration'; - protected $storageDefaultClass = 'Zend\Session\Storage\ArrayStorage'; + protected $storageDefaultClass = ArrayStorage::class; public function start() { diff --git a/test/UriTest.php b/test/UriTest.php index f196f4666..0b701c355 100644 --- a/test/UriTest.php +++ b/test/UriTest.php @@ -13,6 +13,7 @@ use Zend\Validator; use Zend\Uri\Exception\InvalidArgumentException; use Zend\Uri\Uri; +use Zend\Uri\Http; /** * @group Zend_Validator @@ -38,7 +39,7 @@ public function testHasDefaultSettingsAndLazyLoadsUriHandler() { $validator = $this->validator; $uriHandler = $validator->getUriHandler(); - $this->assertInstanceOf('Zend\Uri\Uri', $uriHandler); + $this->assertInstanceOf(Uri::class, $uriHandler); $this->assertTrue($validator->getAllowRelative()); $this->assertTrue($validator->getAllowAbsolute()); } @@ -139,14 +140,14 @@ public function testEqualsMessageTemplates() public function testUriHandlerCanBeSpecifiedAsString() { - $this->validator->setUriHandler('Zend\Uri\Http'); - $this->assertInstanceOf('Zend\Uri\Http', $this->validator->getUriHandler()); + $this->validator->setUriHandler(Http::class); + $this->assertInstanceOf(Http::class, $this->validator->getUriHandler()); } public function testUriHandlerStringInvalidClassThrowsException() { $this->expectException(Validator\Exception\InvalidArgumentException::class); - $this->validator->setUriHandler('stdClass'); + $this->validator->setUriHandler(\stdClass::class); } public function testUriHandlerInvalidTypeThrowsException() diff --git a/test/ValidatorChainTest.php b/test/ValidatorChainTest.php index 42d3e5758..10b946e86 100644 --- a/test/ValidatorChainTest.php +++ b/test/ValidatorChainTest.php @@ -17,6 +17,7 @@ use Zend\Validator\ValidatorChain; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\Validator\ValidatorInterface; +use Zend\Validator\GreaterThan; /** * @group Zend_Validator @@ -314,7 +315,7 @@ public function testCanSerializeValidatorChain() $serialized = serialize($this->validator); $unserialized = unserialize($serialized); - $this->assertInstanceOf('Zend\Validator\ValidatorChain', $unserialized); + $this->assertInstanceOf(ValidatorChain::class, $unserialized); $this->assertEquals(2, count($unserialized)); $this->assertFalse($unserialized->isValid('')); } @@ -344,7 +345,7 @@ public function testAttachByNameAllowsSpecifyingBreakChainOnFailureFlagViaOption $this->assertInternalType('array', $spec); $this->assertArrayHasKey('instance', $spec); $validator = $spec['instance']; - $this->assertInstanceOf('Zend\Validator\GreaterThan', $validator); + $this->assertInstanceOf(GreaterThan::class, $validator); $this->assertArrayHasKey('breakChainOnFailure', $spec); $this->assertTrue($spec['breakChainOnFailure']); } diff --git a/test/bootstrap.php b/test/bootstrap.php index 4e856460f..c996b9bd5 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -10,7 +10,7 @@ */ error_reporting(E_ALL | E_STRICT); -if (class_exists('PHPUnit_Runner_Version', true)) { +if (class_exists(\PHPUnit_Runner_Version::class, true)) { $phpUnitVersion = PHPUnit_Runner_Version::id(); if ('@package_version@' !== $phpUnitVersion && version_compare($phpUnitVersion, '4.0.0', '<')) { echo 'This version of PHPUnit (' . PHPUnit_Runner_Version::id() . ') is not supported' From aedd4f9ddf188907b6909639b00681fac96059b9 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Tue, 14 Mar 2017 23:40:46 +0100 Subject: [PATCH 09/23] Remove unused imports --- test/File/FilesSizeTest.php | 1 - test/_files/MyBarcode1.php | 2 -- test/_files/MyBarcode2.php | 2 -- test/_files/MyBarcode3.php | 2 -- test/_files/MyBarcode4.php | 2 -- 5 files changed, 9 deletions(-) diff --git a/test/File/FilesSizeTest.php b/test/File/FilesSizeTest.php index 48bb2b5e5..303b9dacc 100644 --- a/test/File/FilesSizeTest.php +++ b/test/File/FilesSizeTest.php @@ -11,7 +11,6 @@ use PHPUnit\Framework\TestCase; use Zend\Validator\File; -use Zend\Validator; use Zend\Validator\Exception\InvalidArgumentException; /** diff --git a/test/_files/MyBarcode1.php b/test/_files/MyBarcode1.php index 063dd552d..94231cb39 100644 --- a/test/_files/MyBarcode1.php +++ b/test/_files/MyBarcode1.php @@ -9,8 +9,6 @@ namespace Zend\Validator\Barcode; -use Zend\Validator\Barcode\AbstractAdapter; - class MyBarcode1 extends AbstractAdapter { public function __construct() diff --git a/test/_files/MyBarcode2.php b/test/_files/MyBarcode2.php index 9ca406bf7..6c2a1c116 100644 --- a/test/_files/MyBarcode2.php +++ b/test/_files/MyBarcode2.php @@ -9,8 +9,6 @@ namespace Zend\Validator\Barcode; -use Zend\Validator\Barcode\AbstractAdapter; - class MyBarcode2 extends AbstractAdapter { public function __construct() diff --git a/test/_files/MyBarcode3.php b/test/_files/MyBarcode3.php index 67a7956df..a7a7c4a9e 100644 --- a/test/_files/MyBarcode3.php +++ b/test/_files/MyBarcode3.php @@ -9,8 +9,6 @@ namespace Zend\Validator\Barcode; -use Zend\Validator\Barcode\AbstractAdapter; - class MyBarcode3 extends AbstractAdapter { public function __construct() diff --git a/test/_files/MyBarcode4.php b/test/_files/MyBarcode4.php index ae0b03ddf..f66a40222 100644 --- a/test/_files/MyBarcode4.php +++ b/test/_files/MyBarcode4.php @@ -9,8 +9,6 @@ namespace Zend\Validator\Barcode; -use Zend\Validator\Barcode\AbstractAdapter; - class MyBarcode4 extends AbstractAdapter { public function __construct() From a2935cad5def2a772a075f0fe3d44da1725ea4ed Mon Sep 17 00:00:00 2001 From: Koopzington Date: Tue, 14 Mar 2017 23:50:11 +0100 Subject: [PATCH 10/23] Fix travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index acb92e3f5..53cbbd2ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,7 @@ matrix: - DEPS=locked - SERVICE_MANAGER_VERSION="^2.7.5" allow_failures: - - php: hhvm: + - php: hhvm before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi From 87a7784a2d709a5f8baa799fdd4558904b8a6a17 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Wed, 15 Mar 2017 14:07:03 +1000 Subject: [PATCH 11/23] Enable strict check for phpunit 5.7 --- phpunit.xml.dist | 4 +++- test/bootstrap.php | 34 ---------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 test/bootstrap.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 973a66038..ffdab5852 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,9 @@ diff --git a/test/bootstrap.php b/test/bootstrap.php deleted file mode 100644 index c996b9bd5..000000000 --- a/test/bootstrap.php +++ /dev/null @@ -1,34 +0,0 @@ - Date: Wed, 15 Mar 2017 14:09:53 +1000 Subject: [PATCH 12/23] Add CHANGELOG for #151 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e4328c5..11caf700a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ All notable changes to this project will be documented in this file, in reverse ### Removed -- Nothing. +- [#151](https://github.com/zendframework/zend-validator/pull/151) dropped + php 5.5 support ### Fixed From 4115f71489f6725a69a22f035bb675e2a6ea1b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20K=C3=B6string?= Date: Wed, 11 May 2016 14:35:34 +0200 Subject: [PATCH 13/23] added length to valid message variables --- src/StringLength.php | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/StringLength.php b/src/StringLength.php index 16c1acf7f..7d87185c9 100644 --- a/src/StringLength.php +++ b/src/StringLength.php @@ -31,14 +31,16 @@ class StringLength extends AbstractValidator * @var array */ protected $messageVariables = [ - 'min' => ['options' => 'min'], - 'max' => ['options' => 'max'], + 'min' => ['options' => 'min'], + 'max' => ['options' => 'max'], + 'length' => ['options' => 'length'] ]; protected $options = [ 'min' => 0, // Minimum length 'max' => null, // Maximum length, null if there is no length limitation 'encoding' => 'UTF-8', // Encoding to use + 'length' => 0 // Actual length ]; protected $stringWrapper; @@ -177,6 +179,28 @@ public function setEncoding($encoding) return $this; } + /** + * Returns the length option + * + * @return int + */ + private function getLength() + { + return $this->options['length']; + } + + /** + * Sets the length option + * + * @param int $length + * @return StringLength Provides a fluent interface + */ + private function setLength($length) + { + $this->options['length'] = (int) $length; + return $this; + } + /** * Returns true if and only if the string length of $value is at least the min option and * no greater than the max option (when the max option is not null). @@ -193,12 +217,12 @@ public function isValid($value) $this->setValue($value); - $length = $this->getStringWrapper()->strlen($value); - if ($length < $this->getMin()) { + $this->setLength($this->getStringWrapper()->strlen($value)); + if ($this->getLength() < $this->getMin()) { $this->error(self::TOO_SHORT); } - if (null !== $this->getMax() && $this->getMax() < $length) { + if (null !== $this->getMax() && $this->getMax() < $this->getLength()) { $this->error(self::TOO_LONG); } From 380cd748b85ef0f1ea35e8ec672e1fd47e06b0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20K=C3=B6string?= Date: Fri, 1 Jul 2016 14:35:15 +0200 Subject: [PATCH 14/23] adds documentation --- doc/book/validators/string-length.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/book/validators/string-length.md b/doc/book/validators/string-length.md index 1c75f7cdc..d155d4b14 100644 --- a/doc/book/validators/string-length.md +++ b/doc/book/validators/string-length.md @@ -15,11 +15,12 @@ The following options are supported for `Zend\Validator\StringLength`: - `encoding`: Sets the `ICONV` encoding to use with the string. - `min`: Sets the minimum allowed length for a string. - `max`: Sets the maximum allowed length for a string. +- `length`: Holds the actual length of the string. ## Default behaviour By default, this validator checks if a value is between `min` and `max` using a -default`min` value of `0` and default `max` value of `NULL` (meaning unlimited). +default `min` value of `0` and default `max` value of `NULL` (meaning unlimited). As such, without any options, the validator only checks that the input is a string. @@ -116,3 +117,11 @@ $validator2->isValid("Ärger"); // returns true When your installation and your application are using different encodings, then you should always set an encoding manually. + +## Validation Messages +Using the setMessage() method you can set another message to be returned in case of the specified failure. + +```php +$validator = new Zend\Validator\StringLength(['min' => 3, 'max' => 30]); +$validator->setMessage('Youre string is too long. You typed '%length%' chars.', Zend\Validator\StringLength::TOO_LONG); +``` From baab3a11984b5f8f03b76a92cab5879ae6a71f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20K=C3=B6string?= Date: Fri, 1 Jul 2016 14:40:01 +0200 Subject: [PATCH 15/23] adds tests --- test/MessageTest.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/MessageTest.php b/test/MessageTest.php index 060ce8f29..8c3d72481 100644 --- a/test/MessageTest.php +++ b/test/MessageTest.php @@ -92,6 +92,24 @@ public function testSetMessageWithValueParam() $this->assertEquals("Your value '$inputInvalid' is too long", current($messages)); } + /** + * Ensures that we can include the %length% parameter in the message, + * and that it is substituted with the length of the value we are validating. + * + * @return void + */ + public function testSetMessageWithLengthParam() + { + $this->validator->setMessage( + "The length of your value is '%length%'", + StringLength::TOO_LONG + ); + $inputInvalid = 'abcdefghij'; + $this->assertFalse($this->validator->isValid($inputInvalid)); + $messages = $this->validator->getMessages(); + $this->assertEquals("The length of your value is '10'", current($messages)); + } + /** * Ensures that we can include another parameter, defined on a * class-by-class basis, in the message string. @@ -234,7 +252,7 @@ public function testGetMessageVariables() $vars = $this->validator->getMessageVariables(); $this->assertInternalType('array', $vars); - $this->assertEquals(['min', 'max'], $vars); + $this->assertEquals(['min', 'max', 'length'], $vars); $message = 'variables: %notvar% '; foreach ($vars as $var) { $message .= "%$var% "; @@ -243,7 +261,7 @@ public function testGetMessageVariables() $this->assertFalse($this->validator->isValid('abc')); $messages = $this->validator->getMessages(); - $this->assertEquals('variables: %notvar% 4 8 ', current($messages)); + $this->assertEquals('variables: %notvar% 4 8 3', current($messages)); } public function testEqualsMessageTemplates() From 7c3d788b2f7a24dee581584b7431bb1a9724960b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20K=C3=B6string?= Date: Fri, 1 Jul 2016 14:46:03 +0200 Subject: [PATCH 16/23] fix test --- test/MessageTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MessageTest.php b/test/MessageTest.php index 8c3d72481..222d9619a 100644 --- a/test/MessageTest.php +++ b/test/MessageTest.php @@ -261,7 +261,7 @@ public function testGetMessageVariables() $this->assertFalse($this->validator->isValid('abc')); $messages = $this->validator->getMessages(); - $this->assertEquals('variables: %notvar% 4 8 3', current($messages)); + $this->assertEquals('variables: %notvar% 4 8 3 ', current($messages)); } public function testEqualsMessageTemplates() From aaa8fd8a0ebefc6d04c5dac29ea7dc0b3f5d000f Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 17 Mar 2017 13:09:10 +1000 Subject: [PATCH 17/23] Add CHANGELOG for #78 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d0a2008..25b3a89b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file, in reverse ### Added -- Nothing. +- [#78](https://github.com/zendframework/zend-validator/pull/78) added + `%length%` as an optional message variable in StringLength validator ### Deprecated From 1876e40d9b725cbb3482b5887a63bd158fe77827 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 17 Mar 2017 14:50:35 +1000 Subject: [PATCH 18/23] Fix CS --- src/NotEmpty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotEmpty.php b/src/NotEmpty.php index d2396a6c2..1a342e874 100644 --- a/src/NotEmpty.php +++ b/src/NotEmpty.php @@ -97,7 +97,7 @@ public function __construct($options = null) $options = $temp; } - if (!isset($options['type'])) { + if (! isset($options['type'])) { if (($type = $this->calculateTypeValue($options)) != 0) { $options['type'] = $type; } else { From 1c0b519d1950d82d2c02e5ac97ed2d759bcd11c7 Mon Sep 17 00:00:00 2001 From: Krish Damani Date: Fri, 24 Feb 2017 14:37:34 +0530 Subject: [PATCH 19/23] =?UTF-8?q?Changes=20done=20for=20adding=20support?= =?UTF-8?q?=20for=20"=C3=B8"=20for=20DK=20idn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Hostname.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hostname.php b/src/Hostname.php index 6a31f8359..7515918f9 100644 --- a/src/Hostname.php +++ b/src/Hostname.php @@ -1676,7 +1676,7 @@ class Hostname extends AbstractValidator 'CN' => 'Hostname/Cn.php', 'COM' => 'Hostname/Com.php', 'DE' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'], - 'DK' => [1 => '/^[\x{002d}0-9a-zäéöü]{1,63}$/iu'], + 'DK' => [1 => '/^[\x{002d}0-9a-zäéöüø]{1,63}$/iu'], 'EE' => [1 => '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu'], 'ES' => [1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'], 'EU' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', From f2a009744417b7ebea62167b9369987e9dd36d7d Mon Sep 17 00:00:00 2001 From: Krish Damani Date: Fri, 24 Feb 2017 15:33:07 +0530 Subject: [PATCH 20/23] Adding two more valid characters for dk domain --- src/Hostname.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hostname.php b/src/Hostname.php index 7515918f9..4fa57ce35 100644 --- a/src/Hostname.php +++ b/src/Hostname.php @@ -1676,7 +1676,7 @@ class Hostname extends AbstractValidator 'CN' => 'Hostname/Cn.php', 'COM' => 'Hostname/Com.php', 'DE' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'], - 'DK' => [1 => '/^[\x{002d}0-9a-zäéöüø]{1,63}$/iu'], + 'DK' => [1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu'], 'EE' => [1 => '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu'], 'ES' => [1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'], 'EU' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', From 43ced7ad05919eba18ea8244e4c7e962fb1d6fdc Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 17 Mar 2017 19:47:05 +1000 Subject: [PATCH 21/23] Add CHANGELOG for #150 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9deaff0..795e8d542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,8 @@ All notable changes to this project will be documented in this file, in reverse EmailAddress validator applying IDNA conversion to local part - [#88](https://github.com/zendframework/zend-validator/pull/88) fixed NotEmpty validator incorrectly applying types bitmaps +- [#150](https://github.com/zendframework/zend-validator/pull/150) fixed Hostname + validator not allowiing some characters in .dk IDN ## 2.8.2 - 2017-01-29 From 003c5d1b7a5b5437463c5b563507bf907388c228 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 17 Mar 2017 19:57:49 +1000 Subject: [PATCH 22/23] Fix CHANGELOG and add 2.9.0 release date --- CHANGELOG.md | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 795e8d542..a4e6e05aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 2.9.0 - TBD +## 2.9.0 - 2017-03-17 ### Added @@ -20,27 +20,8 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. - - -## 2.8.3 - TBD - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - - [#147](https://github.com/zendframework/zend-validator/issues/147) - [#148](https://github.com/zendframework/zend-validator/pull/110) adds further + [#148](https://github.com/zendframework/zend-validator/pull/148) adds further `"suggest"` clauses in `composer.json`, since some dependencies are not always required, and may lead to runtime failures. - [#66](https://github.com/zendframework/zend-validator/pull/66) fixed @@ -48,8 +29,7 @@ All notable changes to this project will be documented in this file, in reverse - [#88](https://github.com/zendframework/zend-validator/pull/88) fixed NotEmpty validator incorrectly applying types bitmaps - [#150](https://github.com/zendframework/zend-validator/pull/150) fixed Hostname - validator not allowiing some characters in .dk IDN - + validator not allowing some characters in .dk IDN ## 2.8.2 - 2017-01-29 From 462bc0f84edab3bd933105d11a4a6a8553447d85 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 17 Mar 2017 20:04:38 +1000 Subject: [PATCH 23/23] Update branch aliases and bump minimum deps --- composer.json | 6 +++--- composer.lock | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 91ba040da..560ed56bb 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "require": { "php": "^5.6 || ^7.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0", + "zendframework/zend-stdlib": "^2.7.6 || ^3.1", "container-interop/container-interop": "^1.1" }, "require-dev": { @@ -45,8 +45,8 @@ "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "2.8-dev", - "dev-develop": "2.9-dev" + "dev-master": "2.9-dev", + "dev-develop": "2.10-dev" }, "zf": { "component": "Zend\\Validator", diff --git a/composer.lock b/composer.lock index e2f3796c9..dca2092e7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "26a4395b24ebf7f41fde5c85e5e51725", + "content-hash": "6926a47b4f62c328d7c9d74767654cb9", "packages": [ { "name": "container-interop/container-interop", @@ -689,16 +689,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.15", + "version": "5.7.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5" + "reference": "dafc78e2a7d12139b0e97078d1082326bd09363d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b99112aecc01f62acf3d81a3f59646700a1849e5", - "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dafc78e2a7d12139b0e97078d1082326bd09363d", + "reference": "dafc78e2a7d12139b0e97078d1082326bd09363d", "shasum": "" }, "require": { @@ -767,7 +767,7 @@ "testing", "xunit" ], - "time": "2017-03-02T15:22:43+00:00" + "time": "2017-03-15T13:02:34+00:00" }, { "name": "phpunit/phpunit-mock-objects",