mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 19:29:39 +00:00
fix: pdo_pgsql usage
This commit is contained in:
@@ -15,9 +15,9 @@ class PostgresContainer extends Container
|
||||
$this->withWait(new WaitForExec(["pg_isready", "-h", "127.0.0.1"]));
|
||||
}
|
||||
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
public static function make(string $version = 'latest', string $dbPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
return new self($version, $dbPassword);
|
||||
}
|
||||
|
||||
public function withPostgresUser(string $username): self
|
||||
|
||||
@@ -106,12 +106,12 @@ class ContainerTest extends TestCase
|
||||
|
||||
|
||||
$pdo = new \PDO(
|
||||
sprintf('postgres:host=%s;port=5432', $container->getAddress()),
|
||||
sprintf('pgsql:host=%s;port=5432;dbname=foo', $container->getAddress()),
|
||||
'test',
|
||||
'test',
|
||||
);
|
||||
|
||||
$query = $pdo->query('SHOW databases');
|
||||
$query = $pdo->query('SELECT datname FROM pg_database');
|
||||
|
||||
$this->assertInstanceOf(\PDOStatement::class, $query);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user