diff --git a/composer.json b/composer.json index 50af535..b804920 100644 --- a/composer.json +++ b/composer.json @@ -42,9 +42,9 @@ }, "require-dev": { "adriansuter/php-autoload-override": "^1.4", - "laminas/laminas-diactoros": "^2.18.1", - "nyholm/psr7": "^1.7", - "php-http/psr7-integration-tests": "1.1.1", + "laminas/laminas-diactoros": "^3.1.0", + "nyholm/psr7": "^1.8.0", + "php-http/psr7-integration-tests": "^1.3.0", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "doctrine/instantiator": "^1.3.1", diff --git a/composer.lock b/composer.lock index 79e2b81..31848b2 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": "8f26299d2a8c7e15dd6d37277fab42d1", + "content-hash": "e08d2c2dfd51d9066cce7c5b968649f0", "packages": [ { "name": "psr/http-factory", @@ -241,29 +241,26 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.25.2", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" + "reference": "aca73646e658dce3f079f6b8648c651e193e331e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", - "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/aca73646e658dce3f079f6b8648c651e193e331e", + "reference": "aca73646e658dce3f079f6b8648c651e193e331e", "shasum": "" }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1" - }, - "conflict": { - "zendframework/zend-diactoros": "*" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", + "psr/http-factory": "^1.0.2", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" + "psr/http-factory-implementation": "^1.1 || ^2.0", + "psr/http-message-implementation": "^1.1 || ^2.0" }, "require-dev": { "ext-curl": "*", @@ -271,11 +268,11 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.5", - "php-http/psr7-integration-tests": "^1.2", + "laminas/laminas-coding-standard": "~2.5.0", + "php-http/psr7-integration-tests": "^1.3", "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.6" + "vimeo/psalm": "^5.9" }, "type": "library", "extra": { @@ -290,18 +287,9 @@ "src/functions/marshal_headers_from_sapi.php", "src/functions/marshal_method_from_sapi.php", "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", "src/functions/normalize_server.php", "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" + "src/functions/parse_cookie_header.php" ], "psr-4": { "Laminas\\Diactoros\\": "src/" @@ -334,7 +322,7 @@ "type": "community_bridge" } ], - "time": "2023-04-17T15:44:17+00:00" + "time": "2023-09-03T13:11:37+00:00" }, { "name": "myclabs/deep-copy", @@ -642,36 +630,31 @@ }, { "name": "php-http/psr7-integration-tests", - "version": "1.1.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/php-http/psr7-integration-tests.git", - "reference": "dbc81e59655c3d927ba62b2cd38be9af334590fc" + "reference": "c333566ed5b1620fc769eba1bb24a13b7d16e812" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/psr7-integration-tests/zipball/dbc81e59655c3d927ba62b2cd38be9af334590fc", - "reference": "dbc81e59655c3d927ba62b2cd38be9af334590fc", + "url": "https://api.github.com/repos/php-http/psr7-integration-tests/zipball/c333566ed5b1620fc769eba1bb24a13b7d16e812", + "reference": "c333566ed5b1620fc769eba1bb24a13b7d16e812", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", "phpunit/phpunit": "^8.0 || ^9.3", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "guzzlehttp/psr7": "^1.4", + "guzzlehttp/psr7": "^1.7 || ^2.0", "laminas/laminas-diactoros": "^2.1", "nyholm/psr7": "^1.0", "ringcentral/psr7": "^1.2", - "slim/psr7": "dev-master" + "slim/psr7": "^1.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { "Http\\Psr7Test\\": "src/" @@ -695,22 +678,22 @@ ], "support": { "issues": "https://github.com/php-http/psr7-integration-tests/issues", - "source": "https://github.com/php-http/psr7-integration-tests/tree/1.1.1" + "source": "https://github.com/php-http/psr7-integration-tests/tree/1.3.0" }, - "time": "2020-11-02T14:08:03+00:00" + "time": "2023-04-28T14:30:11+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.26", + "version": "1.10.37", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" + "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/058ba07e92f744d4dcf6061ae75283d0c6456f2e", + "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e", "shasum": "" }, "require": { @@ -759,7 +742,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T12:44:37+00:00" + "time": "2023-10-02T16:18:37+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/tests/Psr7Integration/Laminas/ServerRequestTest.php b/tests/Psr7Integration/Laminas/ServerRequestTest.php index c7ba3b5..15d5178 100644 --- a/tests/Psr7Integration/Laminas/ServerRequestTest.php +++ b/tests/Psr7Integration/Laminas/ServerRequestTest.php @@ -22,6 +22,10 @@ class ServerRequestTest extends ServerRequestIntegrationTest { + protected $skippedTests = [ + 'testUriPreserveHost_NoHost_Host' => 'laminas-diactoros is not compliant.' + ]; + public static function setUpBeforeClass(): void { if (!defined('URI_FACTORY')) { diff --git a/tests/Psr7Integration/Nyholm/ServerRequestTest.php b/tests/Psr7Integration/Nyholm/ServerRequestTest.php index 948353a..350d143 100644 --- a/tests/Psr7Integration/Nyholm/ServerRequestTest.php +++ b/tests/Psr7Integration/Nyholm/ServerRequestTest.php @@ -20,6 +20,10 @@ class ServerRequestTest extends ServerRequestIntegrationTest { + protected $skippedTests = [ + 'testUriPreserveHost_NoHost_Host' => 'Nyholm Psr-7 is not compliant.' + ]; + public static function setUpBeforeClass(): void { if (!defined('URI_FACTORY')) { diff --git a/tests/UriTest.php b/tests/UriTest.php index 9593e12..40e63ca 100644 --- a/tests/UriTest.php +++ b/tests/UriTest.php @@ -12,7 +12,9 @@ use InvalidArgumentException; use Slim\Http\Factory\DecoratedUriFactory; +use Slim\Tests\Http\Providers\LaminasDiactorosPsr17FactoryProvider; use Slim\Tests\Http\Providers\Psr17FactoryProvider; +use TypeError; use function property_exists; @@ -244,14 +246,19 @@ public function testWithPortInvalidInt() public function testWithPortInvalidString() { - $this->expectException(InvalidArgumentException::class); - foreach ($this->factoryProviders as $factoryProvider) { /** @var Psr17FactoryProvider $provider */ $provider = new $factoryProvider(); $decoratedUriFactory = new DecoratedUriFactory($provider->getUriFactory()); $uri = $decoratedUriFactory->createUri('https://google.com'); + + if ($factoryProvider === LaminasDiactorosPsr17FactoryProvider::class) { + $this->expectException(TypeError::class); + } else { + $this->expectException(InvalidArgumentException::class); + } + $uri->withPort('invalid'); } }