diff --git a/.gitignore b/.gitignore index f146c861..673fe323 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ tmp/ zf-mkdoc-theme/ clover.xml -composer.lock coveralls-upload.json phpunit.xml vendor diff --git a/.travis.yml b/.travis.yml index 9457c11b..ca44bc71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,9 @@ cache: env: global: + - COMPOSER_ARGS="--no-interaction" + - COVERAGE_DEPS="satooshi/php-coveralls" + - LEGACY_DEPS="phpunit/phpunit" - TESTS_ZEND_FEED_READER_ONLINE_ENABLED: true - SITE_URL: https://zendframework.github.io/zend-feed - GH_USER_NAME: "Matthew Weier O'Phinney" @@ -24,24 +27,45 @@ env: matrix: include: - - php: 5.5 - env: - - CS_CHECK=true - - php: 5.5 + - php: 5.6 env: - - SERVICE_MANAGER_VERSION="^2.7.5" + - DEPS=lowest - php: 5.6 env: + - DEPS=locked - 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: 7 + env: + - DEPS=latest + - php: 7.1 + env: + - DEPS=lowest + - php: 7.1 + env: + - DEPS=locked + - php: 7.1 + env: + - DEPS=latest - php: hhvm - php: hhvm env: @@ -51,25 +75,30 @@ matrix: 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 - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; 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_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 +after_success: + - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi + notifications: email: false irc: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d0a9357..fbdd4aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,25 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 2.8.0 - TBD - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.7.1 - TBD +## 2.8.0 - 2017-04-02 ### Added @@ -37,7 +19,8 @@ All notable changes to this project will be documented in this file, in reverse ### Removed -- Nothing. +- [#38](https://github.com/zendframework/zend-feed/pull/38) dropped php 5.5 + support ### Fixed diff --git a/composer.json b/composer.json index f6140b3c..7aff1d6c 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ } }, "require": { - "php": "^5.5 || ^7.0", + "php": "^5.6 || ^7.0", "zendframework/zend-escaper": "^2.5", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "zendframework/zend-stdlib": "^2.7 || ^3.1" }, "require-dev": { "zendframework/zend-db": "^2.7", @@ -23,7 +23,7 @@ "zendframework/zend-http": "^2.5.4", "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", "zendframework/zend-validator": "^2.6", - "phpunit/PHPUnit": "~4.0", + "phpunit/PHPUnit": "^6.0.8 || ^5.7.15", "psr/http-message": "^1.0", "zendframework/zend-coding-standard": "~1.0.0" }, @@ -35,12 +35,10 @@ "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" }, - "minimum-stability": "dev", - "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.8-dev", + "dev-develop": "2.9-dev" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..04f4f949 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2115 @@ +{ + "_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": "b2e612675cf8887e17e5e4347e2365ac", + "packages": [ + { + "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-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": "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": "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.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf", + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf", + "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-19T16:52:12+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": "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": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+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-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-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-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-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-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-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" + }, + { + "name": "zendframework/zend-validator", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-validator.git", + "reference": "b71641582297eab52753b72cd4eb45a5ded4485c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/b71641582297eab52753b72cd4eb45a5ded4485c", + "reference": "b71641582297eab52753b72cd4eb45a5ded4485c", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.6 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6", + "zendframework/zend-db": "^2.7", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-i18n": "^2.6", + "zendframework/zend-math": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-session": "^2.6.2", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "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", + "zendframework/zend-i18n-resources": "Translations of validator messages", + "zendframework/zend-math": "Zend\\Math component, required by the Csrf validator", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", + "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" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9-dev", + "dev-develop": "2.10-dev" + }, + "zf": { + "component": "Zend\\Validator", + "config-provider": "Zend\\Validator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Validator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed validators", + "homepage": "https://github.com/zendframework/zend-validator", + "keywords": [ + "validator", + "zf2" + ], + "time": "2017-03-17T10:15:50+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^5.6 || ^7.0" + }, + "platform-dev": [] +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 54706d8e..beb1f552 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,9 @@ diff --git a/test/PubSubHubbub/Model/SubscriptionTest.php b/test/PubSubHubbub/Model/SubscriptionTest.php index 715e9d27..43bdbf8e 100644 --- a/test/PubSubHubbub/Model/SubscriptionTest.php +++ b/test/PubSubHubbub/Model/SubscriptionTest.php @@ -11,15 +11,17 @@ use DateTime; use PDO; +use PHPUnit\Framework\TestCase; use Zend\Db\Adapter\Adapter as DbAdapter; use Zend\Db\TableGateway\TableGateway; use Zend\Feed\PubSubHubbub\Model\Subscription; +use Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface; /** * @group Zend_Feed * @group Zend_Feed_Pubsubhubbub_Model */ -class SubscriptionTest extends \PHPUnit_Framework_TestCase +class SubscriptionTest extends TestCase { /** * @group ZF-10069 @@ -59,9 +61,9 @@ public function testAllOperations() public function testImpemetsSubscriptionInterface() { - $reflection = new \ReflectionClass('Zend\Feed\PubSubHubbub\Model\Subscription'); + $reflection = new \ReflectionClass(Subscription::class); $this->assertTrue( - $reflection->implementsInterface('Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface') + $reflection->implementsInterface(SubscriptionPersistenceInterface::class) ); unset($reflection); } diff --git a/test/PubSubHubbub/PubSubHubbubTest.php b/test/PubSubHubbub/PubSubHubbubTest.php index ca55b480..15ac99ae 100644 --- a/test/PubSubHubbub/PubSubHubbubTest.php +++ b/test/PubSubHubbub/PubSubHubbubTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Feed\PubSubHubbub; +use PHPUnit\Framework\TestCase; use Zend\Feed\PubSubHubbub\PubSubHubbub; use Zend\Feed\Reader\Reader as FeedReader; @@ -16,7 +17,7 @@ * @group Zend_Feed * @group Zend_Feed_Subsubhubbub */ -class PubSubHubbubTest extends \PHPUnit_Framework_TestCase +class PubSubHubbubTest extends TestCase { public function testCanDetectHubs() { diff --git a/test/PubSubHubbub/PublisherTest.php b/test/PubSubHubbub/PublisherTest.php index 76e7b264..fc61fcc2 100644 --- a/test/PubSubHubbub/PublisherTest.php +++ b/test/PubSubHubbub/PublisherTest.php @@ -9,16 +9,18 @@ namespace ZendTest\Feed\PubSubHubbub; +use PHPUnit\Framework\TestCase; use Zend\Http\Client as HttpClient; use Zend\Http\Response as HttpResponse; use Zend\Feed\PubSubHubbub\Publisher; use Zend\Feed\PubSubHubbub\PubSubHubbub; +use Zend\Feed\PubSubHubbub\Exception\ExceptionInterface; /** * @group Zend_Feed * @group Zend_Feed_Subsubhubbub */ -class PublisherTest extends \PHPUnit_Framework_TestCase +class PublisherTest extends TestCase { /** @var Publisher */ protected $publisher = null; @@ -102,21 +104,21 @@ public function testRetrievesUniqueHubServerUrlsOnly() public function testThrowsExceptionOnSettingEmptyHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addHubUrl(''); } public function testThrowsExceptionOnSettingNonStringHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addHubUrl(123); } public function testThrowsExceptionOnSettingInvalidHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addHubUrl('http://'); } @@ -170,21 +172,21 @@ public function testRetrievesUniqueUpdatedTopicUrlsOnly() public function testThrowsExceptionOnSettingEmptyUpdatedTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addUpdatedTopicUrl(''); } public function testThrowsExceptionOnSettingNonStringUpdatedTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addUpdatedTopicUrl(123); } public function testThrowsExceptionOnSettingInvalidUpdatedTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->publisher->addUpdatedTopicUrl('http://'); } diff --git a/test/PubSubHubbub/Subscriber/CallbackTest.php b/test/PubSubHubbub/Subscriber/CallbackTest.php index f4fc0cd2..3b226033 100644 --- a/test/PubSubHubbub/Subscriber/CallbackTest.php +++ b/test/PubSubHubbub/Subscriber/CallbackTest.php @@ -11,16 +11,21 @@ use DateInterval; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\PubSubHubbub\HttpResponse; use Zend\Feed\PubSubHubbub\Model; use Zend\Feed\PubSubHubbub\Subscriber\Callback as CallbackSubscriber; use ArrayObject; +use Zend\Feed\PubSubHubbub\Exception\ExceptionInterface; +use Zend\Db\ResultSet\ResultSet; +use Zend\Db\TableGateway\TableGateway; +use Zend\Db\Adapter\Adapter; /** * @group Zend_Feed * @group Zend_Feed_Subsubhubbub */ -class CallbackTest extends \PHPUnit_Framework_TestCase +class CallbackTest extends TestCase { // @codingStandardsIgnoreStart /** @var CallbackSubscriber */ @@ -42,13 +47,13 @@ public function setUp() $this->_callback = new CallbackSubscriber; $this->_adapter = $this->_getCleanMock( - '\Zend\Db\Adapter\Adapter' + Adapter::class ); $this->_tableGateway = $this->_getCleanMock( - '\Zend\Db\TableGateway\TableGateway' + TableGateway::class ); $this->_rowset = $this->_getCleanMock( - '\Zend\Db\ResultSet\ResultSet' + ResultSet::class ); $this->_tableGateway->expects($this->any()) @@ -76,23 +81,23 @@ public function setUp() public function testCanSetHttpResponseObject() { $this->_callback->setHttpResponse(new HttpResponse); - $this->assertInstanceOf('Zend\Feed\PubSubHubbub\HttpResponse', $this->_callback->getHttpResponse()); + $this->assertInstanceOf(HttpResponse::class, $this->_callback->getHttpResponse()); } public function testCanUsesDefaultHttpResponseObject() { - $this->assertInstanceOf('Zend\Feed\PubSubHubbub\HttpResponse', $this->_callback->getHttpResponse()); + $this->assertInstanceOf(HttpResponse::class, $this->_callback->getHttpResponse()); } public function testThrowsExceptionOnInvalidHttpResponseObjectSet() { - $this->setExpectedException('\Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->_callback->setHttpResponse(new \stdClass); } public function testThrowsExceptionIfNonObjectSetAsHttpResponseObject() { - $this->setExpectedException('\Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->_callback->setHttpResponse(''); } @@ -109,19 +114,19 @@ public function testDefaultSubscriberCountIsOne() public function testThrowsExceptionOnSettingZeroAsSubscriberCount() { - $this->setExpectedException('\Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->_callback->setSubscriberCount(0); } public function testThrowsExceptionOnSettingLessThanZeroAsSubscriberCount() { - $this->setExpectedException('\Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->_callback->setSubscriberCount(-1); } public function testThrowsExceptionOnSettingAnyScalarTypeCastToAZeroOrLessIntegerAsSubscriberCount() { - $this->setExpectedException('\Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->_callback->setSubscriberCount('0aa'); } @@ -138,7 +143,7 @@ public function testCanSetStorageImplementation() */ public function testValidatesValidHttpGetData() { - $mockReturnValue = $this->getMock('Result', ['getArrayCopy']); + $mockReturnValue = $this->getMockBuilder('Result')->setMethods(['getArrayCopy'])->getMock(); $mockReturnValue->expects($this->any()) ->method('getArrayCopy') ->will($this->returnValue([ @@ -191,7 +196,7 @@ public function testReturnsFalseIfVerifyTokenMissingFromHttpGetData() public function testReturnsTrueIfModeSetAsUnsubscribeFromHttpGetData() { - $mockReturnValue = $this->getMock('Result', ['getArrayCopy']); + $mockReturnValue = $this->getMockBuilder('Result')->setMethods(['getArrayCopy'])->getMock(); $mockReturnValue->expects($this->any()) ->method('getArrayCopy') ->will($this->returnValue([ @@ -474,13 +479,12 @@ protected function _getCleanMock($className) $stubMethods[] = $method->getName(); } } - $mocked = $this->getMock( - $className, - $stubMethods, - [], - str_replace('\\', '_', ($className . '_PubsubSubscriberMock_' . uniqid())), - false - ); + $mocked = $this->getMockBuilder($className) + ->setMethods($stubMethods) + ->setConstructorArgs([]) + ->setMockClassName(str_replace('\\', '_', ($className . '_PubsubSubscriberMock_' . uniqid()))) + ->disableOriginalConstructor() + ->getMock(); return $mocked; } } diff --git a/test/PubSubHubbub/SubscriberHttpTest.php b/test/PubSubHubbub/SubscriberHttpTest.php index d2317a77..bcf110a2 100644 --- a/test/PubSubHubbub/SubscriberHttpTest.php +++ b/test/PubSubHubbub/SubscriberHttpTest.php @@ -9,9 +9,12 @@ namespace ZendTest\Feed\PubSubHubbub; +use PHPUnit\Framework\TestCase; use Zend\Feed\PubSubHubbub\PubSubHubbub; use Zend\Feed\PubSubHubbub\Subscriber; use Zend\Http\Client as HttpClient; +use Zend\Feed\PubSubHubbub\Model\Subscription; +use Zend\Http\Client\Adapter\Socket; /** * Note that $this->_baseuri must point to a directory on a web server @@ -25,7 +28,7 @@ * @group Zend_Feed * @group Zend_Feed_Subsubhubbub */ -class SubscriberHttpTest extends \PHPUnit_Framework_TestCase +class SubscriberHttpTest extends TestCase { /** @var Subscriber */ protected $subscriber = null; @@ -51,11 +54,11 @@ public function setUp() } $uri = $this->baseuri . $name . '.php'; $this->client = new HttpClient($uri); - $this->client->setAdapter('\Zend\Http\Client\Adapter\Socket'); + $this->client->setAdapter(Socket::class); PubSubHubbub::setHttpClient($this->client); $this->subscriber = new Subscriber; - $this->storage = $this->_getCleanMock('\Zend\Feed\PubSubHubbub\Model\Subscription'); + $this->storage = $this->_getCleanMock(Subscription::class); $this->subscriber->setStorage($this->storage); } else { // Skip tests @@ -111,10 +114,7 @@ protected function _getCleanMock($className) $stubMethods[] = $method->getName(); } } - $mocked = $this->getMock( - $className, - $stubMethods - ); + $mocked = $this->getMockBuilder($className)->setMethods($stubMethods)->getMock(); return $mocked; } } diff --git a/test/PubSubHubbub/SubscriberTest.php b/test/PubSubHubbub/SubscriberTest.php index 91ecf479..9b684b93 100644 --- a/test/PubSubHubbub/SubscriberTest.php +++ b/test/PubSubHubbub/SubscriberTest.php @@ -9,16 +9,20 @@ namespace ZendTest\Feed\PubSubHubbub; +use PHPUnit\Framework\TestCase; use Zend\Feed\PubSubHubbub\Subscriber; use Zend\Feed\PubSubHubbub\PubSubHubbub; use Zend\Feed\PubSubHubbub\Model\Subscription; use Zend\Http\Client as HttpClient; +use Zend\Feed\PubSubHubbub\Exception\ExceptionInterface; +use Zend\Db\TableGateway\TableGateway; +use Zend\Db\Adapter\Adapter; /** * @group Zend_Feed * @group Zend_Feed_Subsubhubbub */ -class SubscriberTest extends \PHPUnit_Framework_TestCase +class SubscriberTest extends TestCase { /** @var Subscriber */ protected $subscriber = null; @@ -33,10 +37,10 @@ public function setUp() PubSubHubbub::setHttpClient($client); $this->subscriber = new Subscriber; $this->adapter = $this->_getCleanMock( - '\Zend\Db\Adapter\Adapter' + Adapter::class ); $this->tableGateway = $this->_getCleanMock( - '\Zend\Db\TableGateway\TableGateway' + TableGateway::class ); $this->tableGateway->expects($this->any())->method('getAdapter') ->will($this->returnValue($this->adapter)); @@ -93,19 +97,19 @@ public function testRetrievesUniqueHubServerUrlsOnly() public function testThrowsExceptionOnSettingEmptyHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->addHubUrl(''); } public function testThrowsExceptionOnSettingNonStringHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->addHubUrl(123); } public function testThrowsExceptionOnSettingInvalidHubServerUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->addHubUrl('http://'); } @@ -175,27 +179,27 @@ public function testCanSetTopicUrl() public function testThrowsExceptionOnSettingEmptyTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setTopicUrl(''); } public function testThrowsExceptionOnSettingNonStringTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setTopicUrl(123); } public function testThrowsExceptionOnSettingInvalidTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setTopicUrl('http://'); } public function testThrowsExceptionOnMissingTopicUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->getTopicUrl(); } @@ -207,27 +211,27 @@ public function testCanSetCallbackUrl() public function testThrowsExceptionOnSettingEmptyCallbackUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setCallbackUrl(''); } public function testThrowsExceptionOnSettingNonStringCallbackUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setCallbackUrl(123); } public function testThrowsExceptionOnSettingInvalidCallbackUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setCallbackUrl('http://'); } public function testThrowsExceptionOnMissingCallbackUrl() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->getCallbackUrl(); } @@ -239,19 +243,19 @@ public function testCanSetLeaseSeconds() public function testThrowsExceptionOnSettingZeroAsLeaseSeconds() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setLeaseSeconds(0); } public function testThrowsExceptionOnSettingLessThanZeroAsLeaseSeconds() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setLeaseSeconds(-1); } public function testThrowsExceptionOnSettingAnyScalarTypeCastToAZeroOrLessIntegerAsLeaseSeconds() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setLeaseSeconds('0aa'); } @@ -263,7 +267,7 @@ public function testCanSetPreferredVerificationMode() public function testSetsPreferredVerificationModeThrowsExceptionOnSettingBadMode() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->setPreferredVerificationMode('abc'); } @@ -282,7 +286,7 @@ public function testCanSetStorageImplementation() public function testGetStorageThrowsExceptionIfNoneSet() { - $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $this->subscriber->getStorage(); } @@ -299,13 +303,13 @@ protected function _getCleanMock($className) $stubMethods[] = $method->getName(); } } - $mocked = $this->getMock( - $className, - $stubMethods, - [], - str_replace('\\', '_', ($className . '_PubsubSubscriberMock_' . uniqid())), - false - ); + + $mocked = $this->getMockBuilder($className) + ->setMethods($stubMethods) + ->setConstructorArgs([]) + ->setMockClassName(str_replace('\\', '_', ($className . '_PubsubSubscriberMock_' . uniqid()))) + ->disableOriginalConstructor() + ->getMock(); return $mocked; } } diff --git a/test/Reader/Entry/AtomStandaloneEntryTest.php b/test/Reader/Entry/AtomStandaloneEntryTest.php index 5b3c496a..3d74f560 100644 --- a/test/Reader/Entry/AtomStandaloneEntryTest.php +++ b/test/Reader/Entry/AtomStandaloneEntryTest.php @@ -10,13 +10,15 @@ namespace ZendTest\Feed\Reader\Entry; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; +use Zend\Feed\Reader\Entry\Atom; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class AtomStandaloneEntryTest extends \PHPUnit_Framework_TestCase +class AtomStandaloneEntryTest extends TestCase { protected $feedSamplePath = null; @@ -65,7 +67,7 @@ public function testReaderImportOfAtomEntryDocumentReturnsEntryClass() $object = Reader\Reader::importString( file_get_contents($this->feedSamplePath . '/id/atom10.xml') ); - $this->assertInstanceOf('Zend\Feed\Reader\Entry\Atom', $object); + $this->assertInstanceOf(Atom::class, $object); } /** diff --git a/test/Reader/Entry/AtomTest.php b/test/Reader/Entry/AtomTest.php index 65e8b08c..6717cc29 100644 --- a/test/Reader/Entry/AtomTest.php +++ b/test/Reader/Entry/AtomTest.php @@ -10,13 +10,14 @@ namespace ZendTest\Feed\Reader\Entry; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class AtomTest extends \PHPUnit_Framework_TestCase +class AtomTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Entry/CommonTest.php b/test/Reader/Entry/CommonTest.php index 783dfc2d..7dfafd09 100644 --- a/test/Reader/Entry/CommonTest.php +++ b/test/Reader/Entry/CommonTest.php @@ -9,13 +9,16 @@ namespace ZendTest\Feed\Reader\Entry; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; +use Zend\Feed\Reader\Entry\AbstractEntry; +use Zend\Feed\Reader\Extension\Atom\Entry; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class CommonTest extends \PHPUnit_Framework_TestCase +class CommonTest extends TestCase { protected $feedSamplePath = null; @@ -34,7 +37,7 @@ public function testGetsDomDocumentObject() file_get_contents($this->feedSamplePath.'/atom.xml') ); $entry = $feed->current(); - $this->assertInstanceOf('DOMDocument', $entry->getDomDocument()); + $this->assertInstanceOf(\DOMDocument::class, $entry->getDomDocument()); } public function testGetsDomXpathObject() @@ -43,7 +46,7 @@ public function testGetsDomXpathObject() file_get_contents($this->feedSamplePath.'/atom.xml') ); $entry = $feed->current(); - $this->assertInstanceOf('DOMXPath', $entry->getXpath()); + $this->assertInstanceOf(\DOMXPath::class, $entry->getXpath()); } public function testGetsXpathPrefixString() @@ -61,7 +64,7 @@ public function testGetsDomElementObject() file_get_contents($this->feedSamplePath.'/atom.xml') ); $entry = $feed->current(); - $this->assertInstanceOf('DOMElement', $entry->getElement()); + $this->assertInstanceOf(\DOMElement::class, $entry->getElement()); } public function testSaveXmlOutputsXmlStringForEntry() @@ -81,7 +84,7 @@ public function testGetsNamedExtension() file_get_contents($this->feedSamplePath.'/atom.xml') ); $entry = $feed->current(); - $this->assertInstanceOf('Zend\Feed\Reader\Extension\Atom\Entry', $entry->getExtension('Atom')); + $this->assertInstanceOf(Entry::class, $entry->getExtension('Atom')); } public function testReturnsNullIfExtensionDoesNotExist() @@ -127,7 +130,7 @@ public function testFeedEntryCanDetectFeedType() ); $entry = $feed->current(); $stub = $this->getMockForAbstractClass( - 'Zend\Feed\Reader\Entry\AbstractEntry', + AbstractEntry::class, [$entry->getElement(), $entry->getId()] ); $this->assertEquals($entry->getType(), $stub->getType()); @@ -144,7 +147,7 @@ public function testFeedEntryCanSetAnyType() $entry = $feed->current(); $domElement = new \DOMElement($entry->getElement()->tagName); $stub = $this->getMockForAbstractClass( - 'Zend\Feed\Reader\Entry\AbstractEntry', + AbstractEntry::class, [$domElement, $entry->getId()] ); $this->assertEquals($stub->getType(), Reader\Reader::TYPE_ANY); diff --git a/test/Reader/Entry/RssTest.php b/test/Reader/Entry/RssTest.php index 5d7f2c94..11dc663e 100644 --- a/test/Reader/Entry/RssTest.php +++ b/test/Reader/Entry/RssTest.php @@ -10,13 +10,14 @@ namespace ZendTest\Feed\Reader\Entry; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class RssTest extends \PHPUnit_Framework_TestCase +class RssTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/ExtensionPluginManagerCompatibilityTest.php b/test/Reader/ExtensionPluginManagerCompatibilityTest.php index 9767d2ae..91bcdaf3 100644 --- a/test/Reader/ExtensionPluginManagerCompatibilityTest.php +++ b/test/Reader/ExtensionPluginManagerCompatibilityTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Feed\Reader; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader\Exception\InvalidArgumentException; use Zend\Feed\Reader\ExtensionPluginManager; use Zend\ServiceManager\ServiceManager; diff --git a/test/Reader/Feed/AtomSourceTest.php b/test/Reader/Feed/AtomSourceTest.php index c77c3ab0..97a9f58e 100644 --- a/test/Reader/Feed/AtomSourceTest.php +++ b/test/Reader/Feed/AtomSourceTest.php @@ -10,13 +10,15 @@ namespace ZendTest\Feed\Reader\Feed; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; +use Zend\Feed\Reader\Feed\Atom\Source; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class AtomSourceTest extends \PHPUnit_Framework_TestCase +class AtomSourceTest extends TestCase { protected $feedSamplePath = null; @@ -67,7 +69,7 @@ public function testGetsSourceFromEntry() file_get_contents($this->feedSamplePath.'/title/atom10.xml') ); $source = $feed->current()->getSource(); - $this->assertInstanceOf('Zend\Feed\Reader\Feed\Atom\Source', $source); + $this->assertInstanceOf(Source::class, $source); } /** diff --git a/test/Reader/Feed/AtomTest.php b/test/Reader/Feed/AtomTest.php index 760b47dc..e0f1c6b5 100644 --- a/test/Reader/Feed/AtomTest.php +++ b/test/Reader/Feed/AtomTest.php @@ -10,13 +10,14 @@ namespace ZendTest\Feed\Reader\Feed; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class AtomTest extends \PHPUnit_Framework_TestCase +class AtomTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Feed/CommonTest.php b/test/Reader/Feed/CommonTest.php index bb4f8101..3cfed09f 100644 --- a/test/Reader/Feed/CommonTest.php +++ b/test/Reader/Feed/CommonTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Feed\Reader\Feed; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; +use Zend\Feed\Reader\Extension\Atom\Feed; /** * @group Zend_Feed * @group Reader\Reader */ -class CommonTest extends \PHPUnit_Framework_TestCase +class CommonTest extends TestCase { protected $feedSamplePath = null; @@ -33,7 +35,7 @@ public function testGetsDomDocumentObject() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath.'/atom.xml') ); - $this->assertInstanceOf('DOMDocument', $feed->getDomDocument()); + $this->assertInstanceOf(\DOMDocument::class, $feed->getDomDocument()); } public function testGetsDomXpathObject() @@ -41,7 +43,7 @@ public function testGetsDomXpathObject() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath.'/atom.xml') ); - $this->assertInstanceOf('DOMXPath', $feed->getXpath()); + $this->assertInstanceOf(\DOMXPath::class, $feed->getXpath()); } public function testGetsXpathPrefixString() @@ -57,7 +59,7 @@ public function testGetsDomElementObject() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath.'/atom.xml') ); - $this->assertInstanceOf('DOMElement', $feed->getElement()); + $this->assertInstanceOf(\DOMElement::class, $feed->getElement()); } public function testSaveXmlOutputsXmlStringForFeed() @@ -75,7 +77,7 @@ public function testGetsNamedExtension() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath.'/atom.xml') ); - $this->assertInstanceOf('Zend\Feed\Reader\Extension\Atom\Feed', $feed->getExtension('Atom')); + $this->assertInstanceOf(Feed::class, $feed->getExtension('Atom')); } public function testReturnsNullIfExtensionDoesNotExist() diff --git a/test/Reader/Feed/RssTest.php b/test/Reader/Feed/RssTest.php index c833c0ba..f9e7c5ba 100644 --- a/test/Reader/Feed/RssTest.php +++ b/test/Reader/Feed/RssTest.php @@ -10,13 +10,14 @@ namespace ZendTest\Feed\Reader\Feed; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class RssTest extends \PHPUnit_Framework_TestCase +class RssTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/FeedSetTest.php b/test/Reader/FeedSetTest.php index dc59724c..27a87860 100644 --- a/test/Reader/FeedSetTest.php +++ b/test/Reader/FeedSetTest.php @@ -9,11 +9,11 @@ namespace ZendTest\Feed\Reader; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use ReflectionMethod; use Zend\Feed\Reader\FeedSet; -class FeedSetTest extends PHPUnit_Framework_TestCase +class FeedSetTest extends TestCase { /** * @var FeedSet @@ -30,7 +30,7 @@ protected function setUp() */ public function testAbsolutiseUri($link, $uri, $result) { - $method = new ReflectionMethod('Zend\Feed\Reader\FeedSet', 'absolutiseUri'); + $method = new ReflectionMethod(FeedSet::class, 'absolutiseUri'); $method->setAccessible(true); $this->assertEquals($result, $method->invoke($this->feedSet, $link, $uri)); diff --git a/test/Reader/Http/Psr7ResponseDecoratorTest.php b/test/Reader/Http/Psr7ResponseDecoratorTest.php index df69493f..726db4ab 100644 --- a/test/Reader/Http/Psr7ResponseDecoratorTest.php +++ b/test/Reader/Http/Psr7ResponseDecoratorTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Feed\Reader\Http; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface; use Zend\Feed\Reader\Http\Psr7ResponseDecorator; use Zend\Feed\Reader\Http\HeaderAwareResponseInterface; diff --git a/test/Reader/Http/ResponseTest.php b/test/Reader/Http/ResponseTest.php index 0fefeb54..6695c6e3 100644 --- a/test/Reader/Http/ResponseTest.php +++ b/test/Reader/Http/ResponseTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Feed\Reader\Http; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader\Exception\InvalidArgumentException; use Zend\Feed\Reader\Http\Response; use ZendTest\Feed\Reader\TestAsset\Psr7Stream; @@ -88,7 +88,8 @@ public function invalidStatusCodes() */ public function testConstructorRaisesExceptionForInvalidStatusCode($statusCode, $contains) { - $this->setExpectedException(InvalidArgumentException::class, $contains); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage($contains); new Response($statusCode); } @@ -112,7 +113,7 @@ public function invalidBodies() */ public function testConstructorRaisesExceptionForInvalidBody($body) { - $this->setExpectedException(InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); new Response(200, $body); } @@ -163,7 +164,8 @@ public function invalidHeaders() */ public function testConstructorRaisesExceptionForInvalidHeaderStructures($headers, $contains) { - $this->setExpectedException(InvalidArgumentException::class, $contains); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage($contains); new Response(200, '', $headers); } diff --git a/test/Reader/Http/ZendHttpClientDecoratorTest.php b/test/Reader/Http/ZendHttpClientDecoratorTest.php index 9c98bcf3..0d24ea8a 100644 --- a/test/Reader/Http/ZendHttpClientDecoratorTest.php +++ b/test/Reader/Http/ZendHttpClientDecoratorTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Feed\Reader\Http; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Zend\Feed\Reader\Exception\InvalidArgumentException; @@ -198,7 +198,8 @@ public function testDecoratorRaisesExceptionForInvalidHeaders($headers, $contain $client = new ZendHttpClientDecorator($this->client->reveal()); - $this->setExpectedException(InvalidArgumentException::class, $contains); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage($contains); $client->get('http://example.com', $headers); } } diff --git a/test/Reader/Integration/HOnlineComAtom10Test.php b/test/Reader/Integration/HOnlineComAtom10Test.php index 70ae447a..68504bb4 100644 --- a/test/Reader/Integration/HOnlineComAtom10Test.php +++ b/test/Reader/Integration/HOnlineComAtom10Test.php @@ -9,13 +9,14 @@ namespace ZendTest\Feed\Reader\Integration; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class HOnlineComAtom10Test extends \PHPUnit_Framework_TestCase +class HOnlineComAtom10Test extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Integration/LautDeRdfTest.php b/test/Reader/Integration/LautDeRdfTest.php index 543ce75c..1617442e 100644 --- a/test/Reader/Integration/LautDeRdfTest.php +++ b/test/Reader/Integration/LautDeRdfTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Feed\Reader\Integration; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class LautDeRdfTest extends \PHPUnit_Framework_TestCase +class LautDeRdfTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Integration/PodcastRss2Test.php b/test/Reader/Integration/PodcastRss2Test.php index 24caeec2..74f841d2 100644 --- a/test/Reader/Integration/PodcastRss2Test.php +++ b/test/Reader/Integration/PodcastRss2Test.php @@ -9,13 +9,14 @@ namespace ZendTest\Feed\Reader\Integration; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class PodcastRss2Test extends \PHPUnit_Framework_TestCase +class PodcastRss2Test extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Integration/WordpressAtom10Test.php b/test/Reader/Integration/WordpressAtom10Test.php index a259abd6..c72a2e09 100644 --- a/test/Reader/Integration/WordpressAtom10Test.php +++ b/test/Reader/Integration/WordpressAtom10Test.php @@ -9,13 +9,14 @@ namespace ZendTest\Feed\Reader\Integration; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class WordpressAtom10Test extends \PHPUnit_Framework_TestCase +class WordpressAtom10Test extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/Integration/WordpressRss2DcAtomTest.php b/test/Reader/Integration/WordpressRss2DcAtomTest.php index 837177e2..23dda94b 100644 --- a/test/Reader/Integration/WordpressRss2DcAtomTest.php +++ b/test/Reader/Integration/WordpressRss2DcAtomTest.php @@ -9,13 +9,14 @@ namespace ZendTest\Feed\Reader\Integration; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class WordpressRss2DcAtomTest extends \PHPUnit_Framework_TestCase +class WordpressRss2DcAtomTest extends TestCase { protected $feedSamplePath = null; diff --git a/test/Reader/ReaderTest.php b/test/Reader/ReaderTest.php index cf2258f5..71a9db08 100644 --- a/test/Reader/ReaderTest.php +++ b/test/Reader/ReaderTest.php @@ -9,18 +9,27 @@ namespace ZendTest\Feed\Reader; +use PHPUnit\Framework\TestCase; use stdClass; use Zend\Http\Client as HttpClient; use Zend\Http\Client\Adapter\Test as TestAdapter; use Zend\Http\Response as HttpResponse; use Zend\Feed\Reader; use Zend\Feed\Reader\Http\ClientInterface; +use Zend\Feed\Reader\Exception\InvalidArgumentException; +use Zend\Feed\Reader\Feed\FeedInterface; +use Zend\Feed\Reader\Http\ResponseInterface; +use My\Extension\JungleBooks\Feed; +use My\Extension\JungleBooks\Entry; +use Interop\Container\ContainerInterface; +use Zend\Feed\Reader\Feed\Rss; +use Zend\Feed\Reader\FeedSet; /** * @group Zend_Feed * @group Zend_Feed_Reader */ -class ReaderTest extends \PHPUnit_Framework_TestCase +class ReaderTest extends TestCase { protected $feedSamplePath = null; @@ -149,7 +158,7 @@ public function testImportsFile() $feed = Reader\Reader::importFile( dirname(__FILE__) . '/Entry/_files/Atom/title/plain/atom10.xml' ); - $this->assertInstanceOf('Zend\Feed\Reader\Feed\FeedInterface', $feed); + $this->assertInstanceOf(FeedInterface::class, $feed); } public function testImportsUri() @@ -163,10 +172,10 @@ public function testImportsUri() /** * @group ZF-8328 - * @expectedException Zend\Feed\Reader\Exception\RuntimeException */ public function testImportsUriAndThrowsExceptionIfNotAFeed() { + $this->expectException(Reader\Exception\RuntimeException::class); if (! getenv('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')) { $this->markTestSkipped('testImportsUri() requires a network connection'); } @@ -191,7 +200,7 @@ public function testCompilesLinksAsArrayObject() $this->markTestSkipped('testGetsFeedLinksAsValueObject() requires a network connection'); } $links = Reader\Reader::findFeedLinks('http://www.planet-php.net'); - $this->assertInstanceOf('Zend\Feed\Reader\FeedSet', $links); + $this->assertInstanceOf(FeedSet::class, $links); $this->assertEquals([ 'rel' => 'alternate', 'type' => 'application/rss+xml', 'href' => 'http://www.planet-php.org/rss/' ], (array) $links->getIterator()->current()); @@ -204,7 +213,7 @@ public function testFeedSetLoadsFeedObjectWhenFeedArrayKeyAccessed() } $links = Reader\Reader::findFeedLinks('http://www.planet-php.net'); $link = $links->getIterator()->current(); - $this->assertInstanceOf('Zend\Feed\Reader\Feed\Rss', $link['feed']); + $this->assertInstanceOf(Rss::class, $link['feed']); } public function testZeroCountFeedSetReturnedFromEmptyList() @@ -258,10 +267,10 @@ public function testRegistersUserExtension() require_once __DIR__ . '/_files/My/Extension/JungleBooks/Entry.php'; require_once __DIR__ . '/_files/My/Extension/JungleBooks/Feed.php'; $manager = new Reader\ExtensionManager(new Reader\ExtensionPluginManager( - $this->getMockBuilder('Interop\Container\ContainerInterface')->getMock() + $this->getMockBuilder(ContainerInterface::class)->getMock() )); - $manager->setInvokableClass('JungleBooks\Entry', 'My\Extension\JungleBooks\Entry'); - $manager->setInvokableClass('JungleBooks\Feed', 'My\Extension\JungleBooks\Feed'); + $manager->setInvokableClass('JungleBooks\Entry', Entry::class); + $manager->setInvokableClass('JungleBooks\Feed', Feed::class); Reader\Reader::setExtensionManager($manager); Reader\Reader::registerExtension('JungleBooks'); @@ -277,7 +286,7 @@ public function testRegistersUserExtension() */ public function testXxePreventionOnFeedParsing() { - $this->setExpectedException('Zend\Feed\Reader\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $string = file_get_contents($this->feedSamplePath.'/Reader/xxe-atom10.xml'); $string = str_replace('XXE_URI', $this->feedSamplePath.'/Reader/xxe-info.txt', $string); $feed = Reader\Reader::importString($string); @@ -288,7 +297,9 @@ public function testImportRemoteFeedMethodPerformsAsExpected() { $uri = 'http://example.com/feeds/reader.xml'; $feedContents = file_get_contents($this->feedSamplePath . '/Reader/rss20.xml'); - $response = $this->getMock('Zend\Feed\Reader\Http\ResponseInterface', ['getStatusCode', 'getBody']); + $response = $this->getMockBuilder(ResponseInterface::class) + ->setMethods(['getStatusCode', 'getBody']) + ->getMock(); $response->expects($this->once()) ->method('getStatusCode') ->will($this->returnValue(200)); @@ -296,28 +307,30 @@ public function testImportRemoteFeedMethodPerformsAsExpected() ->method('getBody') ->will($this->returnValue($feedContents)); - $client = $this->getMock('Zend\Feed\Reader\Http\ClientInterface', ['get']); + $client = $this->getMockBuilder(ClientInterface::class) + ->setMethods(['get']) + ->getMock(); $client->expects($this->once()) ->method('get') ->with($this->equalTo($uri)) ->will($this->returnValue($response)); $feed = Reader\Reader::importRemoteFeed($uri, $client); - $this->assertInstanceOf('Zend\Feed\Reader\Feed\FeedInterface', $feed); + $this->assertInstanceOf(FeedInterface::class, $feed); $type = Reader\Reader::detectType($feed); $this->assertEquals(Reader\Reader::TYPE_RSS_20, $type); } public function testImportStringMethodThrowProperExceptionOnEmptyString() { - $this->setExpectedException('Zend\Feed\Reader\Exception\InvalidArgumentException'); + $this->expectException(InvalidArgumentException::class); $string = ' '; $feed = Reader\Reader::importString($string); } public function testSetHttpFeedClient() { - $client = $this->getMock('Zend\Feed\Reader\Http\ClientInterface'); + $client = $this->createMock(ClientInterface::class); Reader\Reader::setHttpClient($client); $this->assertEquals($client, Reader\Reader::getHttpClient()); } @@ -333,7 +346,7 @@ public function testSetHttpClientWillDecorateAZendHttpClientInstance() public function testSetHttpClientThrowsException() { - $this->setExpectedException(Reader\Exception\InvalidHttpClientException::class); + $this->expectException(Reader\Exception\InvalidHttpClientException::class); Reader\Reader::setHttpClient(new stdClass); } diff --git a/test/Reader/StandaloneExtensionManagerTest.php b/test/Reader/StandaloneExtensionManagerTest.php index 9fb27e07..f4dd6dee 100644 --- a/test/Reader/StandaloneExtensionManagerTest.php +++ b/test/Reader/StandaloneExtensionManagerTest.php @@ -8,8 +8,11 @@ */ namespace ZendTest\Feed\Reader; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Feed\Reader\StandaloneExtensionManager; +use Zend\Feed\Reader\Extension\WellFormedWeb\Entry; +use Zend\Feed\Reader\Extension\Syndication\Feed; +use Zend\Feed\Reader\ExtensionManagerInterface; class StandaloneExtensionManagerTest extends TestCase { @@ -20,28 +23,31 @@ public function setUp() public function testIsAnExtensionManagerImplementation() { - $this->assertInstanceOf('Zend\Feed\Reader\ExtensionManagerInterface', $this->extensions); + $this->assertInstanceOf(ExtensionManagerInterface::class, $this->extensions); } public function defaultPlugins() { return [ - 'Atom\Entry' => ['Atom\Entry', 'Zend\Feed\Reader\Extension\Atom\Entry'], - 'Atom\Feed' => ['Atom\Feed', 'Zend\Feed\Reader\Extension\Atom\Feed'], - 'Content\Entry' => ['Content\Entry', 'Zend\Feed\Reader\Extension\Content\Entry'], + 'Atom\Entry' => ['Atom\Entry', \Zend\Feed\Reader\Extension\Atom\Entry::class], + 'Atom\Feed' => ['Atom\Feed', \Zend\Feed\Reader\Extension\Atom\Feed::class], + 'Content\Entry' => ['Content\Entry', \Zend\Feed\Reader\Extension\Content\Entry::class], 'CreativeCommons\Entry' => [ 'CreativeCommons\Entry', - 'Zend\Feed\Reader\Extension\CreativeCommons\Entry' + \Zend\Feed\Reader\Extension\CreativeCommons\Entry::class ], - 'CreativeCommons\Feed' => ['CreativeCommons\Feed', 'Zend\Feed\Reader\Extension\CreativeCommons\Feed'], - 'DublinCore\Entry' => ['DublinCore\Entry', 'Zend\Feed\Reader\Extension\DublinCore\Entry'], - 'DublinCore\Feed' => ['DublinCore\Feed', 'Zend\Feed\Reader\Extension\DublinCore\Feed'], - 'Podcast\Entry' => ['Podcast\Entry', 'Zend\Feed\Reader\Extension\Podcast\Entry'], - 'Podcast\Feed' => ['Podcast\Feed', 'Zend\Feed\Reader\Extension\Podcast\Feed'], - 'Slash\Entry' => ['Slash\Entry', 'Zend\Feed\Reader\Extension\Slash\Entry'], - 'Syndication\Feed' => ['Syndication\Feed', 'Zend\Feed\Reader\Extension\Syndication\Feed'], - 'Thread\Entry' => ['Thread\Entry', 'Zend\Feed\Reader\Extension\Thread\Entry'], - 'WellFormedWeb\Entry' => ['WellFormedWeb\Entry', 'Zend\Feed\Reader\Extension\WellFormedWeb\Entry'], + 'CreativeCommons\Feed' => [ + 'CreativeCommons\Feed', + \Zend\Feed\Reader\Extension\CreativeCommons\Feed::class + ], + 'DublinCore\Entry' => ['DublinCore\Entry', \Zend\Feed\Reader\Extension\DublinCore\Entry::class], + 'DublinCore\Feed' => ['DublinCore\Feed', \Zend\Feed\Reader\Extension\DublinCore\Feed::class], + 'Podcast\Entry' => ['Podcast\Entry', \Zend\Feed\Reader\Extension\Podcast\Entry::class], + 'Podcast\Feed' => ['Podcast\Feed', \Zend\Feed\Reader\Extension\Podcast\Feed::class], + 'Slash\Entry' => ['Slash\Entry', \Zend\Feed\Reader\Extension\Slash\Entry::class], + 'Syndication\Feed' => ['Syndication\Feed', Feed::class], + 'Thread\Entry' => ['Thread\Entry', \Zend\Feed\Reader\Extension\Thread\Entry::class], + 'WellFormedWeb\Entry' => ['WellFormedWeb\Entry', Entry::class], ]; } diff --git a/test/Writer/DeletedTest.php b/test/Writer/DeletedTest.php index 00884e9a..ebdaa14e 100644 --- a/test/Writer/DeletedTest.php +++ b/test/Writer/DeletedTest.php @@ -10,13 +10,15 @@ namespace ZendTest\Feed\Writer; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\InvalidArgumentException; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class DeletedTest extends \PHPUnit_Framework_TestCase +class DeletedTest extends TestCase { public function testSetsReference() { @@ -184,8 +186,8 @@ public function testSetByException() { $entry = new Writer\Deleted; - $this->setExpectedException( - 'Zend\Feed\Writer\Exception\InvalidArgumentException', + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage( 'Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI' ); $entry->setBy(['name' => 'joe', 'email' => 'joe@example.com', 'uri' => '']); @@ -224,10 +226,8 @@ public function testEncoding() $entry->setEncoding('ISO-8859-1'); $this->assertEquals('ISO-8859-1', $entry->getEncoding()); - $this->setExpectedException( - 'Zend\Feed\Writer\Exception\InvalidArgumentException', - 'Invalid parameter: parameter must be a non-empty string' - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid parameter: parameter must be a non-empty string'); $entry->setEncoding(null); } diff --git a/test/Writer/EntryTest.php b/test/Writer/EntryTest.php index 30d6a196..5a72c125 100644 --- a/test/Writer/EntryTest.php +++ b/test/Writer/EntryTest.php @@ -10,13 +10,17 @@ namespace ZendTest\Feed\Writer; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; +use Zend\Feed\Writer\Source; +use Zend\Feed\Writer\Extension\ITunes\Entry; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class EntryTest extends \PHPUnit_Framework_TestCase +class EntryTest extends TestCase { protected $feedSamplePath = null; @@ -127,11 +131,9 @@ public function testAddsEnclosure() $this->assertEquals($expected, $entry->getEnclosure()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionOnMissingUri() { + $this->expectException(ExceptionInterface::class); $this->markTestIncomplete('Pending Zend\URI fix for validation'); $entry = new Writer\Entry; $entry->setEnclosure([ @@ -140,11 +142,9 @@ public function testAddsEnclosureThrowsExceptionOnMissingUri() ]); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionWhenUriIsInvalid() { + $this->expectException(ExceptionInterface::class); $this->markTestIncomplete('Pending Zend\URI fix for validation'); $entry = new Writer\Entry; $entry->setEnclosure([ @@ -570,7 +570,7 @@ public function disallowedCommentCounts() public function testSetsCommentCountDisallowed($count) { $entry = new Writer\Entry; - $this->setExpectedException('Zend\Feed\Writer\Exception\ExceptionInterface'); + $this->expectException(ExceptionInterface::class); $entry->setCommentCount($count); } @@ -674,7 +674,7 @@ public function testGetExtension() $foo = $entry->getExtension('foo'); $this->assertNull($foo); - $this->assertInstanceOf('Zend\Feed\Writer\Extension\ITunes\Entry', $entry->getExtension('ITunes')); + $this->assertInstanceOf(Entry::class, $entry->getExtension('ITunes')); } /** @@ -685,7 +685,7 @@ public function testGetExtensions() $entry = new Writer\Entry; $extensions = $entry->getExtensions(); - $this->assertInstanceOf('Zend\Feed\Writer\Extension\ITunes\Entry', $extensions['ITunes\Entry']); + $this->assertInstanceOf(Entry::class, $extensions['ITunes\Entry']); } /** @@ -700,7 +700,7 @@ public function testGetSource() $this->assertNull($source); $entry->setSource($entry->createSource()); - $this->assertInstanceOf('Zend\Feed\Writer\Source', $entry->getSource()); + $this->assertInstanceOf(Source::class, $entry->getSource()); } public function testFluentInterface() diff --git a/test/Writer/Extension/ITunes/EntryTest.php b/test/Writer/Extension/ITunes/EntryTest.php index 0e0c9498..e5e7d246 100644 --- a/test/Writer/Extension/ITunes/EntryTest.php +++ b/test/Writer/Extension/ITunes/EntryTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Feed\Writer\Extension\ITunes; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class EntryTest extends \PHPUnit_Framework_TestCase +class EntryTest extends TestCase { public function testSetBlock() { @@ -24,20 +26,16 @@ public function testSetBlock() $this->assertEquals('yes', $entry->getItunesBlock()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetBlockThrowsExceptionOnNonAlphaValue() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesBlock('123'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesBlock(str_repeat('a', 256)); } @@ -56,11 +54,9 @@ public function testAddAuthor() $this->assertEquals(['joe'], $entry->getItunesAuthors()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->addItunesAuthor(str_repeat('a', 256)); } @@ -86,29 +82,23 @@ public function testSetDurationAsHoursMinutesAndSeconds() $this->assertEquals('23:23:23', $entry->getItunesDuration()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnUnknownFormat() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesDuration('abc'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnInvalidSeconds() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesDuration('23:456'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnInvalidMinutes() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesDuration('23:234:45'); } @@ -134,11 +124,9 @@ public function testSetExplicitToClean() $this->assertEquals('clean', $entry->getItunesExplicit()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetExplicitThrowsExceptionOnUnknownTerm() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesExplicit('abc'); } @@ -153,11 +141,9 @@ public function testSetKeywords() $this->assertEquals($words, $entry->getItunesKeywords()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $words = [ 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13' @@ -165,11 +151,9 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() $entry->setItunesKeywords($words); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $words = [ str_repeat('a', 253), str_repeat('b', 2) @@ -184,11 +168,9 @@ public function testSetSubtitle() $this->assertEquals('abc', $entry->getItunesSubtitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesSubtitle(str_repeat('a', 256)); } @@ -200,11 +182,9 @@ public function testSetSummary() $this->assertEquals('abc', $entry->getItunesSummary()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetSummaryThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(ExceptionInterface::class); $entry = new Writer\Entry; $entry->setItunesSummary(str_repeat('a', 4001)); } diff --git a/test/Writer/Extension/ITunes/FeedTest.php b/test/Writer/Extension/ITunes/FeedTest.php index 99367d14..67be98af 100644 --- a/test/Writer/Extension/ITunes/FeedTest.php +++ b/test/Writer/Extension/ITunes/FeedTest.php @@ -9,13 +9,15 @@ namespace ZendTest\Feed\Writer\Extension\ITunes; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class FeedTest extends \PHPUnit_Framework_TestCase +class FeedTest extends TestCase { public function testSetBlock() { @@ -24,20 +26,16 @@ public function testSetBlock() $this->assertEquals('yes', $feed->getItunesBlock()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetBlockThrowsExceptionOnNonAlphaValue() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesBlock('123'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesBlock(str_repeat('a', 256)); } @@ -56,11 +54,9 @@ public function testAddAuthor() $this->assertEquals(['joe'], $feed->getItunesAuthors()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->addItunesAuthor(str_repeat('a', 256)); } @@ -76,11 +72,9 @@ public function testSetCategories() $this->assertEquals($cats, $feed->getItunesCategories()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetCategoriesThrowsExceptionIfAnyCatNameGreaterThan255CharsLength() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $cats = [ 'cat1', @@ -104,20 +98,16 @@ public function testSetImageAsJpgFile() $this->assertEquals('http://www.example.com/image.jpg', $feed->getItunesImage()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetImageThrowsExceptionOnInvalidUri() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesImage('http://'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetImageThrowsExceptionOnInvalidImageExtension() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesImage('http://www.example.com/image.gif'); } @@ -143,29 +133,23 @@ public function testSetDurationAsHoursMinutesAndSeconds() $this->assertEquals('23:23:23', $feed->getItunesDuration()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnUnknownFormat() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesDuration('abc'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnInvalidSeconds() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesDuration('23:456'); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetDurationThrowsExceptionOnInvalidMinutes() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesDuration('23:234:45'); } @@ -191,11 +175,9 @@ public function testSetExplicitToClean() $this->assertEquals('clean', $feed->getItunesExplicit()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetExplicitThrowsExceptionOnUnknownTerm() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesExplicit('abc'); } @@ -210,11 +192,9 @@ public function testSetKeywords() $this->assertEquals($words, $feed->getItunesKeywords()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $words = [ 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13' @@ -222,11 +202,9 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() $feed->setItunesKeywords($words); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $words = [ str_repeat('a', 253), str_repeat('b', 2) @@ -241,11 +219,9 @@ public function testSetNewFeedUrl() $this->assertEquals('http://example.com/feed', $feed->getItunesNewFeedUrl()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetNewFeedUrlThrowsExceptionOnInvalidUri() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesNewFeedUrl('http://'); } @@ -271,11 +247,9 @@ public function testSetSubtitle() $this->assertEquals('abc', $feed->getItunesSubtitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesSubtitle(str_repeat('a', 256)); } @@ -287,11 +261,9 @@ public function testSetSummary() $this->assertEquals('abc', $feed->getItunesSummary()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetSummaryThrowsExceptionWhenValueExceeds4000Chars() { + $this->expectException(ExceptionInterface::class); $feed = new Writer\Feed; $feed->setItunesSummary(str_repeat('a', 4001)); } diff --git a/test/Writer/ExtensionPluginManagerCompatibilityTest.php b/test/Writer/ExtensionPluginManagerCompatibilityTest.php index f9baca1a..8b120cb8 100644 --- a/test/Writer/ExtensionPluginManagerCompatibilityTest.php +++ b/test/Writer/ExtensionPluginManagerCompatibilityTest.php @@ -9,7 +9,7 @@ namespace ZendTest\Feed\Writer; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer\Exception\InvalidArgumentException; use Zend\Feed\Writer\ExtensionPluginManager; use Zend\ServiceManager\ServiceManager; diff --git a/test/Writer/FeedTest.php b/test/Writer/FeedTest.php index 422f3c5b..e830f9f6 100644 --- a/test/Writer/FeedTest.php +++ b/test/Writer/FeedTest.php @@ -10,14 +10,18 @@ namespace ZendTest\Feed\Writer; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; use Zend\Feed\Writer\Version; +use Zend\Feed\Writer\Deleted; +use Zend\Feed\Writer\Entry; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class FeedTest extends \PHPUnit_Framework_TestCase +class FeedTest extends TestCase { protected $feedSamplePath = null; @@ -120,7 +124,7 @@ public function testSetCopyrightThrowsExceptionOnInvalidParam() try { $writer->setCopyright(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -222,7 +226,7 @@ public function testSetDateCreatedThrowsExceptionOnInvalidParameter() try { $writer->setDateCreated('abc'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -232,7 +236,7 @@ public function testSetDateModifiedThrowsExceptionOnInvalidParameter() try { $writer->setDateModified('abc'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -300,7 +304,7 @@ public function testSetLastBuildDateThrowsExceptionOnInvalidParameter() try { $writer->setLastBuildDate('abc'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -329,7 +333,7 @@ public function testSetDescriptionThrowsExceptionOnInvalidParameter() try { $writer->setDescription(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -376,7 +380,7 @@ public function testSetIdThrowsExceptionOnInvalidParameter() try { $writer->setId(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -386,7 +390,7 @@ public function testSetIdThrowsExceptionOnInvalidUri() try { $writer->setId('http://'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -409,7 +413,7 @@ public function testSetLanguageThrowsExceptionOnInvalidParameter() try { $writer->setLanguage(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -432,7 +436,7 @@ public function testSetLinkThrowsExceptionOnEmptyString() try { $writer->setLink(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -442,7 +446,7 @@ public function testSetLinkThrowsExceptionOnInvalidUri() try { $writer->setLink('http://'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -465,7 +469,7 @@ public function testSetEncodingThrowsExceptionOnInvalidParameter() try { $writer->setEncoding(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -488,7 +492,7 @@ public function testSetTitleThrowsExceptionOnInvalidParameter() try { $writer->setTitle(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -529,7 +533,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidName() try { $writer->setGenerator([]); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -540,7 +544,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidVersion() $writer->setGenerator(['name' => 'ZFW', 'version' => '']); $this->fail('Should have failed since version is empty'); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -552,7 +556,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidUri() $writer->setGenerator(['name' => 'ZFW', 'uri' => 'notauri']); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -597,7 +601,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidNameDeprecated() try { $writer->setGenerator(''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -610,7 +614,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidVersionDeprecated() try { $writer->setGenerator('ZFW', ''); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -624,7 +628,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidUriDeprecated() try { $writer->setGenerator('ZFW', null, 'notauri'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -647,7 +651,7 @@ public function testSetsFeedLinkThrowsExceptionOnInvalidType() try { $writer->setFeedLink('http://www.example.com/rss', 'abc'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -657,7 +661,7 @@ public function testSetsFeedLinkThrowsExceptionOnInvalidUri() try { $writer->setFeedLink('http://', 'rss'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -680,7 +684,7 @@ public function testSetsBaseUrlThrowsExceptionOnInvalidUri() try { $writer->setBaseUrl('http://'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -710,7 +714,7 @@ public function testAddingHubUrlThrowsExceptionOnInvalidUri() try { $writer->addHub('http://'); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -724,7 +728,7 @@ public function testCreatesNewEntryDataContainer() { $writer = new Writer\Feed; $entry = $writer->createEntry(); - $this->assertInstanceOf('Zend\Feed\Writer\Entry', $entry); + $this->assertInstanceOf(Entry::class, $entry); } public function testAddsCategory() @@ -748,7 +752,7 @@ public function testAddingCategoryWithoutTermThrowsException() $writer->addCategory(['label' => 'Cats & Dogs', 'scheme' => 'http://www.example.com/schema1']); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -759,7 +763,7 @@ public function testAddingCategoryWithInvalidUriAsSchemeThrowsException() $writer->addCategory(['term' => 'cat_dog', 'scheme' => 'http://']); $this->fail(); - } catch (Writer\Exception\ExceptionInterface $e) { + } catch (ExceptionInterface $e) { } } @@ -776,31 +780,25 @@ public function testSetsImageUri() ], $writer->getImage()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetsImageUriThrowsExceptionOnEmptyUri() { + $this->expectException(ExceptionInterface::class); $writer = new Writer\Feed; $writer->setImage([ 'uri' => '' ]); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetsImageUriThrowsExceptionOnMissingUri() { + $this->expectException(ExceptionInterface::class); $writer = new Writer\Feed; $writer->setImage([]); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testSetsImageUriThrowsExceptionOnInvalidUri() { + $this->expectException(ExceptionInterface::class); $writer = new Writer\Feed; $writer->setImage([ 'uri' => 'http://' @@ -978,7 +976,7 @@ public function testCreateTombstone() $writer = new Writer\Feed; $tombstone = $writer->createTombstone(); - $this->assertInstanceOf('Zend\Feed\Writer\Deleted', $tombstone); + $this->assertInstanceOf(Deleted::class, $tombstone); return $tombstone; } @@ -992,7 +990,7 @@ public function testAddTombstone() $tombstone = $writer->createTombstone(); $writer->addTombstone($tombstone); - $this->assertInstanceOf('Zend\Feed\Writer\Deleted', $writer->getEntry(0)); + $this->assertInstanceOf(Deleted::class, $writer->getEntry(0)); } /** diff --git a/test/Writer/Renderer/Entry/AtomTest.php b/test/Writer/Renderer/Entry/AtomTest.php index 442f475e..8ded0810 100644 --- a/test/Writer/Renderer/Entry/AtomTest.php +++ b/test/Writer/Renderer/Entry/AtomTest.php @@ -9,6 +9,8 @@ namespace ZendTest\Feed\Writer\Renderer\Entry; +use PHPUnit\Framework\TestCase; +use Zend\Feed\Writer\Exception\ExceptionInterface; use Zend\Feed\Writer\Renderer; use Zend\Feed\Writer; use Zend\Feed\Reader; @@ -17,7 +19,7 @@ * @group Zend_Feed * @group Zend_Feed_Writer */ -class AtomTest extends \PHPUnit_Framework_TestCase +class AtomTest extends TestCase { protected $validWriter = null; protected $validEntry = null; @@ -86,11 +88,9 @@ public function testEntryTitleHasBeenSet() $this->assertEquals('This is a test entry.', $entry->getTitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validEntry->remove('title'); $atomFeed->render(); @@ -115,11 +115,9 @@ public function testEntryContentHasBeenSetXhtml() $this->assertEquals('

This is test content for xhtml:

', $entry->getContent()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedContentIfMissingThrowsExceptionIfThereIsNoLink() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validEntry->remove('content'); $this->validEntry->remove('link'); @@ -134,11 +132,9 @@ public function testEntryUpdatedDateHasBeenSet() $this->assertEquals(1234567890, $entry->getDateModified()->getTimestamp()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedUpdatedDateIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validEntry->remove('dateModified'); $atomFeed->render(); @@ -226,22 +222,18 @@ public function testFeedIdDefaultIsUsedIfNotSetByHand() $this->assertEquals($entry->getLink(), $entry->getId()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedIdIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validEntry->remove('id'); $this->validEntry->remove('link'); $atomFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedIdThrowsExceptionIfNotUri() { + $this->expectException(ExceptionInterface::class); $this->markTestIncomplete('Pending Zend\URI fix for validation'); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validEntry->remove('id'); diff --git a/test/Writer/Renderer/Entry/RssTest.php b/test/Writer/Renderer/Entry/RssTest.php index ae371429..f3ba5644 100644 --- a/test/Writer/Renderer/Entry/RssTest.php +++ b/test/Writer/Renderer/Entry/RssTest.php @@ -9,6 +9,8 @@ namespace ZendTest\Feed\Writer\Renderer\Entry; +use PHPUnit\Framework\TestCase; +use Zend\Feed\Writer\Exception\ExceptionInterface; use Zend\Feed\Writer\Renderer; use Zend\Feed\Writer; use Zend\Feed\Reader; @@ -17,7 +19,7 @@ * @group Zend_Feed * @group Zend_Feed_Writer */ -class RssTest extends \PHPUnit_Framework_TestCase +class RssTest extends TestCase { protected $validWriter = null; protected $validEntry = null; @@ -75,11 +77,9 @@ public function testEntryTitleHasBeenSet() $this->assertEquals('This is a test entry.', $entry->getTitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testEntryTitleIfMissingThrowsExceptionIfDescriptionAlsoMissing() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->remove('title'); $this->validEntry->remove('description'); @@ -103,11 +103,9 @@ public function testEntrySummaryDescriptionHasBeenSet() $this->assertEquals('This is a test entry description.', $entry->getDescription()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testEntryDescriptionIfMissingThrowsExceptionIfAlsoNoTitle() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->remove('description'); $this->validEntry->remove('title'); @@ -207,11 +205,9 @@ public function testEntryHoldsAnyEnclosureAdded() $this->assertEquals('http://example.com/audio.mp3', $enc->url); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionOnMissingType() { + $this->expectException(ExceptionInterface::class); $renderer = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->setEnclosure([ 'uri' => 'http://example.com/audio.mp3', @@ -220,11 +216,9 @@ public function testAddsEnclosureThrowsExceptionOnMissingType() $renderer->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionOnMissingLength() { + $this->expectException(ExceptionInterface::class); $renderer = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->setEnclosure([ 'type' => 'audio/mpeg', @@ -233,11 +227,9 @@ public function testAddsEnclosureThrowsExceptionOnMissingLength() $renderer->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionOnNonNumericLength() { + $this->expectException(ExceptionInterface::class); $renderer = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->setEnclosure([ 'type' => 'audio/mpeg', @@ -247,11 +239,9 @@ public function testAddsEnclosureThrowsExceptionOnNonNumericLength() $renderer->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testAddsEnclosureThrowsExceptionOnNegativeLength() { + $this->expectException(ExceptionInterface::class); $renderer = new Renderer\Feed\Rss($this->validWriter); $this->validEntry->setEnclosure([ 'type' => 'audio/mpeg', diff --git a/test/Writer/Renderer/Feed/AtomTest.php b/test/Writer/Renderer/Feed/AtomTest.php index 3b95dc04..20e14fad 100644 --- a/test/Writer/Renderer/Feed/AtomTest.php +++ b/test/Writer/Renderer/Feed/AtomTest.php @@ -9,15 +9,18 @@ namespace ZendTest\Feed\Writer\Renderer\Feed; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; use Zend\Feed\Writer\Renderer; use Zend\Feed\Reader; +use Zend\Feed\Writer\Feed; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class AtomTest extends \PHPUnit_Framework_TestCase +class AtomTest extends TestCase { protected $validWriter = null; @@ -45,7 +48,7 @@ public function testSetsWriterInConstructor() { $writer = new Writer\Feed; $feed = new Renderer\Feed\Atom($writer); - $this->assertInstanceOf('Zend\Feed\Writer\Feed', $feed->getDataContainer()); + $this->assertInstanceOf(Feed::class, $feed->getDataContainer()); } public function testBuildMethodRunsMinimalWriterContainerProperlyBeforeICheckAtomCompliance() @@ -97,11 +100,9 @@ public function testFeedTitleHasBeenSet() $this->assertEquals('This is a test feed.', $feed->getTitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validWriter->remove('title'); $atomFeed->render(); @@ -154,11 +155,9 @@ public function testFeedUpdatedDateHasBeenSet() $this->assertEquals(1234567890, $feed->getDateModified()->getTimestamp()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedUpdatedDateIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validWriter->remove('dateModified'); $atomFeed->render(); @@ -240,11 +239,9 @@ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsNoExceptionIfIdSet $atomFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsExceptionIfIdMissing() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validWriter->remove('link'); $atomFeed->render(); @@ -258,11 +255,9 @@ public function testFeedIncludesLinkToXmlAtomWhereTheFeedWillBeAvailable() $this->assertEquals('http://www.example.com/atom', $feed->getFeedLink()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedLinkToXmlAtomWhereTheFeedWillBeAvailableIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $atomFeed = new Renderer\Feed\Atom($this->validWriter); $this->validWriter->remove('feedLinks'); $atomFeed->render(); diff --git a/test/Writer/Renderer/Feed/RssTest.php b/test/Writer/Renderer/Feed/RssTest.php index 94ed07d6..b05f9f09 100644 --- a/test/Writer/Renderer/Feed/RssTest.php +++ b/test/Writer/Renderer/Feed/RssTest.php @@ -10,16 +10,19 @@ namespace ZendTest\Feed\Writer\Renderer\Feed; use DateTime; +use PHPUnit\Framework\TestCase; use Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\ExceptionInterface; use Zend\Feed\Writer\Renderer; use Zend\Feed\Writer\Version; use Zend\Feed\Reader; +use Zend\Feed\Writer\Feed; /** * @group Zend_Feed * @group Zend_Feed_Writer */ -class RssTest extends \PHPUnit_Framework_TestCase +class RssTest extends TestCase { protected $validWriter = null; @@ -42,7 +45,7 @@ public function testSetsWriterInConstructor() { $writer = new Writer\Feed; $feed = new Renderer\Feed\Rss($writer); - $this->assertInstanceOf('Zend\Feed\Writer\Feed', $feed->getDataContainer()); + $this->assertInstanceOf(Feed::class, $feed->getDataContainer()); } public function testBuildMethodRunsMinimalWriterContainerProperlyBeforeICheckRssCompliance() @@ -76,11 +79,9 @@ public function testFeedTitleHasBeenSet() $this->assertEquals('This is a test feed.', $feed->getTitle()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $rssFeed = new Renderer\Feed\Rss($this->validWriter); $this->validWriter->remove('title'); $rssFeed->render(); @@ -106,11 +107,9 @@ public function testFeedDescriptionHasBeenSet() $this->assertEquals('This is a test description.', $feed->getDescription()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedDescriptionThrowsExceptionIfMissing() { + $this->expectException(ExceptionInterface::class); $rssFeed = new Renderer\Feed\Rss($this->validWriter); $this->validWriter->remove('description'); $rssFeed->render(); @@ -212,11 +211,9 @@ public function testFeedIncludesLinkToHtmlVersionOfFeed() $this->assertEquals('http://www.example.com', $feed->getLink()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsException() { + $this->expectException(ExceptionInterface::class); $rssFeed = new Renderer\Feed\Rss($this->validWriter); $this->validWriter->remove('link'); $rssFeed->render(); @@ -416,11 +413,9 @@ public function testImageCanBeSetWithOnlyRequiredElements() $this->assertEquals($expected, $feed->getImage()); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionOnMissingLink() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'title' => 'Image ALT' @@ -429,11 +424,9 @@ public function testImageThrowsExceptionOnMissingLink() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionOnMissingTitle() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com' @@ -442,11 +435,9 @@ public function testImageThrowsExceptionOnMissingTitle() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionOnMissingUri() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'link' => 'http://www.example.com', 'title' => 'Image ALT' @@ -455,11 +446,9 @@ public function testImageThrowsExceptionOnMissingUri() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalDescriptionInvalid() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -470,11 +459,9 @@ public function testImageThrowsExceptionIfOptionalDescriptionInvalid() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalDescriptionEmpty() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -485,11 +472,9 @@ public function testImageThrowsExceptionIfOptionalDescriptionEmpty() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalHeightNotAnInteger() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -501,11 +486,9 @@ public function testImageThrowsExceptionIfOptionalHeightNotAnInteger() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalHeightEmpty() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -517,11 +500,9 @@ public function testImageThrowsExceptionIfOptionalHeightEmpty() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalHeightGreaterThan400() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -533,11 +514,9 @@ public function testImageThrowsExceptionIfOptionalHeightGreaterThan400() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalWidthNotAnInteger() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -549,11 +528,9 @@ public function testImageThrowsExceptionIfOptionalWidthNotAnInteger() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalWidthEmpty() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -565,11 +542,9 @@ public function testImageThrowsExceptionIfOptionalWidthEmpty() $rssFeed->render(); } - /** - * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface - */ public function testImageThrowsExceptionIfOptionalWidthGreaterThan144() { + $this->expectException(ExceptionInterface::class); $this->validWriter->setImage([ 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', diff --git a/test/bootstrap.php b/test/bootstrap.php deleted file mode 100644 index e055f5c6..00000000 --- a/test/bootstrap.php +++ /dev/null @@ -1,34 +0,0 @@ -