From 8521502575f98abaacfec118482497125391e141 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 26 Nov 2023 15:02:30 +0100 Subject: [PATCH 1/5] fix release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce60cb1..35b692e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2.0.0 - 2023-10-26 +## 2.0.0 - 2023-11-26 ### Added From 49eb9154c997c91e4001cc2805abad1d3efe7ab0 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 10 Mar 2024 16:48:09 +0100 Subject: [PATCH 2/5] CS --- src/Application.php | 5 +---- src/Application/Async/Http.php | 6 +----- src/Application/Http.php | 5 +---- src/Application/Implementation.php | 5 +---- tests/ApplicationTest.php | 5 +---- 5 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/Application.php b/src/Application.php index 7f7e712..68f996f 100644 --- a/src/Application.php +++ b/src/Application.php @@ -17,10 +17,7 @@ ServerRequest, Response, }; -use Innmind\Router\{ - Route, - Route\Variables, -}; +use Innmind\Router\Route\Variables; /** * @template I of ServerRequest|CliEnv diff --git a/src/Application/Async/Http.php b/src/Application/Async/Http.php index 1a7f760..2b6643b 100644 --- a/src/Application/Async/Http.php +++ b/src/Application/Async/Http.php @@ -14,10 +14,7 @@ Environment as CliEnv, Commands, }; -use Innmind\OperatingSystem\{ - OperatingSystem, - OperatingSystem\Unix, -}; +use Innmind\OperatingSystem\OperatingSystem; use Innmind\Async\HttpServer\Command\Serve; use Innmind\DI\{ Container, @@ -29,7 +26,6 @@ }; use Innmind\Router\{ Route, - Route\Variables, }; use Innmind\Immutable\{ Maybe, diff --git a/src/Application/Http.php b/src/Application/Http.php index fa04318..6941d73 100644 --- a/src/Application/Http.php +++ b/src/Application/Http.php @@ -18,10 +18,7 @@ ServerRequest, Response, }; -use Innmind\Router\{ - Route, - Route\Variables, -}; +use Innmind\Router\Route; use Innmind\Immutable\{ Maybe, Sequence, diff --git a/src/Application/Implementation.php b/src/Application/Implementation.php index c83b7e5..77566e9 100644 --- a/src/Application/Implementation.php +++ b/src/Application/Implementation.php @@ -18,10 +18,7 @@ ServerRequest, Response, }; -use Innmind\Router\{ - Route, - Route\Variables, -}; +use Innmind\Router\Route\Variables; /** * @internal diff --git a/tests/ApplicationTest.php b/tests/ApplicationTest.php index 040871a..6177b70 100644 --- a/tests/ApplicationTest.php +++ b/tests/ApplicationTest.php @@ -35,10 +35,7 @@ Path, }; use Innmind\UrlTemplate\Template; -use Innmind\Immutable\{ - Map, - Str, -}; +use Innmind\Immutable\Str; use Innmind\BlackBox\{ PHPUnit\BlackBox, Set, From 66183925535d36a6ae918f8547e651eb8a479f88 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 10 Mar 2024 16:51:14 +0100 Subject: [PATCH 3/5] allow to use innmind/operating-system 5 and innmind/async-http-server 3 --- CHANGELOG.md | 7 +++++++ composer.json | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35b692e..080732d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [Unreleased] + +### Added + +- Support for `innmind/operating-system:~5.0` +- Support for `innmind/async-http-server:~3.0` + ## 2.0.0 - 2023-11-26 ### Added diff --git a/composer.json b/composer.json index 6beff4b..d467a66 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require": { "php": "~8.2", - "innmind/operating-system": "~4.1", + "innmind/operating-system": "~4.1|~5.0", "innmind/cli": "^3.1", "innmind/immutable": "~5.2", "innmind/di": "^2.0", @@ -40,11 +40,11 @@ "vimeo/psalm": "~5.6", "innmind/black-box": "~5.5", "innmind/coding-standard": "~2.0", - "innmind/async-http-server": "~2.0" + "innmind/async-http-server": "~2.0|~3.0" }, "conflict": { "innmind/black-box": "<5.0|~6.0", - "innmind/async-http-server": "<2.0|~3.0" + "innmind/async-http-server": "<2.0|~4.0" }, "suggest": { "innmind/black-box": "For property based testing", From af2863f65208f8f08c54fe3415b81979ff1e39d3 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 10 Mar 2024 17:13:35 +0100 Subject: [PATCH 4/5] wait for the server to be ready --- tests/FunctionalTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 0d6f8cb..9c17b99 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -51,8 +51,16 @@ public function tearDown(): void public function testAsyncHttpServer() { - // let the server time to boot - \usleep(500_000); + $started = $this + ->server + ->output() + ->chunks() + ->find(static fn($pair) => $pair[0]->startsWith('HTTP server ready!')); + + $this->assertTrue($started->match( + static fn() => true, + static fn() => false, + )); $error = $this ->os From b96f0624f5e6ed0ec8f33362f6164c637f3ff48a Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 10 Mar 2024 17:24:24 +0100 Subject: [PATCH 5/5] specify next release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 080732d..ba29bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## 2.1.0 - 2024-03-10 ### Added