Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
19ee1ed
feat: add `MySQL` CI workflow and corresponding test classes for impr…
terabytesoftw Jul 6, 2025
64bc5d5
fix: update action reference in `MySQL` CI workflow for correct path,
terabytesoftw Jul 6, 2025
26ba362
fix: specify version for phpunit-database workflow in `MySQL` CI conf…
terabytesoftw Jul 6, 2025
f66dfa2
fix: update database connection settings in `MySQL` test classes.
terabytesoftw Jul 6, 2025
cc2773e
fix: rename 'user' to 'username' in database connection configuration…
terabytesoftw Jul 6, 2025
c089ff4
fix: remove redundant name from `MySQL` CI job configuration.
terabytesoftw Jul 6, 2025
a69fe70
fix: add descriptive name to `MySQL` job in CI configuration.
terabytesoftw Jul 6, 2025
f476257
fix: rename 'user' to 'username' in `MySQL` test classes for consiste…
terabytesoftw Jul 6, 2025
7ca0902
fix: execute `dropTable()` commands in `TestCase` to ensure proper ta…
terabytesoftw Jul 6, 2025
8d723b4
fix: add `phpunit` group to `MySQL` CI configuration for improved tes…
terabytesoftw Jul 6, 2025
62de88f
fix: rename CI workflow to `build-mysql` for clarity and correct `php…
terabytesoftw Jul 6, 2025
16bfd6f
fix: rename `group-phpunit` to `phpunit-group` for consistency in CI …
terabytesoftw Jul 6, 2025
1e58e92
fix: update CI configuration to use `phpunit-group` for `MySQL` compa…
terabytesoftw Jul 6, 2025
73ef80c
feat: add initial CI workflow for MySQL tests with phpunit integration.
terabytesoftw Jul 6, 2025
2dca3d6
feat: Add `PostgreSQL` test suite with multiple test cases for improv…
terabytesoftw Jul 6, 2025
e04784e
fix: sort dataset queries by `id` for consistent order in test cases.
terabytesoftw Jul 6, 2025
f43e8bb
feat: add `driverName` property to test classes for database compatib…
terabytesoftw Jul 6, 2025
e90daf5
fix: update `DSN` property placement in `MySQL` and `PostgreSQL` test…
terabytesoftw Jul 6, 2025
762243b
feat: add `SQLServer` test suite with multiple test cases for improve…
terabytesoftw Jul 6, 2025
9d40d7e
feat: add installation command for Microsoft ODBC Driver in `SQLServe…
terabytesoftw Jul 6, 2025
6321cb8
fix: reorder `username` and `password` properties for consistency acr…
terabytesoftw Jul 6, 2025
cf299b0
fix: enhance root node insertion logic to check for existing nodes wi…
terabytesoftw Jul 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ jobs:
composer-command: |
composer require yiisoft/yii2:22.0.x-dev --prefer-dist --no-progress --no-interaction --no-scripts --ansi
concurrency-group: phpunit-${{ github.workflow }}-${{ github.ref }}
exclude-group-phpunit: mysql
extensions: pdo, pdo_sqlite
phpunit-compatibility:
uses: php-forge/actions/.github/workflows/phpunit.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
concurrency-group: compatibility-${{ github.workflow }}-${{ github.ref }}
exclude-group-phpunit: mysql
extensions: pdo, pdo_sqlite
28 changes: 28 additions & 0 deletions .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
- pull_request
- push

name: build

jobs:
mysql:
uses: php-forge/actions/.github/workflows/phpunit-database.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
concurrency-group: mysql-${{ github.ref }}
database-env: |
{
"MYSQL_DATABASE": "yiitest",
"MYSQL_ROOT_PASSWORD": "root",
}
database-health-cmd: "mysqladmin ping"
database-health-retries: 3
database-image: mysql
database-port: 3306
database-type: mysql
database-versions: '["8.0", "8.4", "latest"]'
enable-concurrency: true
group-phpunit: mysql
extensions: pdo, pdo_mysql
os: '["ubuntu-latest"]'
4 changes: 4 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class TestCase extends \PHPUnit\Framework\TestCase

protected string|null $dsn = null;
protected string $fixtureDirectory = __DIR__ . '/support/data/';
protected string $password = '';
protected string $user = '';

protected function setUp(): void
{
Expand Down Expand Up @@ -352,6 +354,8 @@ protected function mockConsoleApplication(): void
'db' => [
'class' => Connection::class,
'dsn' => $this->dsn !== null ? $this->dsn : 'sqlite::memory:',
'username' => $this->user,
'password' => $this->password,
],
],
],
Expand Down
16 changes: 16 additions & 0 deletions tests/mysql/CacheManagementTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractCacheManagement;

#[Group('mysql')]
final class CacheManagementTest extends AbstractCacheManagement
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/ExceptionHandlingTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractExceptionHandling;

#[Group('mysql')]
final class ExceptionHandlingTest extends AbstractExceptionHandling
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/ExtensibilityTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractExtensibility;

#[Group('mysql')]
final class ExtensibilityTest extends AbstractExtensibility
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/NodeAppendTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeAppend;

#[Group('mysql')]
final class NodeAppendTest extends AbstractNodeAppend
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/NodeDeleteTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeDelete;

#[Group('mysql')]
final class NodeDeleteTest extends AbstractNodeDelete
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/NodeInsertTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeInsert;

#[Group('mysql')]
final class NodeInsertTest extends AbstractNodeInsert
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/NodePrependTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodePrepend;

#[Group('mysql')]
final class NodePrependTest extends AbstractNodePrepend
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/NodeStateTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeState;

#[Group('mysql')]
final class NodeStateTest extends AbstractNodeState
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/QueryBehaviorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractQueryBehavior;

#[Group('mysql')]
final class QueryBehaviorTest extends AbstractQueryBehavior
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/TreeTraversalTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractTreeTraversal;

#[Group('mysql')]
final class TreeTraversalTest extends AbstractTreeTraversal
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
16 changes: 16 additions & 0 deletions tests/mysql/ValidationAndStructureTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests\mysql;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractValidationAndStructure;

#[Group('mysql')]
final class ValidationAndStructureTest extends AbstractValidationAndStructure
{
protected string|null $dsn = 'mysql:host=127.0.0.1;dbname=yiitest;charset=utf8mb4';
protected string $user = 'root';
protected string $password = 'root';
}
2 changes: 1 addition & 1 deletion tests/sqlite/CacheManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractCacheManagement;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/ExceptionHandlingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractExceptionHandling;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/ExtensibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractExtensibility;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/NodeAppendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeAppend;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/NodeDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeDelete;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/NodeInsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeInsert;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/NodePrependTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodePrepend;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/NodeStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractNodeState;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/QueryBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractQueryBehavior;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/TreeTraversalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractTreeTraversal;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/ValidationAndStructureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace yii2\extensions\nestedsets\tests;
namespace yii2\extensions\nestedsets\tests\sqlite;

use PHPUnit\Framework\Attributes\Group;
use yii2\extensions\nestedsets\tests\base\AbstractValidationAndStructure;
Expand Down
Loading