mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 15:29:31 +00:00
Merge pull request #6 from rw4lll/feat/wait-host-port-adjust
remove forgotten legacy part, adjust doc
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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<HttpMethod> $method
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user