mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 17: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->image = $image;
|
||||||
$this->dockerClient = DockerContainerClient::getDockerClient();
|
$this->dockerClient = DockerContainerClient::getDockerClient();
|
||||||
|
$this->waitStrategy = new WaitForContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): string
|
public function getId(): string
|
||||||
@@ -185,10 +186,6 @@ class GenericContainer implements TestContainer
|
|||||||
|
|
||||||
$this->dockerClient->containerStart($this->id);
|
$this->dockerClient->containerStart($this->id);
|
||||||
|
|
||||||
if (!isset($this->waitStrategy)) {
|
|
||||||
$this->withWait(new WaitForContainer());
|
|
||||||
}
|
|
||||||
|
|
||||||
$startedContainer = new StartedGenericContainer($this->id);
|
$startedContainer = new StartedGenericContainer($this->id);
|
||||||
$this->waitStrategy->wait($startedContainer);
|
$this->waitStrategy->wait($startedContainer);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user