fixes and improvements

This commit is contained in:
Sergei Shitikov
2024-09-08 19:04:15 +02:00
parent aa2c1eb900
commit 357887542f
15 changed files with 140 additions and 104 deletions
+6 -2
View File
@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Testcontainers\Modules;
use Testcontainers\Container\GenericContainer;
use Testcontainers\Wait\WaitForLog;
use Testcontainers\Wait\WaitForExec;
class MariaDBContainer extends GenericContainer
{
@@ -13,8 +13,12 @@ class MariaDBContainer extends GenericContainer
{
parent::__construct('mariadb:' . $version);
$this->withExposedPorts(3306);
$this->withWait(new WaitForLog('ready for connections'));
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
$this->withWait(new WaitForExec([
"mariadb-admin",
"ping",
"-h", "127.0.0.1",
]));
}
public function withMariaDBUser(string $username, string $password): self