mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-12 11:29:36 +00:00
increase default timeout for mysql and mariadb, change image for testShouldReturnFirstMappedPort()
This commit is contained in:
@@ -18,7 +18,7 @@ class MariaDBContainer extends GenericContainer
|
|||||||
"mariadb-admin",
|
"mariadb-admin",
|
||||||
"ping",
|
"ping",
|
||||||
"-h", "127.0.0.1",
|
"-h", "127.0.0.1",
|
||||||
]));
|
], null, 15000));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function withMariaDBUser(string $username, string $password): self
|
public function withMariaDBUser(string $username, string $password): self
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class MySQLContainer extends GenericContainer
|
|||||||
"mysqladmin",
|
"mysqladmin",
|
||||||
"ping",
|
"ping",
|
||||||
"-h", "127.0.0.1",
|
"-h", "127.0.0.1",
|
||||||
]));
|
], null, 15000));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function withMySQLUser(string $username, string $password): self
|
public function withMySQLUser(string $username, string $password): self
|
||||||
|
|||||||
@@ -114,14 +114,14 @@ class GenericContainerTest extends TestCase
|
|||||||
|
|
||||||
public function testShouldReturnFirstMappedPort(): void
|
public function testShouldReturnFirstMappedPort(): void
|
||||||
{
|
{
|
||||||
$container = (new GenericContainer('nginx'))
|
$container = (new GenericContainer('cristianrgreco/testcontainer:1.1.14'))
|
||||||
->withPortGenerator(new FixedPortGenerator([9950]))
|
->withPortGenerator(new FixedPortGenerator([8080]))
|
||||||
->withExposedPorts(80)
|
->withExposedPorts(8080)
|
||||||
->withWait(new WaitForHostPort(9950))
|
->withWait(new WaitForHostPort(8080))
|
||||||
->start();
|
->start();
|
||||||
$firstMappedPort = $container->getFirstMappedPort();
|
$firstMappedPort = $container->getFirstMappedPort();
|
||||||
|
|
||||||
self::assertSame($firstMappedPort, 9950, 'First mapped port does not match 9950');
|
self::assertSame($firstMappedPort, 8080, 'First mapped port does not match 8080');
|
||||||
|
|
||||||
$container->stop();
|
$container->stop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user