Skip to content

Commit 47ed9f5

Browse files
authored
Merge pull request #13 from pfilsx/tests
Tests
2 parents 965c746 + 5a8382e commit 47ed9f5

25 files changed

+578
-24
lines changed

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
*.md export-ignore
21
.* export-ignore
2+
*.md export-ignore
3+
/tests export-ignore
4+
/phpunit.xml.dist export-ignore
5+
/.github export-ignore
6+
/.php-cs-fixer.php export-ignore
37
/docs export-ignore

.github/workflows/ci.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ dev, master ]
5+
pull_request:
6+
branches: [ dev, master ]
7+
jobs:
8+
tests:
9+
runs-on: 'Ubuntu-20.04'
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php: ['8.1', '8.2']
14+
15+
name: Tests PHP ${{ matrix.php }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '${{ matrix.php }}'
21+
coverage: none
22+
ini-values: 'memory_limit=-1'
23+
- uses: "ramsey/composer-install@v2"
24+
- name: Run Unit tests
25+
run: vendor/bin/phpunit
26+
style:
27+
runs-on: 'Ubuntu-20.04'
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
php: [ '8.2' ]
32+
name: Style PHP ${{ matrix.php }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: '${{ matrix.php }}'
38+
coverage: none
39+
ini-values: 'memory_limit=-1'
40+
- uses: "ramsey/composer-install@v2"
41+
- name: Run Style checks
42+
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --dry-run --stop-on-violation

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
2-
/composer.lock
2+
/composer.lock
3+
.phpunit.result.cache

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@
2929
"Pfilsx\\PostgreSQLDoctrine\\": "src/"
3030
}
3131
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"Pfilsx\\PostgreSQLDoctrine\\Tests\\": "tests/"
35+
}
36+
},
3237
"require-dev": {
3338
"friendsofphp/php-cs-fixer": "^3.13",
3439
"doctrine/orm": "^2.13",
3540
"symfony/serializer": ">=5.4",
36-
"symfony/property-info": ">=5.4"
41+
"symfony/property-info": ">=5.4",
42+
"phpunit/phpunit": "^10.0",
43+
"symfony/property-access": ">=5.4"
3744
}
3845
}

phpunit.xml.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd">
3+
<testsuites>
4+
<testsuite name="PostgreSQLDoctrine">
5+
<directory suffix="Test.php">./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
9+
<source>
10+
<include>
11+
<directory>./src</directory>
12+
</include>
13+
</source>
14+
</phpunit>

src/DBAL/Platform/PostgreSQLPlatform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Pfilsx\PostgreSQLDoctrine\DBAL\Type\EnumType;
1515
use Pfilsx\PostgreSQLDoctrine\DBAL\Type\JsonModelType;
1616

17-
final class PostgreSQLPlatform extends BasePlatform
17+
class PostgreSQLPlatform extends BasePlatform
1818
{
1919
public function createSchemaManager(Connection $connection): PostgreSQLSchemaManager
2020
{

src/DBAL/Schema/EnumTypeUsageAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class EnumTypeUsageAsset
1212

1313
private ?string $default;
1414

15-
public function __construct(string $table, string $column, ?string $default = null)
15+
public function __construct(string $table, string $column, string $default = null)
1616
{
1717
$this->table = $table;
1818
$this->column = $column;

src/DBAL/Schema/PostgreSQLSchemaManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function createComparator(): Comparator
6161
return new Comparator($this->_platform);
6262
}
6363

64-
protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result
64+
protected function selectTableColumns(string $databaseName, string $tableName = null): Result
6565
{
6666
$sql = 'SELECT';
6767

src/DBAL/Schema/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class Schema extends BaseSchema
1818
public function __construct(
1919
array $tables = [],
2020
array $sequences = [],
21-
?SchemaConfig $schemaConfig = null,
21+
SchemaConfig $schemaConfig = null,
2222
array $namespaces = [],
2323
array $types = []
2424
) {

src/DBAL/Schema/SchemaDiff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
array $createdTables = [],
2323
array $alteredTables = [],
2424
array $droppedTables = [],
25-
?Schema $fromSchema = null,
25+
Schema $fromSchema = null,
2626
array $createdSchemas = [],
2727
array $droppedSchemas = [],
2828
array $createdSequences = [],

0 commit comments

Comments
 (0)