try to solve testShouldReturnFirstMappedPort

This commit is contained in:
Sergei Shitikov
2025-02-16 13:15:50 +01:00
parent 51f6e9d22b
commit cc99febf71
+2 -5
View File
@@ -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();