fix: update port configuration in GenericContainerTest for non standard port

This commit is contained in:
Soner Sayakci
2025-02-14 15:31:41 +01:00
parent cf035bcbd5
commit b25371687d
+3 -3
View File
@@ -118,13 +118,13 @@ class GenericContainerTest extends TestCase
public function testShouldReturnFirstMappedPort(): void public function testShouldReturnFirstMappedPort(): void
{ {
$container = (new GenericContainer('nginx')) $container = (new GenericContainer('nginx'))
->withPortGenerator(new FixedPortGenerator([8080])) ->withPortGenerator(new FixedPortGenerator([9950]))
->withExposedPorts(80) ->withExposedPorts(80)
->withWait(new WaitForHostPort(8080)) ->withWait(new WaitForHostPort(9950))
->start(); ->start();
$firstMappedPort = $container->getFirstMappedPort(); $firstMappedPort = $container->getFirstMappedPort();
self::assertSame($firstMappedPort, 8080, 'First mapped port does not match 8080'); self::assertSame($firstMappedPort, 9950, 'First mapped port does not match 9950');
$container->stop(); $container->stop();
} }