mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 15:29:31 +00:00
Fix #35 fails when run container using withNetwork()
This commit is contained in:
@@ -411,9 +411,12 @@ class GenericContainer implements TestContainer
|
||||
|
||||
if ($this->networkName !== null) {
|
||||
$networkingConfig = new NetworkingConfig();
|
||||
$endpointsConfig = new \ArrayObject([
|
||||
$this->networkName => new EndpointSettings(),
|
||||
]);
|
||||
$endpointsConfig = [
|
||||
$this->networkName => new EndpointSettings([
|
||||
'networkID' => $this->networkName,
|
||||
'aliases' => $this->name ? [$this->name] : [],
|
||||
]),
|
||||
];
|
||||
$networkingConfig->setEndpointsConfig($endpointsConfig);
|
||||
$containerCreatePostBody->setNetworkingConfig($networkingConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user