From 26e9a672fdc8b5bd1a0fb71ae4b5e5ab695f255b Mon Sep 17 00:00:00 2001 From: Sergei Shitikov Date: Sun, 16 Feb 2025 18:17:09 +0100 Subject: [PATCH] remove forgotten legacy part, adjust doc --- README.md | 6 +++++- src/Wait/WaitForHttp.php | 10 ---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c5fad87..788453f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ use Testcontainers\Wait\WaitForExec; use Testcontainers\Wait\WaitForLog; use Testcontainers\Wait\WaitForHttp; use Testcontainers\Wait\WaitForHealthCheck; +use Testcontainers\Wait\WaitForHostPort; $container = new GenericContainer('nginx:alpine'); @@ -58,7 +59,10 @@ $container->withWait(new WaitForLog('Ready to accept connections')); // Wait for an http request to succeed -$container->withWait(WaitForHttp::make($port, $method = 'GET', $path = '/')); +$container->withWait(new WaitForHttp($port, $method = 'GET', $path = '/')); + +// Wait for all bound ports to be open +$container->withWait(new WaitForHostPort()); // Wait until the docker heartcheck is green $container->withWait(new WaitForHealthCheck()); diff --git a/src/Wait/WaitForHttp.php b/src/Wait/WaitForHttp.php index 3ae06c2..b2dceeb 100644 --- a/src/Wait/WaitForHttp.php +++ b/src/Wait/WaitForHttp.php @@ -38,16 +38,6 @@ class WaitForHttp extends BaseWaitStrategy parent::__construct($timeout, $pollInterval); } - /** - * @deprecated Use constructor instead - * Kept for backward compatibility - * Should be removed in next major version - */ - public static function make(int $port): self - { - return new self($port); - } - /** * @param HttpMethod|value-of $method */