Skip to content

Commit f66dfa2

Browse files
committed
fix: update database connection settings in MySQL test classes.
1 parent 26ba362 commit f66dfa2

12 files changed

+37
-11
lines changed

tests/TestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class TestCase extends \PHPUnit\Framework\TestCase
4141

4242
protected string|null $dsn = null;
4343
protected string $fixtureDirectory = __DIR__ . '/support/data/';
44+
protected string $password = '';
45+
protected string $user = '';
4446

4547
protected function setUp(): void
4648
{
@@ -352,6 +354,8 @@ protected function mockConsoleApplication(): void
352354
'db' => [
353355
'class' => Connection::class,
354356
'dsn' => $this->dsn !== null ? $this->dsn : 'sqlite::memory:',
357+
'user' => $this->user,
358+
'password' => $this->password,
355359
],
356360
],
357361
],

tests/mysql/CacheManagementTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class CacheManagementTest extends AbstractCacheManagement
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/ExceptionHandlingTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class ExceptionHandlingTest extends AbstractExceptionHandling
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/ExtensibilityTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class ExtensibilityTest extends AbstractExtensibility
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/NodeAppendTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class NodeAppendTest extends AbstractNodeAppend
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/NodeDeleteTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class NodeDeleteTest extends AbstractNodeDelete
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/NodeInsertTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class NodeInsertTest extends AbstractNodeInsert
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/NodePrependTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class NodePrependTest extends AbstractNodePrepend
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/NodeStateTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class NodeStateTest extends AbstractNodeState
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

tests/mysql/QueryBehaviorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
#[Group('mysql')]
1111
final class QueryBehaviorTest extends AbstractQueryBehavior
1212
{
13-
protected string|null $dsn = 'sqlite::memory:';
13+
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
14+
protected string $user = 'root';
15+
protected string $password = 'root';
1416
}

0 commit comments

Comments
 (0)