mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 17:29:29 +00:00
cleanup
This commit is contained in:
@@ -110,12 +110,16 @@ class StartedGenericContainer implements StartedTestContainer
|
||||
//TODO: not ready yet
|
||||
public function getFirstMappedPort(): int
|
||||
{
|
||||
var_dump($this->dockerClient);die(123);
|
||||
/** @var \Docker\API\Model\ContainersIdJsonGetResponse200 | null $containerInspectResponse */
|
||||
$containerInspectResponse = $this->dockerClient->containerInspect($this->id);
|
||||
$settings = $containerInspectResponse->getNetworkSettings();
|
||||
|
||||
$ports = (array)$settings->getPorts();
|
||||
$port = array_key_first($ports);
|
||||
|
||||
var_dump($ports, $port, (int)$ports[$port][0]->getHostPort());
|
||||
|
||||
return (int) $ports[$port][0]->getHostPort();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,15 +22,6 @@ class OpenSearchContainer extends GenericContainer
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
}
|
||||
|
||||
public function withDisabledSecurityPlugin(): self
|
||||
{
|
||||
$this->withEnvironment('plugins.security.disabled', 'true');
|
||||
|
||||
Reference in New Issue
Block a user