test improvements

This commit is contained in:
Sergei Shitikov
2025-01-01 23:29:57 +01:00
parent 774743a7ce
commit dfff7ef282
11 changed files with 129 additions and 34 deletions
+4 -4
View File
@@ -8,9 +8,9 @@ use Testcontainers\Modules\MySQLContainer;
class MySQLContainerTest extends ContainerTestCase
{
public static function setUpBeforeClass(): void
public function setUp(): void
{
self::$container = (new MySQLContainer())
$this->container = (new MySQLContainer())
->withMySQLDatabase('foo')
->withMySQLUser('bar', 'baz')
->start();
@@ -21,8 +21,8 @@ class MySQLContainerTest extends ContainerTestCase
$pdo = new \PDO(
sprintf(
'mysql:host=%s;port=%d',
self::$container->getHost(),
self::$container->getFirstMappedPort()
$this->container->getHost(),
$this->container->getFirstMappedPort()
),
'bar',
'baz',