mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-10 13:29:51 +00:00
fixes and improvements
This commit is contained in:
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace Testcontainers\Modules;
|
||||
|
||||
use Testcontainers\Container\GenericContainer;
|
||||
use Testcontainers\Wait\WaitForLog;
|
||||
use Testcontainers\Wait\WaitForExec;
|
||||
|
||||
class MySQLContainer extends GenericContainer
|
||||
{
|
||||
@@ -14,7 +14,11 @@ class MySQLContainer extends GenericContainer
|
||||
parent::__construct('mysql:' . $version);
|
||||
$this->withExposedPorts(3306);
|
||||
$this->withEnvironment('MYSQL_ROOT_PASSWORD', $mysqlRootPassword);
|
||||
$this->withWait(new WaitForLog('ready for connections'));
|
||||
$this->withWait(new WaitForExec([
|
||||
"mysqladmin",
|
||||
"ping",
|
||||
"-h", "127.0.0.1",
|
||||
]));
|
||||
}
|
||||
|
||||
public function withMySQLUser(string $username, string $password): self
|
||||
|
||||
Reference in New Issue
Block a user