mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 19:29:39 +00:00
Implement WaitForExec using new Client library. Add BaseWait to avoid some code duplication. Adjust Postgres test
This commit is contained in:
@@ -5,23 +5,20 @@ declare(strict_types=1);
|
||||
namespace Testcontainers\Wait;
|
||||
|
||||
use Docker\API\Runtime\Client\Client;
|
||||
use Docker\Docker;
|
||||
use Testcontainers\Exception\ContainerWaitingTimeoutException;
|
||||
|
||||
/**
|
||||
* Uses $timout and $pollInterval in milliseconds to set the parameters for waiting.
|
||||
*/
|
||||
class WaitForLog implements WaitInterface
|
||||
class WaitForLog extends BaseWait
|
||||
{
|
||||
protected Docker $dockerClient;
|
||||
|
||||
public function __construct(
|
||||
protected string $message,
|
||||
protected bool $enableRegex = false,
|
||||
protected int $timeout = 10000,
|
||||
protected int $pollInterval = 500
|
||||
int $timeout = 10000,
|
||||
int $pollInterval = 500
|
||||
) {
|
||||
$this->dockerClient = Docker::create();
|
||||
parent::__construct($timeout, $pollInterval);
|
||||
}
|
||||
|
||||
public function wait(string $id): void
|
||||
|
||||
Reference in New Issue
Block a user