diff --git a/.gitignore b/.gitignore index f44f952..0e46839 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ # Composer /vendor /composer.phar +/build/ diff --git a/.travis.yml b/.travis.yml index 7964dd8..e282f88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,21 @@ sudo: false language: php php: - - 5.5 - 5.6 - 7 + - 7.1 install: - - composer install + - composer install --prefer-dist script: - composer cs - - composer test \ No newline at end of file + - composer test + +cache: + directories: + - $HOME/.composer/cache/files + +matrix: + allow_failures: + - php: 7.1 diff --git a/composer.json b/composer.json index 61a7a54..5f1470e 100644 --- a/composer.json +++ b/composer.json @@ -28,13 +28,12 @@ "require": { "php": ">=5.5.0", "webignition/internet-media-type":">=0.1,<1.0", - "webignition/web-page-model":">=1.0.2,<=1.0.5", - "guzzle/guzzle":">=3.8.1", + "guzzlehttp/guzzle":">=5.2.0,<5.3", "webignition/url":">=1.7.2,<2.0", - "webignition/cookie-url-matcher":">=0.1,<1.0" + "webignition/web-resource-service":"1.3.1" }, "require-dev": { - "phpunit/phpunit": "~4.0", + "phpunit/phpunit": "~5.0", "squizlabs/php_codesniffer": "3.*" }, "minimum-stability":"dev", diff --git a/composer.lock b/composer.lock index 6b48f27..be32fcc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,32 +4,33 @@ "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": "35c4b9b825c63e536e4f1b6741795a3f", + "content-hash": "19c834e45644bf2374a61a7dbfc027af", "packages": [ { "name": "doctrine/collections", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -70,7 +71,7 @@ "collections", "iterator" ], - "time": "2015-04-14T22:21:58+00:00" + "time": "2017-01-03T10:49:41+00:00" }, { "name": "etechnika/idna-convert", @@ -127,70 +128,37 @@ "time": "2014-02-15T12:42:32+00:00" }, { - "name": "guzzle/guzzle", - "version": "v3.9.3", + "name": "guzzlehttp/guzzle", + "version": "5.2.0", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "475b29ccd411f2fa8a408e64576418728c032cfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/475b29ccd411f2fa8a408e64576418728c032cfa", + "reference": "475b29ccd411f2fa8a408e64576418728c032cfa", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" + "guzzlehttp/ringphp": "~1.0", + "php": ">=5.4.0" }, "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + "ext-curl": "*", + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "psr-4": { + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -202,13 +170,9 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -219,21 +183,121 @@ "rest", "web service" ], - "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2015-01-28T01:03:29+00:00" + }, + { + "name": "guzzlehttp/ringphp", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/RingPHP.git", + "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", + "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", + "shasum": "" + }, + "require": { + "guzzlehttp/streams": "~3.0", + "php": ">=5.4.0", + "react/promise": "~2.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-curl": "Guzzle will use specific adapters if cURL is present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Ring\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "time": "2015-05-20T03:37:09+00:00" + }, + { + "name": "guzzlehttp/streams", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/streams.git", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "stream" + ], + "time": "2014-10-12T19:18:40+00:00" }, { "name": "masterminds/html5", - "version": "2.2.2", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "7866e93dcf0245de22378414e0c2c7350abc45af" + "reference": "2c37c6c520b995b761674de3be8455a381679067" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/7866e93dcf0245de22378414e0c2c7350abc45af", - "reference": "7866e93dcf0245de22378414e0c2c7350abc45af", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067", + "reference": "2c37c6c520b995b761674de3be8455a381679067", "shasum": "" }, "require": { @@ -285,7 +349,7 @@ "serializer", "xml" ], - "time": "2016-09-22T11:01:11+00:00" + "time": "2017-09-04T12:26:28+00:00" }, { "name": "querypath/querypath", @@ -330,45 +394,32 @@ "time": "2016-08-01T22:40:30+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v2.8.20", + "name": "react/promise", + "version": "v2.5.1", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531" + "url": "https://github.com/reactphp/promise.git", + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fc8e2b4118ff316550596357325dfd92a51f531", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531", + "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053", + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.4.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "phpunit/phpunit": "~4.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "React\\Promise\\": "src/" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -377,17 +428,16 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-04-26T16:56:54+00:00" + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "time": "2017-03-25T12:08:31+00:00" }, { "name": "webignition/character-set-list", @@ -437,127 +487,25 @@ "time": "2014-04-04T13:31:41+00:00" }, { - "name": "webignition/cookie-domain-matcher", - "version": "0.1.1", - "source": { - "type": "git", - "url": "https://github.com/webignition/cookie-domain-matcher.git", - "reference": "fceaa47ad3bb4f66a6e27d69b78e23dded5e6e84" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webignition/cookie-domain-matcher/zipball/fceaa47ad3bb4f66a6e27d69b78e23dded5e6e84", - "reference": "fceaa47ad3bb4f66a6e27d69b78e23dded5e6e84", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/class-loader": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "webignition\\Tests": "tests/", - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jon Cram", - "email": "jon@webignition.net" - } - ], - "description": "Implementation of cookie domain matching specified in RFC6265", - "homepage": "https://github.com/webignition/cookie-domain-matcher", - "keywords": [ - "cookie", - "domain", - "hostname" - ], - "time": "2014-03-14T13:26:13+00:00" - }, - { - "name": "webignition/cookie-path-matcher", - "version": "0.1", + "name": "webignition/disallowed-character-terminated-string", + "version": "1.0", "source": { "type": "git", - "url": "https://github.com/webignition/cookie-path-matcher.git", - "reference": "f045714ca5c6c7d9603e25d2ae153db696caf52c" + "url": "https://github.com/webignition/disallowed-character-terminated-string.git", + "reference": "25d12868c82b56bc0d04278e31594385ba4dddc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webignition/cookie-path-matcher/zipball/f045714ca5c6c7d9603e25d2ae153db696caf52c", - "reference": "f045714ca5c6c7d9603e25d2ae153db696caf52c", + "url": "https://api.github.com/repos/webignition/disallowed-character-terminated-string/zipball/25d12868c82b56bc0d04278e31594385ba4dddc4", + "reference": "25d12868c82b56bc0d04278e31594385ba4dddc4", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/class-loader": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "webignition\\Tests": "tests/", - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jon Cram", - "email": "jon@webignition.net" - } - ], - "description": "Implementation of cookie path matching specified in RFC6265", - "homepage": "https://github.com/webignition/cookie-path-matcher", - "keywords": [ - "cookie", - "matcher", - "path" - ], - "time": "2014-03-14T12:33:11+00:00" - }, - { - "name": "webignition/cookie-url-matcher", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/webignition/cookie-url-matcher.git", - "reference": "87b01ccb0264e49b5e53fdd5a546c44f2edc7978" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webignition/cookie-url-matcher/zipball/87b01ccb0264e49b5e53fdd5a546c44f2edc7978", - "reference": "87b01ccb0264e49b5e53fdd5a546c44f2edc7978", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "webignition/cookie-domain-matcher": ">=0.1.1,<1", - "webignition/cookie-path-matcher": ">=0.1,<1", - "webignition/url": ">=1.9.9,<2" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/class-loader": "*" - }, "type": "library", "autoload": { "psr-0": { - "webignition\\Tests": "tests/", "": "src/" } }, @@ -571,14 +519,13 @@ "email": "jon@webignition.net" } ], - "description": "For cookie domain and url comparisons", - "homepage": "https://github.com/webignition/cookie-url-matcher", + "description": "A string terminated by one or more disallowed characters", + "homepage": "https://github.com/webignition/disallowed-character-terminated-string", "keywords": [ - "cookie", - "matcher", - "url" + "string", + "terminated" ], - "time": "2014-03-14T14:04:40+00:00" + "time": "2012-07-16T21:29:50+00:00" }, { "name": "webignition/internet-media-type", @@ -632,25 +579,31 @@ }, { "name": "webignition/quoted-string", - "version": "0.1", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/webignition/quoted-string.git", - "reference": "43fa25f8c81eaa5aef4c2376703fe90d1449fdf8" + "reference": "88b36b7be067796683ab3668e175322842dd5313" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webignition/quoted-string/zipball/43fa25f8c81eaa5aef4c2376703fe90d1449fdf8", - "reference": "43fa25f8c81eaa5aef4c2376703fe90d1449fdf8", + "url": "https://api.github.com/repos/webignition/quoted-string/zipball/88b36b7be067796683ab3668e175322842dd5313", + "reference": "88b36b7be067796683ab3668e175322842dd5313", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.5.0", + "webignition/string-parser": ">=0.2.3,<1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "3.*" }, "type": "library", "autoload": { - "psr-0": { - "": "src/" + "psr-4": { + "webignition\\QuotedString\\": "src/", + "webignition\\Tests\\QuotedString\\": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -669,29 +622,35 @@ "parser", "quoted-string" ], - "time": "2012-08-15T16:52:06+00:00" + "time": "2017-05-11T11:41:31+00:00" }, { "name": "webignition/string-parser", - "version": "0.2.2", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/webignition/string-parser.git", - "reference": "eaa5a393ef3585783f6ef28558ef5183af00dcf7" + "reference": "8591e28c05bd250bcc67b8001f3588995b9ef74b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webignition/string-parser/zipball/eaa5a393ef3585783f6ef28558ef5183af00dcf7", - "reference": "eaa5a393ef3585783f6ef28558ef5183af00dcf7", + "url": "https://api.github.com/repos/webignition/string-parser/zipball/8591e28c05bd250bcc67b8001f3588995b9ef74b", + "reference": "8591e28c05bd250bcc67b8001f3588995b9ef74b", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "webignition/disallowed-character-terminated-string": ">=1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "3.*" }, "type": "library", "autoload": { - "psr-0": { - "": "src/" + "psr-4": { + "webignition\\StringParser\\": "src/", + "webignition\\Tests\\StringParser\\": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -710,7 +669,7 @@ "parser", "string" ], - "time": "2014-04-23T09:31:03+00:00" + "time": "2017-05-11T10:04:12+00:00" }, { "name": "webignition/url", @@ -757,29 +716,76 @@ ], "time": "2015-02-13T11:52:39+00:00" }, + { + "name": "webignition/web-json-model", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/webignition/web-json-model.git", + "reference": "0e260db63556cd951943655c893160ac9d03985d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webignition/web-json-model/zipball/0e260db63556cd951943655c893160ac9d03985d", + "reference": "0e260db63556cd951943655c893160ac9d03985d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "webignition/web-resource-model": ">=1.1.1,<2.0" + }, + "require-dev": { + "guzzlehttp/guzzle": ">=5.2.0,<5.3", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "webignition\\Tests": "tests/", + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jon Cram", + "email": "jon@webignition.net" + } + ], + "description": "PHP model of a web-based JSON resource, based on webignition/web-resource-model", + "homepage": "https://github.com/webignition/web-json-model", + "keywords": [ + "json", + "model" + ], + "time": "2015-03-26T12:16:01+00:00" + }, { "name": "webignition/web-page-model", - "version": "1.0.5", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/webignition/web-page-model.git", - "reference": "0eb2920a3f2883898b0137401499271a24194381" + "reference": "a6e4882ad53da8a6e9a05a5383794ccb94c608c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webignition/web-page-model/zipball/0eb2920a3f2883898b0137401499271a24194381", - "reference": "0eb2920a3f2883898b0137401499271a24194381", + "url": "https://api.github.com/repos/webignition/web-page-model/zipball/a6e4882ad53da8a6e9a05a5383794ccb94c608c1", + "reference": "a6e4882ad53da8a6e9a05a5383794ccb94c608c1", "shasum": "" }, "require": { - "php": ">=5.5.0", + "php": ">=5.4.0", "querypath/querypath": ">=3.0.0", "webignition/character-set-list": ">=0.2,<1.0", "webignition/internet-media-type": ">=0.1,<1.0", - "webignition/web-resource-model": ">=1.1.9,<1.2" + "webignition/web-resource-model": ">=1.2.1,<2.0" }, "require-dev": { - "guzzle/guzzle": ">=3.8.1,<4", + "guzzlehttp/guzzle": ">=5.2.0,<5.3", "phpunit/phpunit": "~4.0" }, "type": "library", @@ -805,27 +811,27 @@ "model", "webpage" ], - "time": "2017-05-04T16:10:03+00:00" + "time": "2015-02-23T14:39:04+00:00" }, { "name": "webignition/web-resource-model", - "version": "1.1.9", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/webignition/web-resource-model.git", - "reference": "08e6dc46608cfe9754ca84991eefd23842536cb7" + "reference": "8530a348211a80d752d91665b33298b11efc89b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webignition/web-resource-model/zipball/08e6dc46608cfe9754ca84991eefd23842536cb7", - "reference": "08e6dc46608cfe9754ca84991eefd23842536cb7", + "url": "https://api.github.com/repos/webignition/web-resource-model/zipball/8530a348211a80d752d91665b33298b11efc89b1", + "reference": "8530a348211a80d752d91665b33298b11efc89b1", "shasum": "" }, "require": { "doctrine/collections": "~1.0", - "guzzle/guzzle": ">=3.8.1,<4", + "guzzlehttp/guzzle": ">=5.2.0,<5.3", "php": ">=5.4.0", - "webignition/internet-media-type": ">=0.4.6,<2.0" + "webignition/internet-media-type": ">=0.4.7,<2.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -853,7 +859,55 @@ "modem", "web" ], - "time": "2015-02-19T22:53:21+00:00" + "time": "2015-02-23T14:34:39+00:00" + }, + { + "name": "webignition/web-resource-service", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/webignition/web-resource-service.git", + "reference": "861b90aa5dd0b95e40e1e5872a28368ad391ffa7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webignition/web-resource-service/zipball/861b90aa5dd0b95e40e1e5872a28368ad391ffa7", + "reference": "861b90aa5dd0b95e40e1e5872a28368ad391ffa7", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": ">=5.2.0,<5.3", + "php": ">=5.5.0", + "webignition/internet-media-type": ">=0.4.4,<2.0", + "webignition/url": ">=1.9.14,<2.0", + "webignition/web-json-model": ">=1.1,<2.0", + "webignition/web-page-model": ">=1.1,<2.0", + "webignition/web-resource-model": ">=1.2.1,<2.0" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~1.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "webignition\\WebResource\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Service to retrieve over HTTP a \\webignition\\WebResource\\WebResource", + "homepage": "https://github.com/webignition/web-resource-service", + "keywords": [ + "resource", + "service", + "web" + ], + "time": "2017-09-28T16:14:50+00:00" }, { "name": "xrstf/ip-utils", @@ -959,18 +1013,63 @@ ], "time": "2015-06-14T21:17:01+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -1011,26 +1110,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -1056,24 +1155,24 @@ } ], "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" + "time": "2017-11-10T14:09:06+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -1103,37 +1202,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "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" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1166,43 +1265,44 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "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": "~4" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -1228,20 +1328,20 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "3d478c5f9e8bb02b484a3fdc82693a460d7ee268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d478c5f9e8bb02b484a3fdc82693a460d7ee268", + "reference": "3d478c5f9e8bb02b484a3fdc82693a460d7ee268", "shasum": "" }, "require": { @@ -1275,7 +1375,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T07:49:00+00:00" }, { "name": "phpunit/php-text-template", @@ -1418,40 +1518,50 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "5.7.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "4b1c822a68ae6577df38a59eb49b046712ec0f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4b1c822a68ae6577df38a59eb49b046712ec0f6a", + "reference": "4b1c822a68ae6577df38a59eb49b046712ec0f6a", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", + "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": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "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|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { + "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -1460,7 +1570,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -1486,30 +1596,33 @@ "testing", "xunit" ], - "time": "2017-02-06T05:18:07+00:00" + "time": "2017-11-14T14:50:51+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.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": "~4.4" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" @@ -1517,7 +1630,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -1542,7 +1655,52 @@ "mock", "xunit" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2017-06-30T09:13:00+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", @@ -1610,23 +1768,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1658,32 +1816,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1708,25 +1866,25 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", @@ -1735,7 +1893,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1775,7 +1933,7 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -1828,18 +1986,64 @@ ], "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": "1.0.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { @@ -1851,7 +2055,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1879,23 +2083,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "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": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "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/" @@ -1914,20 +2168,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.0.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3" + "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b95ff2c3b122a3ee4b57d149a57d2afce65522c3", - "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d667e245d5dcd4d7bf80f26f2c947d476b66213e", + "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e", "shasum": "" }, "require": { @@ -1937,7 +2191,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" }, "bin": [ "bin/phpcs", @@ -1965,24 +2219,24 @@ "phpcs", "standards" ], - "time": "2017-05-04T00:33:04+00:00" + "time": "2017-10-16T22:40:25+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.8", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "require-dev": { "symfony/console": "~2.8|~3.0" @@ -1993,7 +2247,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2020,7 +2274,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-11-10T18:26:04+00:00" }, { "name": "webmozart/assert", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3c883cd..87a4493 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,7 +11,7 @@ processIsolation = "false" stopOnFailure = "false" syntaxCheck = "false" - bootstrap = "tests/bootstrap.php" > + bootstrap = "vendor/autoload.php" > @@ -19,4 +19,13 @@ + + + ./vendor + + + ./src + + + diff --git a/src/Configuration.php b/src/Configuration.php index 16fe54f..42e4331 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -1,90 +1,53 @@ cookies = $cookies; - - return $this; - } - - /** - * - * @return array - */ - public function getCookies() + public function __construct() { - return $this->cookies; + $this->httpClient = new HttpClient(); } /** - * - * @param GuzzleRequest $request - * @return self + * @param HttpClient $httpClient */ - public function setBaseRequest(GuzzleRequest $request) + public function setHttpClient(HttpClient $httpClient) { - $this->baseRequest = $request; - - return $this; + $this->httpClient = $httpClient; } /** - * - * @return GuzzleRequest $request + * @return HttpClient */ - public function getBaseRequest() + public function getHttpClient() { - if (is_null($this->baseRequest)) { - $client = new GuzzleClient; - $this->baseRequest = $client->get(); - } - - return $this->baseRequest; + return $this->httpClient; } /** * * @param string $rootUrl - * @return self */ public function setRootUrl($rootUrl) { - $this->rootUrl = new NormalisedUrl($rootUrl); + $rootUrl = trim($rootUrl); - return $this; + $this->rootUrl = (empty($rootUrl)) + ? null + : new NormalisedUrl($rootUrl); } /** diff --git a/src/WebsiteRssFeedFinder.php b/src/WebsiteRssFeedFinder.php index d0d8958..5d179a5 100644 --- a/src/WebsiteRssFeedFinder.php +++ b/src/WebsiteRssFeedFinder.php @@ -1,117 +1,116 @@ configuration)) { - $this->configuration = new Configuration(); - } + private $webResourceService; - return $this->configuration; + /** + * @param Configuration $configuration + */ + public function __construct(Configuration $configuration) + { + $this->configuration = $configuration; + + $webResourceServiceConfiguration = new WebResourceServiceConfiguration([ + WebResourceServiceConfiguration::CONFIG_ALLOW_UNKNOWN_RESOURCE_TYPES => false, + WebResourceServiceConfiguration::CONFIG_KEY_CONTENT_TYPE_WEB_RESOURCE_MAP => [ + 'text/html' => WebPage::class, + ], + WebResourceServiceConfiguration::CONFIG_KEY_HTTP_CLIENT => $this->configuration->getHttpClient(), + WebResourceServiceConfiguration::CONFIG_ALLOW_UNKNOWN_RESOURCE_TYPES => true, + ]); + + $this->webResourceService = new WebResourceService(); + $this->webResourceService->setConfiguration($webResourceServiceConfiguration); } /** - * - * @return \webignition\WebsiteRssFeedFinder\WebsiteRssFeedFinder + * @return Configuration */ - public function reset() + public function getConfiguration() { - $this->feedUrls = array(); - $this->rootWebPage = null; - return $this; + return $this->configuration; } /** - * - * @return array + * @return string[] */ public function getRssFeedUrls() { - return $this->getLinkHref('alternate', 'application/rss+xml'); + return $this->getLinkHref('application/rss+xml'); } /** - * - * @return array + * @return string[] */ public function getAtomFeedUrls() { - return $this->getLinkHref('alternate', 'application/atom+xml'); + return $this->getLinkHref('application/atom+xml'); } /** - * - * @param string $rel * @param string $type * * @return string[] */ - private function getLinkHref($rel, $type) + private function getLinkHref($type) { - if (!isset($this->feedUrls[$rel]) || !isset($this->feedUrls[$rel][$type])) { - if (!$this->findFeedUrls()) { - return null; + if (!isset($this->feedUrls[$type])) { + if (false === $this->findFeedUrls()) { + return []; } } - if (!isset($this->feedUrls[$rel]) || !isset($this->feedUrls[$rel][$type])) { - return null; + if (!isset($this->feedUrls[$type])) { + return []; } - return $this->feedUrls[$rel][$type]; + return $this->feedUrls[$type]; } private function findFeedUrls() { $rootWebPage = $this->getRootWebPage(); - if ($rootWebPage == false) { + if (!$rootWebPage instanceof WebPage) { return false; } libxml_use_internal_errors(true); - $feedUrls = array(); + $feedUrls = []; $supportedFeedTypes = $this->supportedFeedTypes; try { $rootWebPage @@ -120,26 +119,23 @@ private function findFeedUrls() function ($index, \DOMElement $domElement) use (&$feedUrls, $supportedFeedTypes) { foreach ($supportedFeedTypes as $supportedFeedType) { if ($domElement->getAttribute('type') == $supportedFeedType) { - if (!isset($feedUrls['alternate'])) { - $feedUrls['alternate'] = array(); - } - - if (!isset($feedUrls['alternate'][$supportedFeedType])) { - $feedUrls['alternate'][$supportedFeedType] = array(); + if (!isset($feedUrls[$supportedFeedType])) { + $feedUrls[$supportedFeedType] = []; } $hasSupportedFeedType = in_array( $domElement->getAttribute('href'), - $feedUrls['alternate'][$supportedFeedType] + $feedUrls[$supportedFeedType] ); if (!$hasSupportedFeedType) { - $feedUrls['alternate'][$supportedFeedType][] = + $feedUrls[$supportedFeedType][] = $domElement->getAttribute('href'); } } } - }); + } + ); } catch (ParseException $parseException) { // Invalid XML } @@ -149,7 +145,6 @@ function ($index, \DOMElement $domElement) use (&$feedUrls, $supportedFeedTypes) } /** - * * @return WebPage */ private function getRootWebPage() @@ -162,49 +157,17 @@ private function getRootWebPage() } /** - * - * @return boolean|WebPage + * @return WebResource */ private function retrieveRootWebPage() { - $request = clone $this->getConfiguration()->getBaseRequest(); - $request->setUrl($this->getConfiguration()->getRootUrl()); - $this->setRequestCookies($request); - - try { - $response = $request->send(); - } catch (RequestException $requestException) { - return false; - } + $httpClient = $this->configuration->getHttpClient(); + $request = $httpClient->createRequest('GET', $this->configuration->getRootUrl()); try { - $webPage = new WebPage(); - $webPage->setHttpResponse($response); - return $webPage; - } catch (WebResourceException $exception) { - // Invalid content type (is not the URL of a web page) - return false; - } - } - - /** - * - * @param GuzzleRequest $request - */ - private function setRequestCookies(GuzzleRequest $request) - { - if (!is_null($request->getCookies())) { - foreach ($request->getCookies() as $name => $value) { - $request->removeCookie($name); - } - } - - $cookieUrlMatcher = new UrlMatcher(); - - foreach ($this->getConfiguration()->getCookies() as $cookie) { - if ($cookieUrlMatcher->isMatch($cookie, $request->getUrl())) { - $request->addCookie($cookie['name'], $cookie['value']); - } + return $this->webResourceService->get($request); + } catch (\Exception $exception) { + return null; } } } diff --git a/tests/BaseTest.php b/tests/BaseTest.php deleted file mode 100644 index d6b6734..0000000 --- a/tests/BaseTest.php +++ /dev/null @@ -1,134 +0,0 @@ -httpClient)) { - $this->httpClient = new HttpClient(); - $this->httpClient->addSubscriber(new HistoryPlugin()); - } - - return $this->httpClient; - } - - /** - * - * @return HistoryPlugin|null - */ - protected function getHttpHistory() - { - $listenerCollections = $this->getHttpClient()->getEventDispatcher()->getListeners('request.sent'); - - foreach ($listenerCollections as $listener) { - if ($listener[0] instanceof HistoryPlugin) { - return $listener[0]; - } - } - - return null; - } - - protected function setHttpFixtures($fixtures) - { - $plugin = new MockPlugin(); - - foreach ($fixtures as $fixture) { - $plugin->addResponse($fixture); - } - - $this->getHttpClient()->addSubscriber($plugin); - } - - protected function getHttpFixtures($path) - { - $fixtures = array(); - $fixturesDirectory = new \DirectoryIterator($path); - - $fixturePathnames = array(); - - foreach ($fixturesDirectory as $directoryItem) { - if ($directoryItem->isFile()) { - $fixturePathnames[] = $directoryItem->getPathname(); - } - } - - sort($fixturePathnames); - - foreach ($fixturePathnames as $fixturePathname) { - $fixtures[] = Response::fromMessage(file_get_contents($fixturePathname)); - } - - return $fixtures; - } - - /** - * - * @param string $testName - * @return string - */ - protected function getFixturesDataPath($className, $testName = null) - { - $path = __DIR__ . '/fixtures/' . str_replace('\\', DIRECTORY_SEPARATOR, $className); - - if (!is_null($testName)) { - $path .= '/' . $testName; - } - - return $path; - } - - /** - * - * @return WebsiteRssFeedFinder - */ - protected function getFeedFinder() - { - if (is_null($this->feedFinder)) { - $this->feedFinder = new WebsiteRssFeedFinder(); - $this->feedFinder->getConfiguration()->setBaseRequest($this->getHttpClient()->get()); - } - - return $this->feedFinder; - } - - /** - * - * @param array $items Collection of http messages and/or curl exceptions - * @return array - */ - protected function buildHttpFixtureSet($items) - { - $fixtures = array(); - - foreach ($items as $item) { - $fixtures[] = Response::fromMessage($item); - } - - return $fixtures; - } -} diff --git a/tests/Configuration/BaseRequestTest.php b/tests/Configuration/BaseRequestTest.php deleted file mode 100644 index feee796..0000000 --- a/tests/Configuration/BaseRequestTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertInstanceOf(Request::class, $this->configuration->getBaseRequest()); - } - - public function testSetReturnsSelf() - { - $this->assertEquals($this->configuration, $this->configuration->setBaseRequest($this->getHttpClient()->get())); - } - - public function testSetGetBaseRequest() - { - $baseRequest = $this->getHttpClient()->get(); - $baseRequest->setAuth('example_user', 'example_password'); - - $this->configuration->setBaseRequest($baseRequest); - - $this->assertEquals('example_user', $this->configuration->getBaseRequest()->getUsername()); - $this->assertEquals($baseRequest->getUsername(), $this->configuration->getBaseRequest()->getUsername()); - } -} diff --git a/tests/Configuration/ConfigurationTest.php b/tests/Configuration/ConfigurationTest.php deleted file mode 100644 index 548ceb5..0000000 --- a/tests/Configuration/ConfigurationTest.php +++ /dev/null @@ -1,21 +0,0 @@ -configuration = new Configuration(); - } -} diff --git a/tests/Configuration/CookiesTest.php b/tests/Configuration/CookiesTest.php deleted file mode 100644 index 41d0b92..0000000 --- a/tests/Configuration/CookiesTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals(array(), $this->configuration->getCookies()); - } - - public function testSetReturnsSelf() - { - $this->assertEquals($this->configuration, $this->configuration->setCookies(array())); - } - - public function testSetGetCookies() - { - $cookies = array( - array( - 'name' => 'name1', - 'value' => 'value1' - ), - array( - 'domain' => '.example.com', - 'name' => 'name2', - 'value' => 'value2' - ), - array( - 'domain' => '.example.com', - 'secure' => true, - 'name' => 'name3', - 'value' => 'value3' - ) - ); - - $this->assertEquals($cookies, $this->configuration->setCookies($cookies)->getCookies()); - } -} diff --git a/tests/Configuration/RootUrlTest.php b/tests/Configuration/RootUrlTest.php deleted file mode 100644 index ec95339..0000000 --- a/tests/Configuration/RootUrlTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertNull($this->configuration->getRootUrl()); - } - - public function testSetReturnsSelf() - { - $this->assertEquals($this->configuration, $this->configuration->setRootUrl(self::ROOT_URL)); - } - - public function testGetReturnsValueSet() - { - $this->assertEquals( - self::ROOT_URL, - (string)$this->configuration->setRootUrl(self::ROOT_URL)->getRootUrl() - ); - } - - public function testGetReturnsNormalizedUrlObject() - { - $this->assertInstanceOf( - NormalisedUrl::class, - $this->configuration->setRootUrl(self::ROOT_URL)->getRootUrl() - ); - } -} diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php new file mode 100644 index 0000000..ac81082 --- /dev/null +++ b/tests/ConfigurationTest.php @@ -0,0 +1,94 @@ +configuration = new Configuration(); + $this->httpClient = new HttpClient(); + } + + public function testGetHttpClientWhenNotSet() + { + $httpClient = $this->configuration->getHttpClient(); + + $this->assertNotEquals( + spl_object_hash($this->httpClient), + spl_object_hash($httpClient) + ); + } + + public function testGetHttpClientWhenSet() + { + $this->configuration->setHttpClient($this->httpClient); + $httpClient = $this->configuration->getHttpClient(); + + $this->assertEquals( + spl_object_hash($this->httpClient), + spl_object_hash($httpClient) + ); + } + + /** + * @dataProvider getRootUrlDataProvider + * + * @param $rootUrl + * @param $expectedRootUrl + */ + public function testGetRootUrl($rootUrl, $expectedRootUrl) + { + if (!is_null($rootUrl)) { + $this->configuration->setRootUrl($rootUrl); + } + + $this->assertEquals( + $expectedRootUrl, + (string) $this->configuration->getRootUrl() + ); + } + + /** + * @return array + */ + public function getRootUrlDataProvider() + { + return [ + 'null' => [ + 'rootUrl' => null, + 'expectedRootUrl' => null, + ], + 'empty' => [ + 'rootUrl' => '', + 'expectedRootUrl' => null, + ], + 'non-empty' => [ + 'rootUrl' => 'http://example.com/', + 'expectedRootUrl' => 'http://example.com/', + ], + 'normalised' => [ + 'rootUrl' => 'http://example.com/?b=2&a=1', + 'expectedRootUrl' => 'http://example.com/?a=1&b=2', + ], + ]; + } +} diff --git a/tests/Cookies/CookiesTest.php b/tests/Cookies/CookiesTest.php deleted file mode 100644 index 5dba3be..0000000 --- a/tests/Cookies/CookiesTest.php +++ /dev/null @@ -1,99 +0,0 @@ -setHttpFixtures($this->buildHttpFixtureSet(array( - 'HTTP/1.0 200' - ))); - - $finder = $this->getFeedFinder(); - $finder->getConfiguration()->setRootUrl($this->getRootUrl()); - $finder->getConfiguration()->setCookies($this->getCookies()); - $finder->getAtomFeedUrls(); - } - - public function testCookiesAreSetOnExpectedRequests() - { - foreach ($this->getExpectedRequestsOnWhichCookiesShouldBeSet() as $request) { - $this->assertEquals($this->getExpectedCookieValues(), $request->getCookies()); - } - } - - public function testCookiesAreNotSetOnExpectedRequests() - { - foreach ($this->getExpectedRequestsOnWhichCookiesShouldNotBeSet() as $request) { - $this->assertEquals(array(), $request->getCookies()); - } - } - - /** - * - * @return array - */ - private function getExpectedCookieValues() - { - $nameValueArray = array(); - - foreach ($this->getCookies() as $cookie) { - $nameValueArray[$cookie['name']] = $cookie['value']; - } - - return $nameValueArray; - } - - /** - * - * @return \Guzzle\Http\Message\Request[] - */ - protected function getAllSentHttpRequests() - { - $requests = array(); - - foreach ($this->getHttpHistory()->getAll() as $httpTransaction) { - $requests[] = $httpTransaction['request']; - } - - return $requests; - } - - protected function getLastHttpRequest() - { - $requests = $this->getAllSentHttpRequests(); - return $requests[count($requests) - 1]; - } - - protected function getFirstHttpRequest() - { - $requests = $this->getAllSentHttpRequests(); - return $requests[0]; - } -} diff --git a/tests/Cookies/Domain/DomainTest.php b/tests/Cookies/Domain/DomainTest.php deleted file mode 100644 index 193192c..0000000 --- a/tests/Cookies/Domain/DomainTest.php +++ /dev/null @@ -1,13 +0,0 @@ - '.example.com', - 'name' => 'foo', - 'value' => 'bar' - ) - ); - } - - protected function getExpectedRequestsOnWhichCookiesShouldBeSet() - { - return $this->getAllSentHttpRequests(); - } - - protected function getExpectedRequestsOnWhichCookiesShouldNotBeSet() - { - return array(); - } -} diff --git a/tests/Cookies/Domain/NotMatchTest.php b/tests/Cookies/Domain/NotMatchTest.php deleted file mode 100644 index cf3e608..0000000 --- a/tests/Cookies/Domain/NotMatchTest.php +++ /dev/null @@ -1,27 +0,0 @@ - '.foo.example.com', - 'name' => 'foo', - 'value' => 'bar' - ) - ); - } - - protected function getExpectedRequestsOnWhichCookiesShouldBeSet() - { - return array(); - } - - protected function getExpectedRequestsOnWhichCookiesShouldNotBeSet() - { - return $this->getAllSentHttpRequests(); - } -} diff --git a/tests/Cookies/Path/IsMatchTest.php b/tests/Cookies/Path/IsMatchTest.php deleted file mode 100644 index 26c9d7e..0000000 --- a/tests/Cookies/Path/IsMatchTest.php +++ /dev/null @@ -1,28 +0,0 @@ - '.example.com', - 'name' => 'foo', - 'value' => 'bar', - 'path' => '/foo' - ) - ); - } - - protected function getExpectedRequestsOnWhichCookiesShouldBeSet() - { - return $this->getAllSentHttpRequests(); - } - - protected function getExpectedRequestsOnWhichCookiesShouldNotBeSet() - { - return array(); - } -} diff --git a/tests/Cookies/Path/NotMatchTest.php b/tests/Cookies/Path/NotMatchTest.php deleted file mode 100644 index 84cf4c3..0000000 --- a/tests/Cookies/Path/NotMatchTest.php +++ /dev/null @@ -1,28 +0,0 @@ - '.example.com', - 'name' => 'foo', - 'value' => 'bar', - 'path' => '/bar' - ) - ); - } - - protected function getExpectedRequestsOnWhichCookiesShouldBeSet() - { - return array(); - } - - protected function getExpectedRequestsOnWhichCookiesShouldNotBeSet() - { - return $this->getAllSentHttpRequests(); - } -} diff --git a/tests/Cookies/Path/PathTest.php b/tests/Cookies/Path/PathTest.php deleted file mode 100644 index 1ac384a..0000000 --- a/tests/Cookies/Path/PathTest.php +++ /dev/null @@ -1,13 +0,0 @@ -getAllSentHttpRequests(); - } - - protected function getExpectedRequestsOnWhichCookiesShouldNotBeSet() - { - return array(); - } -} diff --git a/tests/Cookies/Secure/NotMatchTest.php b/tests/Cookies/Secure/NotMatchTest.php deleted file mode 100644 index 57da96e..0000000 --- a/tests/Cookies/Secure/NotMatchTest.php +++ /dev/null @@ -1,21 +0,0 @@ -getAllSentHttpRequests(); - } -} diff --git a/tests/Cookies/Secure/SecureTest.php b/tests/Cookies/Secure/SecureTest.php deleted file mode 100644 index 0fcc8e2..0000000 --- a/tests/Cookies/Secure/SecureTest.php +++ /dev/null @@ -1,20 +0,0 @@ - '.example.com', - 'name' => 'foo', - 'value' => 'bar', - 'secure' => true - ) - ); - } -} diff --git a/tests/Factory/HtmlDocumentFactory.php b/tests/Factory/HtmlDocumentFactory.php new file mode 100644 index 0000000..0903677 --- /dev/null +++ b/tests/Factory/HtmlDocumentFactory.php @@ -0,0 +1,16 @@ + $contentType, + ]; + } + + $messageFactory = new MessageFactory(); + + return $messageFactory->createResponse($statusCode, $headers, $body); + } + + /** + * @return GuzzleResponse + */ + public static function createNotFoundResponse() + { + return static::createResponse(404); + } + + /** + * @param string $contentType + * @param string $body + * + * @return GuzzleResponse + */ + public static function createSuccessResponse($contentType = null, $body = '') + { + return static::createResponse(200, $contentType, $body); + } +} diff --git a/tests/Fixtures/HtmlDocuments/empty.html b/tests/Fixtures/HtmlDocuments/empty.html new file mode 100644 index 0000000..14dfa6b --- /dev/null +++ b/tests/Fixtures/HtmlDocuments/empty.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/SingleUrlTest/testGetUrls/HttpResponses/1 b/tests/Fixtures/HtmlDocuments/single-atom.html similarity index 72% rename from tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/SingleUrlTest/testGetUrls/HttpResponses/1 rename to tests/Fixtures/HtmlDocuments/single-atom.html index 4cb6cbb..9c7df7f 100644 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/SingleUrlTest/testGetUrls/HttpResponses/1 +++ b/tests/Fixtures/HtmlDocuments/single-atom.html @@ -1,6 +1,3 @@ -HTTP/1.1 200 OK -Content-Type: text/html; charset=UTF-8 - diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/SingleUrlTest/testGetUrls/HttpResponses/1 b/tests/Fixtures/HtmlDocuments/single-rss.html similarity index 51% rename from tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/SingleUrlTest/testGetUrls/HttpResponses/1 rename to tests/Fixtures/HtmlDocuments/single-rss.html index fd90303..ae968d2 100644 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/SingleUrlTest/testGetUrls/HttpResponses/1 +++ b/tests/Fixtures/HtmlDocuments/single-rss.html @@ -1,12 +1,8 @@ -HTTP/1.1 200 OK -Content-Type: text/html; charset=utf-8 - - - - - + + + \ No newline at end of file diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/MultipleUrlsTest/testGetUrls/HttpResponses/1 b/tests/Fixtures/HtmlDocuments/two-atom.html similarity index 68% rename from tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/MultipleUrlsTest/testGetUrls/HttpResponses/1 rename to tests/Fixtures/HtmlDocuments/two-atom.html index a15780d..a79c6ee 100644 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Atom/MultipleUrlsTest/testGetUrls/HttpResponses/1 +++ b/tests/Fixtures/HtmlDocuments/two-atom.html @@ -1,11 +1,8 @@ -HTTP/1.1 200 OK -Content-Type: text/html; charset=UTF-8 - - + diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/MultipleUrlsTest/testGetUrls/HttpResponses/1 b/tests/Fixtures/HtmlDocuments/two-rss.html similarity index 72% rename from tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/MultipleUrlsTest/testGetUrls/HttpResponses/1 rename to tests/Fixtures/HtmlDocuments/two-rss.html index 4d13e2a..ca40c0c 100644 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/MultipleUrlsTest/testGetUrls/HttpResponses/1 +++ b/tests/Fixtures/HtmlDocuments/two-rss.html @@ -1,10 +1,7 @@ -HTTP/1.1 200 OK -Content-Type: text/html; charset=UTF-8 - - - + + diff --git a/tests/GetFeedUrls/Atom/GetUrlsTest.php b/tests/GetFeedUrls/Atom/GetUrlsTest.php deleted file mode 100644 index 8cf8348..0000000 --- a/tests/GetFeedUrls/Atom/GetUrlsTest.php +++ /dev/null @@ -1,13 +0,0 @@ -getFeedFinder()->getAtomFeedUrls(); - } -} diff --git a/tests/GetFeedUrls/Atom/MultipleUrlsTest.php b/tests/GetFeedUrls/Atom/MultipleUrlsTest.php deleted file mode 100644 index 4a3bdf4..0000000 --- a/tests/GetFeedUrls/Atom/MultipleUrlsTest.php +++ /dev/null @@ -1,14 +0,0 @@ -setHttpFixtures( - $this->getHttpFixtures( - $this->getFixturesDataPath(get_class($this), $this->getName() . '/HttpResponses') - ) - ); - - $finder = $this->getFeedFinder(); - $finder->getConfiguration()->setRootUrl(self::ROOT_WEB_PAGE_URL); - } - - public function testGetUrls() - { - $this->assertEquals($this->getExpectedFeedUrls(), $this->getFeedUrls()); - } -} diff --git a/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest.php b/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest.php deleted file mode 100644 index dfcd31a..0000000 --- a/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getFeedFinder()->getRssFeedUrls(); - } -} diff --git a/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest.php b/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest.php deleted file mode 100644 index 33777ee..0000000 --- a/tests/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getFeedFinder()->getRssFeedUrls(); - } -} diff --git a/tests/GetFeedUrls/Rss/GetUrlsTest.php b/tests/GetFeedUrls/Rss/GetUrlsTest.php deleted file mode 100644 index 708738b..0000000 --- a/tests/GetFeedUrls/Rss/GetUrlsTest.php +++ /dev/null @@ -1,13 +0,0 @@ -getFeedFinder()->getRssFeedUrls(); - } -} diff --git a/tests/GetFeedUrls/Rss/MultipleUrlsTest.php b/tests/GetFeedUrls/Rss/MultipleUrlsTest.php deleted file mode 100644 index dab068a..0000000 --- a/tests/GetFeedUrls/Rss/MultipleUrlsTest.php +++ /dev/null @@ -1,14 +0,0 @@ -httpClient = new HttpClient(); + } + + public function testGetConfiguration() + { + $websiteRssFeedFinder = new WebsiteRssFeedFinder(new Configuration()); + + $this->assertInstanceOf(Configuration::class, $websiteRssFeedFinder->getConfiguration()); + } + + /** + * @dataProvider getRssFeedUrlsDataProvider + * + * @param array $httpFixtures + * @param string[] $expectedRssUrls + */ + public function testGetRssFeedUrls($httpFixtures, $expectedRssUrls) + { + $this->setHttpFixtures($httpFixtures); + + $configuration = new Configuration(); + $configuration->setHttpClient($this->httpClient); + $configuration->setRootUrl('http://example.com/'); + + $websiteRssFeedFinder = new WebsiteRssFeedFinder($configuration); + + $rssUrls = $websiteRssFeedFinder->getRssFeedUrls(); + + $this->assertEquals($expectedRssUrls, $rssUrls); + } + + /** + * @return array + */ + public function getRssFeedUrlsDataProvider() + { + return [ +// '404 retrieving root web page' => [ +// 'httpFixtures' => [ +// HttpFixtureFactory::createNotFoundResponse(), +// ], +// 'expectedRssUrls' => [], +// ], +// 'root web page not web page' => [ +// 'httpFixtures' => [ +// HttpFixtureFactory::createSuccessResponse('application/xml'), +// ], +// 'expectedRssUrls' => [], +// ], + 'no urls' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('empty')), + ], + 'expectedRssUrls' => [], + ], +// 'single url' => [ +// 'httpFixtures' => [ +// HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('single-rss')), +// ], +// 'expectedRssUrls' => [ +// 'http://example.com/rss-1.xml', +// ], +// ], +// 'two urls' => [ +// 'httpFixtures' => [ +// HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('two-rss')), +// ], +// 'expectedRssUrls' => [ +// 'http://example.com/rss-1.xml', +// 'http://example.com/rss-2.xml', +// ], +// ], + ]; + } + + /** + * @dataProvider getAtomFeedUrlsDataProvider + * + * @param array $httpFixtures + * @param string[] $expectedRssUrls + */ + public function testGetAtomFeedUrls($httpFixtures, $expectedRssUrls) + { + $this->setHttpFixtures($httpFixtures); + + $configuration = new Configuration(); + $configuration->setHttpClient($this->httpClient); + $configuration->setRootUrl('http://example.com/'); + + $websiteRssFeedFinder = new WebsiteRssFeedFinder($configuration); + + $rssUrls = $websiteRssFeedFinder->getAtomFeedUrls(); + + $this->assertEquals($expectedRssUrls, $rssUrls); + } + + /** + * @return array + */ + public function getAtomFeedUrlsDataProvider() + { + return [ + '404 retrieving root web page' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createNotFoundResponse(), + ], + 'expectedRssUrls' => [], + ], + 'root web page not web page' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createSuccessResponse('application/xml'), + ], + 'expectedRssUrls' => [], + ], + 'no urls' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('empty')), + ], + 'expectedRssUrls' => [], + ], + 'single url' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('single-atom')), + ], + 'expectedRssUrls' => [ + 'http://example.com/atom-1.xml', + ], + ], + 'two urls' => [ + 'httpFixtures' => [ + HttpFixtureFactory::createSuccessResponse('text/html', HtmlDocumentFactory::load('two-atom')), + ], + 'expectedRssUrls' => [ + 'http://example.com/atom-1.xml', + 'http://example.com/atom-2.xml', + ], + ], + ]; + } + + /** + * @param array $fixtures + */ + private function setHttpFixtures($fixtures) + { + $httpMockSubscriber = new HttpMockSubscriber($fixtures); + + $this->httpClient->getEmitter()->attach($httpMockSubscriber); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index d21c14d..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest/testGetUrls/HttpResponses/1 b/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest/testGetUrls/HttpResponses/1 deleted file mode 100644 index 47ab4bf..0000000 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ClientErrorTest/testGetUrls/HttpResponses/1 +++ /dev/null @@ -1 +0,0 @@ -HTTP/1.0 404 \ No newline at end of file diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest/testGetUrls/HttpResponses/1 b/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest/testGetUrls/HttpResponses/1 deleted file mode 100644 index 00c6405..0000000 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/HttpErrorRetrievingRootWebPage/ServerErrorTest/testGetUrls/HttpResponses/1 +++ /dev/null @@ -1 +0,0 @@ -HTTP/1.0 500 \ No newline at end of file diff --git a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/NoUrlTest/testGetUrls/HttpResponses/1 b/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/NoUrlTest/testGetUrls/HttpResponses/1 deleted file mode 100644 index 4cb6cbb..0000000 --- a/tests/fixtures/webignition/Tests/WebsiteRssFeedFinder/GetFeedUrls/Rss/NoUrlTest/testGetUrls/HttpResponses/1 +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Content-Type: text/html; charset=UTF-8 - - - - - - - - - \ No newline at end of file