mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 16:29:29 +00:00
try to solve testShouldReturnFirstMappedPort
This commit is contained in:
@@ -112,14 +112,11 @@ class GenericContainerTest extends TestCase
|
|||||||
$container->stop();
|
$container->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws \JsonException
|
|
||||||
*/
|
|
||||||
public function testShouldReturnFirstMappedPort(): void
|
public function testShouldReturnFirstMappedPort(): void
|
||||||
{
|
{
|
||||||
$container = (new GenericContainer('nginx'))
|
$container = (new GenericContainer('cristianrgreco/testcontainer:1.1.14'))
|
||||||
->withPortGenerator(new FixedPortGenerator([8080]))
|
->withPortGenerator(new FixedPortGenerator([8080]))
|
||||||
->withExposedPorts(80)
|
->withExposedPorts(8080)
|
||||||
->withWait(new WaitForHostPort(8080))
|
->withWait(new WaitForHostPort(8080))
|
||||||
->start();
|
->start();
|
||||||
$firstMappedPort = $container->getFirstMappedPort();
|
$firstMappedPort = $container->getFirstMappedPort();
|
||||||
|
|||||||
Reference in New Issue
Block a user