Skip to content

Commit 2dca3d6

Browse files
committed
feat: Add PostgreSQL test suite with multiple test cases for improved coverage.
1 parent 73ef80c commit 2dca3d6

12 files changed

+220
-0
lines changed

.github/workflows/build-pgsql.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
10+
push:
11+
paths-ignore:
12+
- 'docs/**'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- '.gitignore'
16+
- '.gitattributes'
17+
18+
name: build-pgsql
19+
20+
jobs:
21+
pgsql:
22+
name: PostgreSQL tests.
23+
uses: php-forge/actions/.github/workflows/phpunit-database.yml@main
24+
secrets:
25+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
26+
with:
27+
concurrency-group: pgsql-${{ github.ref }}
28+
database-env: |
29+
{
30+
"POSTGRES_DB": "yiitest",
31+
"POSTGRES_USER": "root",
32+
"POSTGRES_PASSWORD": "root"
33+
}
34+
database-health-cmd: "pg_isready -U postgres"
35+
database-health-retries: 3
36+
database-image: postgres
37+
database-port: 5432
38+
database-type: pgsql
39+
database-versions: '["15", "16", "17"]'
40+
enable-concurrency: true
41+
extensions: pdo, pdo_pgsql
42+
os: '["ubuntu-latest"]'
43+
php-version: '["8.4"]'
44+
phpunit-group: pgsql
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractCacheManagement;
9+
10+
#[Group('pgsql')]
11+
final class CacheManagementTest extends AbstractCacheManagement
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractExceptionHandling;
9+
10+
#[Group('pgsql')]
11+
final class ExceptionHandlingTest extends AbstractExceptionHandling
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/ExtensibilityTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractExtensibility;
9+
10+
#[Group('pgsql')]
11+
final class ExtensibilityTest extends AbstractExtensibility
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/NodeAppendTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractNodeAppend;
9+
10+
#[Group('pgsql')]
11+
final class NodeAppendTest extends AbstractNodeAppend
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/NodeDeleteTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractNodeDelete;
9+
10+
#[Group('pgsql')]
11+
final class NodeDeleteTest extends AbstractNodeDelete
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/NodeInsertTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractNodeInsert;
9+
10+
#[Group('pgsql')]
11+
final class NodeInsertTest extends AbstractNodeInsert
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/NodePrependTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractNodePrepend;
9+
10+
#[Group('pgsql')]
11+
final class NodePrependTest extends AbstractNodePrepend
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/NodeStateTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractNodeState;
9+
10+
#[Group('pgsql')]
11+
final class NodeStateTest extends AbstractNodeState
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

tests/pgsql/QueryBehaviorTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace yii2\extensions\nestedsets\tests\pgsql;
6+
7+
use PHPUnit\Framework\Attributes\Group;
8+
use yii2\extensions\nestedsets\tests\base\AbstractQueryBehavior;
9+
10+
#[Group('pgsql')]
11+
final class QueryBehaviorTest extends AbstractQueryBehavior
12+
{
13+
protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;';
14+
protected string $password = 'root';
15+
protected string $username = 'root';
16+
}

0 commit comments

Comments
 (0)