mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 16:29:29 +00:00
Merge pull request #37 from rw4lll/fix/35-with-network-option-fails
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) {
|
if ($this->networkName !== null) {
|
||||||
$networkingConfig = new NetworkingConfig();
|
$networkingConfig = new NetworkingConfig();
|
||||||
$endpointsConfig = new \ArrayObject([
|
$endpointsConfig = [
|
||||||
$this->networkName => new EndpointSettings(),
|
$this->networkName => new EndpointSettings([
|
||||||
]);
|
'networkID' => $this->networkName,
|
||||||
|
'aliases' => $this->name ? [$this->name] : [],
|
||||||
|
]),
|
||||||
|
];
|
||||||
$networkingConfig->setEndpointsConfig($endpointsConfig);
|
$networkingConfig->setEndpointsConfig($endpointsConfig);
|
||||||
$containerCreatePostBody->setNetworkingConfig($networkingConfig);
|
$containerCreatePostBody->setNetworkingConfig($networkingConfig);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user