mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 16:29:29 +00:00
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\WaitForLog;
|
||||||
use Testcontainers\Wait\WaitForHttp;
|
use Testcontainers\Wait\WaitForHttp;
|
||||||
use Testcontainers\Wait\WaitForHealthCheck;
|
use Testcontainers\Wait\WaitForHealthCheck;
|
||||||
|
use Testcontainers\Wait\WaitForHostPort;
|
||||||
|
|
||||||
$container = new GenericContainer('nginx:alpine');
|
$container = new GenericContainer('nginx:alpine');
|
||||||
|
|
||||||
@@ -58,7 +59,10 @@ $container->withWait(new WaitForLog('Ready to accept connections'));
|
|||||||
|
|
||||||
|
|
||||||
// Wait for an http request to succeed
|
// 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
|
// Wait until the docker heartcheck is green
|
||||||
$container->withWait(new WaitForHealthCheck());
|
$container->withWait(new WaitForHealthCheck());
|
||||||
|
|||||||
@@ -38,16 +38,6 @@ class WaitForHttp extends BaseWaitStrategy
|
|||||||
parent::__construct($timeout, $pollInterval);
|
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
|
* @param HttpMethod|value-of<HttpMethod> $method
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user