From 9feec5f24e941fb7a1c9befb86bc6b258d9e6ef4 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 11 Dec 2018 13:19:24 +0000 Subject: [PATCH 1/3] Add zendframework/zend-hydrator v3 support and PHP 7.3 --- .travis.yml | 15 +- composer.json | 2 +- composer.lock | 404 ++++++++---------- test/Assertions.php | 10 + ...NestedCollectionResourceGenerationTest.php | 9 +- .../ResourceWithNestedInstancesTest.php | 9 +- ...outeBasedCollectionWithRouteParamsTest.php | 13 +- .../UrlBasedCollectionWithRouteParamsTest.php | 13 +- test/ResourceGeneratorTest.php | 37 +- 9 files changed, 248 insertions(+), 264 deletions(-) diff --git a/.travis.yml b/.travis.yml index 49bc879..c0ffb52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -sudo: false - language: php cache: @@ -19,6 +17,7 @@ matrix: - php: 7.1 env: - DEPS=locked + - LEGACY_DEPS="zendframework/zend-hydrator" - CS_CHECK=true - TEST_COVERAGE=true - php: 7.1 @@ -33,12 +32,22 @@ matrix: - php: 7.2 env: - DEPS=latest + - php: 7.3 + env: + - DEPS=lowest + - php: 7.3 + env: + - DEPS=locked + - php: 7.3 + env: + - DEPS=latest before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi install: - - travis_retry composer install $COMPOSER_ARGS + - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs + - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update --with-dependencies $COMPOSER_ARGS $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 [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi diff --git a/composer.json b/composer.json index a2fd3d0..5e9c568 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "phpunit/phpunit": "^7.0.1", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-expressive-helpers": "^5.0.0alpha3", - "zendframework/zend-hydrator": "^2.3.1", + "zendframework/zend-hydrator": "^2.3.1 || ^3.0", "zendframework/zend-paginator": "^2.7" }, "provide": { diff --git a/composer.lock b/composer.lock index 49fb45e..0056d3f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d9e512664a27e5b6258805f342a9a86", + "content-hash": "a0f34504b090c3d7c621b2babc3735a4", "packages": [ { "name": "psr/http-message", @@ -215,16 +215,16 @@ }, { "name": "fig/http-message-util", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-message-util.git", - "reference": "20b2c280cb6914b7b83089720df44e490f4b42f0" + "reference": "35b19404371b31b3a43823c755398c48c9966db4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/20b2c280cb6914b7b83089720df44e490f4b42f0", - "reference": "20b2c280cb6914b7b83089720df44e490f4b42f0", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/35b19404371b31b3a43823c755398c48c9966db4", + "reference": "35b19404371b31b3a43823c755398c48c9966db4", "shasum": "" }, "require": { @@ -261,29 +261,32 @@ "request", "response" ], - "time": "2017-02-09T16:10:21+00:00" + "time": "2018-11-19T16:19:58+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -306,26 +309,26 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -361,20 +364,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -408,7 +411,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -564,33 +567,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -623,31 +626,31 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.0.1", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f8ca4b604baf23dab89d87773c28cc07405189ba", - "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", "php": "^7.1", - "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, @@ -660,7 +663,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -686,29 +689,32 @@ "testing", "xunit" ], - "time": "2018-02-02T07:01:41+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -723,7 +729,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -733,7 +739,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -827,16 +833,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { @@ -872,51 +878,55 @@ "keywords": [ "tokenizer" ], - "time": "2018-02-01T13:16:43+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "7.0.2", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9" + "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/520723129e2b3fc1dc4c0953e43c9d40e1ecb352", + "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", - "phpunit/phpunit-mock-objects": "^6.0", - "sebastian/comparator": "^2.1", + "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", "phpunit/php-invoker": "^2.0" }, @@ -926,7 +936,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -952,63 +962,7 @@ "testing", "xunit" ], - "time": "2018-02-26T07:03:12+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "6.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e3249dedc2d99259ccae6affbc2684eac37c2e53", - "reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.1", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.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": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-02-15T05:27:38+00:00" + "time": "2018-12-07T07:08:12+00:00" }, { "name": "psr/container", @@ -1061,16 +1015,16 @@ }, { "name": "psr/http-server-handler", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "439d92054dc06097f2406ec074a2627839955a02" + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/439d92054dc06097f2406ec074a2627839955a02", - "reference": "439d92054dc06097f2406ec074a2627839955a02", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", "shasum": "" }, "require": { @@ -1110,20 +1064,20 @@ "response", "server" ], - "time": "2018-01-22T17:04:15+00:00" + "time": "2018-10-30T16:46:14+00:00" }, { "name": "psr/http-server-middleware", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5" + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", - "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", "shasum": "" }, "require": { @@ -1163,7 +1117,7 @@ "request", "response" ], - "time": "2018-01-22T17:08:31+00:00" + "time": "2018-10-30T17:12:04+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1212,30 +1166,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1272,20 +1226,20 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8" + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e09160918c66281713f1c324c1f4c4c3037ba1e8", - "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { @@ -1328,32 +1282,32 @@ "unidiff", "unified diff" ], - "time": "2018-02-01T13:45:15+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/febd209a219cea7b56ad799b30ebbea34b71eb8f", + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1378,7 +1332,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2018-11-25T09:31:21+00:00" }, { "name": "sebastian/exporter", @@ -1645,25 +1599,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1683,7 +1637,7 @@ ], "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" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -1730,16 +1684,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", "shasum": "" }, "require": { @@ -1804,7 +1758,7 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2018-11-07T22:31:41+00:00" }, { "name": "theseer/tokenizer", @@ -1927,16 +1881,16 @@ }, { "name": "zendframework/zend-expressive-helpers", - "version": "5.0.0alpha3", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-helpers.git", - "reference": "424d98086041c833c22cc5787c246c56dadff212" + "reference": "c4db15318ae53965794f46618535fc61dd058ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/424d98086041c833c22cc5787c246c56dadff212", - "reference": "424d98086041c833c22cc5787c246c56dadff212", + "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/c4db15318ae53965794f46618535fc61dd058ea7", + "reference": "c4db15318ae53965794f46618535fc61dd058ea7", "shasum": "" }, "require": { @@ -1944,26 +1898,20 @@ "psr/container": "^1.0", "psr/http-message": "^1.0.1", "psr/http-server-middleware": "^1.0", - "zendframework/zend-expressive-router": "^3.0.0alpha1 || ^3.0" + "zendframework/zend-expressive-router": "^3.0" }, "require-dev": { "malukenho/docheader": "^0.1.6", "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.5.5", + "phpunit/phpunit": "^7.0.2", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-diactoros": "^1.3.10" - }, - "suggest": { - "aura/di": "^3.2 to make use of Aura.Di dependency injection container", - "mouf/pimple-interop": "^1.0 to use Pimple for dependency injection", - "zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection" + "zendframework/zend-diactoros": "^1.7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2.x-dev", - "dev-develop": "4.3.x-dev", - "dev-release-5.0.0": "5.0.x-dev" + "dev-master": "5.1.x-dev", + "dev-develop": "5.2.x-dev" }, "zf": { "config-provider": "Zend\\Expressive\\Helper\\ConfigProvider" @@ -1989,20 +1937,20 @@ "zend-expressive", "zf" ], - "time": "2018-02-06T21:16:07+00:00" + "time": "2018-07-26T20:05:23+00:00" }, { "name": "zendframework/zend-expressive-router", - "version": "3.0.0alpha3", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-router.git", - "reference": "737f79bffa8900388367d02e66dc0d0bcdba1eed" + "reference": "072d6b0620f7e1e616cb60062425b4eedd1a0447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/737f79bffa8900388367d02e66dc0d0bcdba1eed", - "reference": "737f79bffa8900388367d02e66dc0d0bcdba1eed", + "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/072d6b0620f7e1e616cb60062425b4eedd1a0447", + "reference": "072d6b0620f7e1e616cb60062425b4eedd1a0447", "shasum": "" }, "require": { @@ -2014,7 +1962,7 @@ }, "require-dev": { "malukenho/docheader": "^0.1.6", - "phpunit/phpunit": "^6.5.5", + "phpunit/phpunit": "^7.0.2", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { @@ -2025,9 +1973,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev", - "dev-develop": "2.4.x-dev", - "dev-release-3.0.0": "3.0.x-dev" + "dev-master": "3.1.x-dev", + "dev-develop": "3.2.x-dev" }, "zf": { "config-provider": "Zend\\Expressive\\Router\\ConfigProvider" @@ -2053,48 +2000,47 @@ "zend-expressive", "zf" ], - "time": "2018-02-21T18:39:37+00:00" + "time": "2018-06-05T15:28:00+00:00" }, { "name": "zendframework/zend-hydrator", - "version": "2.3.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-hydrator.git", - "reference": "de0d6465fbc4b7ca345fddc148834c321c4b361f" + "reference": "baa10aaafe92559d2579d3dc8417b7b690f260bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/de0d6465fbc4b7ca345fddc148834c321c4b361f", - "reference": "de0d6465fbc4b7ca345fddc148834c321c4b361f", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/baa10aaafe92559d2579d3dc8417b7b690f260bc", + "reference": "baa10aaafe92559d2579d3dc8417b7b690f260bc", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "zendframework/zend-stdlib": "^3.0" + "php": "^7.2", + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { - "phpunit/phpunit": "^5.7.21 || ^6.3", + "phpspec/prophecy": "^1.7.5", + "phpstan/phpstan": "^0.10.5", + "phpunit/phpunit": "^7.5", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-eventmanager": "^3.0", - "zendframework/zend-filter": "^2.6", - "zendframework/zend-inputfilter": "^2.6", - "zendframework/zend-serializer": "^2.6.1", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + "zendframework/zend-eventmanager": "^3.2.1", + "zendframework/zend-modulemanager": "^2.8", + "zendframework/zend-serializer": "^2.9", + "zendframework/zend-servicemanager": "^3.3.2" }, "suggest": { - "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", - "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage", - "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" + "zendframework/zend-eventmanager": "^3.2, to support aggregate hydrator usage", + "zendframework/zend-serializer": "^2.9, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^3.3, to support hydrator plugin manager usage" }, "type": "library", "extra": { "branch-alias": { - "dev-release-1.0": "1.0-dev", - "dev-release-1.1": "1.1-dev", - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" + "dev-release-2.4": "2.4.x-dev", + "dev-master": "3.0.x-dev", + "dev-develop": "3.1.x-dev" }, "zf": { "component": "Zend\\Hydrator", @@ -2110,12 +2056,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-hydrator", + "description": "Serialize objects to arrays, and vice versa", "keywords": [ + "ZendFramework", "hydrator", - "zf2" + "zf" ], - "time": "2017-10-02T15:01:27+00:00" + "time": "2018-12-10T17:48:39+00:00" }, { "name": "zendframework/zend-paginator", @@ -2184,31 +2131,31 @@ }, { "name": "zendframework/zend-stdlib", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + "reference": "66536006722aff9e62d1b331025089b7ec71c065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.6.2" + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -2220,12 +2167,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "SPL extensions, array utilities, error handlers, and more", "keywords": [ + "ZendFramework", "stdlib", - "zf2" + "zf" ], - "time": "2016-09-13T14:38:50+00:00" + "time": "2018-08-28T21:34:05+00:00" } ], "aliases": [], diff --git a/test/Assertions.php b/test/Assertions.php index 9d6e02d..aaba17b 100644 --- a/test/Assertions.php +++ b/test/Assertions.php @@ -9,8 +9,11 @@ use Zend\Expressive\Hal\HalResource; use Zend\Expressive\Hal\Link; +use Zend\Hydrator\ObjectProperty; +use Zend\Hydrator\ObjectPropertyHydrator; use function array_shift; +use function class_exists; use function count; use function get_class; use function gettype; @@ -21,6 +24,13 @@ trait Assertions { + public static function getObjectPropertyHydratorClass() : string + { + return class_exists(ObjectPropertyHydrator::class) + ? ObjectPropertyHydrator::class + : ObjectProperty::class; + } + public static function getLinkByRel(string $rel, HalResource $resource) : Link { $links = $resource->getLinksByRel($rel); diff --git a/test/ResourceGenerator/NestedCollectionResourceGenerationTest.php b/test/ResourceGenerator/NestedCollectionResourceGenerationTest.php index a2566a1..d334292 100644 --- a/test/ResourceGenerator/NestedCollectionResourceGenerationTest.php +++ b/test/ResourceGenerator/NestedCollectionResourceGenerationTest.php @@ -17,7 +17,6 @@ use Zend\Expressive\Hal\Metadata\RouteBasedCollectionMetadata; use Zend\Expressive\Hal\Metadata\RouteBasedResourceMetadata; use Zend\Expressive\Hal\ResourceGenerator; -use Zend\Hydrator\ObjectProperty as ObjectPropertyHydrator; use ZendTest\Expressive\Hal\Assertions; use ZendTest\Expressive\Hal\TestAsset; @@ -91,7 +90,7 @@ private function createMetadataMap() $fooBarMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $metadataMap->has(TestAsset\FooBar::class)->willReturn(true); @@ -100,7 +99,7 @@ private function createMetadataMap() $childMetadata = new RouteBasedResourceMetadata( TestAsset\Child::class, 'child', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $metadataMap->has(TestAsset\Child::class)->willReturn(true); @@ -120,8 +119,10 @@ private function createMetadataMap() private function createHydrators() { + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); return $hydrators; } diff --git a/test/ResourceGenerator/ResourceWithNestedInstancesTest.php b/test/ResourceGenerator/ResourceWithNestedInstancesTest.php index a062e89..0b6f756 100644 --- a/test/ResourceGenerator/ResourceWithNestedInstancesTest.php +++ b/test/ResourceGenerator/ResourceWithNestedInstancesTest.php @@ -17,7 +17,6 @@ use Zend\Expressive\Hal\Metadata\RouteBasedCollectionMetadata; use Zend\Expressive\Hal\Metadata\RouteBasedResourceMetadata; use Zend\Expressive\Hal\ResourceGenerator; -use Zend\Hydrator\ObjectProperty as ObjectPropertyHydrator; use ZendTest\Expressive\Hal\Assertions; use ZendTest\Expressive\Hal\TestAsset; @@ -74,7 +73,7 @@ public function createMetadataMap() $fooBarMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $metadataMap->has(TestAsset\FooBar::class)->willReturn(true); @@ -83,7 +82,7 @@ public function createMetadataMap() $childMetadata = new RouteBasedResourceMetadata( TestAsset\Child::class, 'child', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $metadataMap->has(TestAsset\Child::class)->willReturn(true); @@ -119,8 +118,10 @@ public function createLinkGenerator($request) public function createHydrators() { + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); return $hydrators; } } diff --git a/test/ResourceGenerator/RouteBasedCollectionWithRouteParamsTest.php b/test/ResourceGenerator/RouteBasedCollectionWithRouteParamsTest.php index c557eed..67fecbf 100644 --- a/test/ResourceGenerator/RouteBasedCollectionWithRouteParamsTest.php +++ b/test/ResourceGenerator/RouteBasedCollectionWithRouteParamsTest.php @@ -17,7 +17,6 @@ use Zend\Expressive\Hal\Metadata\RouteBasedCollectionMetadata; use Zend\Expressive\Hal\Metadata\RouteBasedResourceMetadata; use Zend\Expressive\Hal\ResourceGenerator; -use Zend\Hydrator\ObjectProperty as ObjectPropertyHydrator; use Zend\Paginator\Adapter\ArrayAdapter; use Zend\Paginator\Paginator; use ZendTest\Expressive\Hal\Assertions; @@ -47,7 +46,7 @@ public function testUsesRouteParamsAndQueriesWithPaginatorSpecifiedInMetadataWhe $resourceMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'bar_id', ['foo_id' => 1234] @@ -69,8 +68,10 @@ public function testUsesRouteParamsAndQueriesWithPaginatorSpecifiedInMetadataWhe $metadataMap->has(Paginator::class)->willReturn(true); $metadataMap->get(Paginator::class)->willReturn($collectionMetadata); + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $collection = new Paginator(new ArrayAdapter($this->createCollectionItems( $linkGenerator, @@ -123,7 +124,7 @@ public function testUsesRouteParamsAndQueriesSpecifiedInMetadataWhenGeneratingLi $resourceMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'bar_id', ['foo_id' => 1234] @@ -153,8 +154,10 @@ public function testUsesRouteParamsAndQueriesSpecifiedInMetadataWhenGeneratingLi $metadataMap->has(\ArrayObject::class)->willReturn(true); $metadataMap->get(\ArrayObject::class)->willReturn($collectionMetadata); + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $collection = new \ArrayObject($this->createCollectionItems( $linkGenerator, diff --git a/test/ResourceGenerator/UrlBasedCollectionWithRouteParamsTest.php b/test/ResourceGenerator/UrlBasedCollectionWithRouteParamsTest.php index 1efe98b..44bf1e6 100644 --- a/test/ResourceGenerator/UrlBasedCollectionWithRouteParamsTest.php +++ b/test/ResourceGenerator/UrlBasedCollectionWithRouteParamsTest.php @@ -17,7 +17,6 @@ use Zend\Expressive\Hal\Metadata\RouteBasedResourceMetadata; use Zend\Expressive\Hal\Metadata\UrlBasedCollectionMetadata; use Zend\Expressive\Hal\ResourceGenerator; -use Zend\Hydrator\ObjectProperty as ObjectPropertyHydrator; use Zend\Paginator\Adapter\ArrayAdapter; use Zend\Paginator\Paginator; use ZendTest\Expressive\Hal\Assertions; @@ -43,7 +42,7 @@ public function testUsesQueriesWithPaginatorSpecifiedInMetadataWhenGeneratingLin $resourceMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'bar_id', ['foo_id' => 1234] @@ -63,8 +62,10 @@ public function testUsesQueriesWithPaginatorSpecifiedInMetadataWhenGeneratingLin $metadataMap->has(Paginator::class)->willReturn(true); $metadataMap->get(Paginator::class)->willReturn($collectionMetadata); + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $collection = new Paginator(new ArrayAdapter($this->createCollectionItems($linkGenerator, $request))); $collection->setItemCountPerPage(3); @@ -113,7 +114,7 @@ public function testUsesQueriesSpecifiedInMetadataWhenGeneratingLinkHref() $resourceMetadata = new RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'bar_id', ['foo_id' => 1234] @@ -134,8 +135,10 @@ public function testUsesQueriesSpecifiedInMetadataWhenGeneratingLinkHref() $metadataMap->has(\ArrayObject::class)->willReturn(true); $metadataMap->get(\ArrayObject::class)->willReturn($collectionMetadata); + $hydratorClass = self::getObjectPropertyHydratorClass(); + $hydrators = $this->prophesize(ContainerInterface::class); - $hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $collection = new \ArrayObject(); diff --git a/test/ResourceGeneratorTest.php b/test/ResourceGeneratorTest.php index 29ecd44..56db21a 100644 --- a/test/ResourceGeneratorTest.php +++ b/test/ResourceGeneratorTest.php @@ -23,7 +23,6 @@ use Zend\Expressive\Hal\Metadata; use Zend\Expressive\Hal\ResourceGenerator; use Zend\Expressive\Hal\ResourceGenerator\Exception\OutOfBoundsException; -use Zend\Hydrator\ObjectProperty as ObjectPropertyHydrator; use Zend\Paginator\Adapter\ArrayAdapter; use Zend\Paginator\Paginator; use ZendTest\Expressive\Hal\TestAsset\TestMetadata; @@ -121,13 +120,15 @@ public function testCanGenerateUrlBasedResourceFromObjectDefinedInMetadataMap() $metadata = new Metadata\UrlBasedResourceMetadata( TestAsset\FooBar::class, '/api/foo/XXXX-YYYY-ZZZZ', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $this->metadataMap->has(TestAsset\FooBar::class)->willReturn(true); $this->metadataMap->get(TestAsset\FooBar::class)->willReturn($metadata); - $this->hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydratorClass = self::getObjectPropertyHydratorClass(); + + $this->hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $this->linkGenerator->fromRoute()->shouldNotBeCalled(); $resource = $this->generator->fromObject($instance, $this->request->reveal()); @@ -154,7 +155,7 @@ public function testCanGenerateRouteBasedResourceFromObjectDefinedInMetadataMap( $metadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] @@ -163,7 +164,9 @@ public function testCanGenerateRouteBasedResourceFromObjectDefinedInMetadataMap( $this->metadataMap->has(TestAsset\FooBar::class)->willReturn(true); $this->metadataMap->get(TestAsset\FooBar::class)->willReturn($metadata); - $this->hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydratorClass = self::getObjectPropertyHydratorClass(); + + $this->hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $this->linkGenerator ->fromRoute( 'self', @@ -205,7 +208,7 @@ public function testCanGenerateUrlBasedCollectionFromObjectDefinedInMetadataMap( $resourceMetadata = new Metadata\UrlBasedResourceMetadata( TestAsset\FooBar::class, '/api/foo/XXXX-YYYY-ZZZZ', - ObjectPropertyHydrator::class + self::getObjectPropertyHydratorClass() ); $this->metadataMap->has(TestAsset\FooBar::class)->willReturn(true); @@ -222,7 +225,9 @@ public function testCanGenerateUrlBasedCollectionFromObjectDefinedInMetadataMap( $collection = new ArrayIterator([$first, $second, $third]); - $this->hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydratorClass = self::getObjectPropertyHydratorClass(); + + $this->hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $this->linkGenerator->fromRoute()->shouldNotBeCalled(); $resource = $this->generator->fromObject($collection, $this->request->reveal()); @@ -263,7 +268,7 @@ public function testCanGenerateRouteBasedCollectionFromObjectDefinedInMetadataMa $resourceMetadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] @@ -346,7 +351,9 @@ public function testCanGenerateRouteBasedCollectionFromObjectDefinedInMetadataMa ) ->willReturn(new Link('last', '/api/foo-bar?page=5')); - $this->hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydratorClass = self::getObjectPropertyHydratorClass(); + + $this->hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $this->request->getQueryParams()->willReturn(['page' => 3]); @@ -391,7 +398,7 @@ public function testGeneratedRouteBasedCollectionCastsPaginationMetadataToIntege $resourceMetadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] @@ -474,7 +481,9 @@ public function testGeneratedRouteBasedCollectionCastsPaginationMetadataToIntege ) ->willReturn(new Link('last', '/api/foo-bar?page=5')); - $this->hydrators->get(ObjectPropertyHydrator::class)->willReturn(new ObjectPropertyHydrator()); + $hydratorClass = self::getObjectPropertyHydratorClass(); + + $this->hydrators->get($hydratorClass)->willReturn(new $hydratorClass()); $this->request->getQueryParams()->willReturn(['page' => '3']); @@ -497,7 +506,7 @@ public function testGeneratorDoesNotAcceptPageQueryOutOfBounds() $resourceMetadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] @@ -553,7 +562,7 @@ public function testGeneratorDoesNotAcceptNegativePageQuery() $resourceMetadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] @@ -609,7 +618,7 @@ public function testGeneratorAcceptsOnePageWhenCollectionHasNoEmbedded() $resourceMetadata = new Metadata\RouteBasedResourceMetadata( TestAsset\FooBar::class, 'foo-bar', - ObjectPropertyHydrator::class, + self::getObjectPropertyHydratorClass(), 'id', 'foo_bar_id', ['test' => 'param'] From 4e9a9e06dd8221bcc5bffc141e8f45362846dd28 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 11 Dec 2018 11:32:13 -0600 Subject: [PATCH 2/3] Adds CHANGELOG entry for #51 --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9986b6..ddbc7df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file, in reverse Versions prior to 0.4.0 were released as the package "weierophinney/hal". -## 1.2.0 - TBD +## 1.2.0 - 2018-12-11 ### Added -- Nothing. +- [#51](https://github.com/zendframework/zend-expressive-hal/pull/51) adds support for zend-hydrator version 3 releases. You may continue to use + version 2 releases as well. ### Changed From 2b2059e733e34fb8806f7ba40b735ced7c53dca5 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 11 Dec 2018 11:33:05 -0600 Subject: [PATCH 3/3] Updates branch aliases - dev-master => 1.2.x-dev - dev-develop => 1.3.x-dev --- composer.json | 4 ++-- composer.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5e9c568..3ed6f4d 100644 --- a/composer.json +++ b/composer.json @@ -61,8 +61,8 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev", - "dev-develop": "1.2.x-dev" + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" }, "zf": { "config-provider": "Zend\\Expressive\\Hal\\ConfigProvider" diff --git a/composer.lock b/composer.lock index 0056d3f..669937e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a0f34504b090c3d7c621b2babc3735a4", + "content-hash": "eb9959ea3eea92401b8db98effc3683c", "packages": [ { "name": "psr/http-message",