diff --git a/composer.lock b/composer.lock index 513a532..b5e73a0 100644 --- a/composer.lock +++ b/composer.lock @@ -569,6 +569,74 @@ ], "time": "2017-02-15T22:25:47+00:00" }, + { + "name": "doctrine/annotations", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-02-24T16:22:25+00:00" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -623,51 +691,115 @@ ], "time": "2015-06-14T21:17:01+00:00" }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.1.2", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "c7de769d7b44f2c9de68e1f678b65efd8126f60b" + "reference": "d6f17423412d33df6b69c9aaf12037b91703533b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c7de769d7b44f2c9de68e1f678b65efd8126f60b", - "reference": "c7de769d7b44f2c9de68e1f678b65efd8126f60b", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d6f17423412d33df6b69c9aaf12037b91703533b", + "reference": "d6f17423412d33df6b69c9aaf12037b91703533b", "shasum": "" }, "require": { + "doctrine/annotations": "^1.2", "ext-tokenizer": "*", "php": "^5.3.6 || >=7.0 <7.2", "sebastian/diff": "^1.1", - "symfony/console": "^2.3 || ^3.0", + "symfony/console": "^2.4 || ^3.0", "symfony/event-dispatcher": "^2.1 || ^3.0", "symfony/filesystem": "^2.4 || ^3.0", "symfony/finder": "^2.2 || ^3.0", + "symfony/options-resolver": "^2.6 || ^3.0", "symfony/polyfill-php54": "^1.0", "symfony/polyfill-php55": "^1.3", + "symfony/polyfill-php70": "^1.0", "symfony/polyfill-xml": "^1.3", "symfony/process": "^2.3 || ^3.0", "symfony/stopwatch": "^2.5 || ^3.0" }, "conflict": { - "hhvm": "<3.9" + "hhvm": "<3.18" }, "require-dev": { "gecko-packages/gecko-php-unit": "^2.0", "justinrainbow/json-schema": "^5.0", "phpunit/phpunit": "^4.5 || ^5.0", "satooshi/php-coveralls": "^1.0", - "symfony/phpunit-bridge": "^3.2" + "symfony/phpunit-bridge": "^3.2.2" }, "suggest": { - "ext-xml": "For better performance." + "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "ext-xml": "For better performance.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, "bin": [ "php-cs-fixer" ], "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" @@ -688,7 +820,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2017-03-15T17:13:07+00:00" + "time": "2017-03-31T16:16:30+00:00" }, { "name": "guzzle/guzzle", @@ -1469,16 +1601,16 @@ }, { "name": "nette/utils", - "version": "v2.4.4", + "version": "v2.4.5", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "714afb64d0da07d0da7178cbf5680008e4b0180b" + "reference": "28ad4e2a6dcf143c23bde969a825f10a5d513602" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/714afb64d0da07d0da7178cbf5680008e4b0180b", - "reference": "714afb64d0da07d0da7178cbf5680008e4b0180b", + "url": "https://api.github.com/repos/nette/utils/zipball/28ad4e2a6dcf143c23bde969a825f10a5d513602", + "reference": "28ad4e2a6dcf143c23bde969a825f10a5d513602", "shasum": "" }, "require": { @@ -1497,7 +1629,8 @@ "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "ext-xml": "to use Strings::length() etc. when mbstring is not available", + "https://nette.org/donate": "\u001b[1;37;42m Please consider supporting Nette via a donation \u001b[0m" }, "type": "library", "extra": { @@ -1528,7 +1661,7 @@ ], "description": "Nette Utility Classes", "homepage": "https://nette.org", - "time": "2017-01-16T12:30:14+00:00" + "time": "2017-03-29T16:55:54+00:00" }, { "name": "nikic/php-parser", @@ -1690,6 +1823,54 @@ ], "time": "2016-01-05T23:08:01+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v2.0.10", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2017-03-13T16:27:32+00:00" + }, { "name": "pdepend/pdepend", "version": "2.5.0", @@ -3542,6 +3723,60 @@ "homepage": "https://symfony.com", "time": "2017-02-21T09:12:04+00:00" }, + { + "name": "symfony/options-resolver", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "56e3d0a41313f8a54326851f10690d591e62a24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/56e3d0a41313f8a54326851f10690d591e62a24c", + "reference": "56e3d0a41313f8a54326851f10690d591e62a24c", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2017-02-21T09:12:04+00:00" + }, { "name": "symfony/polyfill-php54", "version": "v1.3.0", @@ -3656,6 +3891,65 @@ ], "time": "2016-11-14T01:06:16+00:00" }, + { + "name": "symfony/polyfill-php70", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", + "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" + }, { "name": "symfony/polyfill-xml", "version": "v1.3.0", diff --git a/tests/Concerns/MakeHttpRequestsTest.php b/tests/Concerns/MakeHttpRequestsTest.php index a98f4b3..4436e0c 100644 --- a/tests/Concerns/MakeHttpRequestsTest.php +++ b/tests/Concerns/MakeHttpRequestsTest.php @@ -40,68 +40,72 @@ public function it_can_make_get_requests() public function it_can_make_post_requests() { // Arrange - $expected = $this->mockPageResponse(); - $headers = $this->expectedHeaders(); - $parameters = ['foo' => 'bar']; + $expected = $this->mockPageResponse(); + $headers = $this->expectedHeaders(); + $parameters = ['foo' => 'bar']; + $content = 'baz=qux'; // Act - $crawler = $this->crawler->post('http://www.example.com', $parameters, $headers); + $crawler = $this->crawler->post('http://www.example.com', $parameters, $headers, $content); $request = $crawler->getClient()->getHistory()->current(); // Assert $this->assertResponseMatches($crawler, $expected); - $this->assertRequestMatches($request, $parameters, 'POST'); + $this->assertRequestMatches($request, $parameters, 'POST', $content); } /** @test */ public function it_can_make_put_requests() { // Arrange - $expected = $this->mockPageResponse(); - $headers = $this->expectedHeaders(); - $parameters = ['foo' => 'bar']; + $expected = $this->mockPageResponse(); + $headers = $this->expectedHeaders(); + $parameters = ['foo' => 'bar']; + $content = 'baz=qux'; // Act - $crawler = $this->crawler->put('http://www.example.com', $parameters, $headers); + $crawler = $this->crawler->put('http://www.example.com', $parameters, $headers, $content); $request = $crawler->getClient()->getHistory()->current(); // Assert $this->assertResponseMatches($crawler, $expected); - $this->assertRequestMatches($request, $parameters, 'PUT'); + $this->assertRequestMatches($request, $parameters, 'PUT', $content); } /** @test */ public function it_can_make_patch_requests() { // Arrange - $expected = $this->mockPageResponse(); - $headers = $this->expectedHeaders(); - $parameters = ['foo' => 'bar']; + $expected = $this->mockPageResponse(); + $headers = $this->expectedHeaders(); + $parameters = ['foo' => 'bar']; + $content = 'baz=qux'; // Act - $crawler = $this->crawler->patch('http://www.example.com', $parameters, $headers); + $crawler = $this->crawler->patch('http://www.example.com', $parameters, $headers, $content); $request = $crawler->getClient()->getHistory()->current(); // Assert $this->assertResponseMatches($crawler, $expected); - $this->assertRequestMatches($request, $parameters, 'PATCH'); + $this->assertRequestMatches($request, $parameters, 'PATCH', $content); } /** @test */ public function it_can_make_delete_requests() { // Arrange - $expected = $this->mockPageResponse(); - $headers = $this->expectedHeaders(); - $parameters = ['foo' => 'bar']; + $expected = $this->mockPageResponse(); + $headers = $this->expectedHeaders(); + $parameters = ['foo' => 'bar']; + $content = 'baz=qux'; // Act - $crawler = $this->crawler->delete('http://www.example.com', $parameters, $headers); + $crawler = $this->crawler->delete('http://www.example.com', $parameters, $headers, $content); $request = $crawler->getClient()->getHistory()->current(); // Assert $this->assertResponseMatches($crawler, $expected); - $this->assertRequestMatches($request, $parameters, 'DELETE'); + $this->assertRequestMatches($request, $parameters, 'DELETE', $content); } private function mockPageResponse() @@ -113,7 +117,7 @@ private function mockPageResponse() return $expected; } - private function assertRequestMatches(Request $request, array $parameters, string $method) + private function assertRequestMatches(Request $request, array $parameters, string $method, string $content = null) { $server = $request->getServer(); @@ -122,6 +126,7 @@ private function assertRequestMatches(Request $request, array $parameters, strin $this->assertSame($method, $request->getMethod()); $this->assertSame($parameters, $request->getParameters()); + $this->assertSame($content, $request->getContent()); } private function expectedHeaders()