mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 16:29:29 +00:00
Initialize default wait strategy in Constructor
This commit is contained in:
@@ -59,6 +59,7 @@ class GenericContainer implements TestContainer
|
||||
{
|
||||
$this->image = $image;
|
||||
$this->dockerClient = DockerContainerClient::getDockerClient();
|
||||
$this->waitStrategy = new WaitForContainer();
|
||||
}
|
||||
|
||||
public function getId(): string
|
||||
@@ -185,10 +186,6 @@ class GenericContainer implements TestContainer
|
||||
|
||||
$this->dockerClient->containerStart($this->id);
|
||||
|
||||
if (!isset($this->waitStrategy)) {
|
||||
$this->withWait(new WaitForContainer());
|
||||
}
|
||||
|
||||
$startedContainer = new StartedGenericContainer($this->id);
|
||||
$this->waitStrategy->wait($startedContainer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user