Skip to content

Commit 00be735

Browse files
committed
Update to PHPUnit 11 and require PHP 8.2+
1 parent d0590ae commit 00be735

7 files changed

Lines changed: 24 additions & 37 deletions

File tree

.gitattributes

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/.github/ export-ignore
2-
/test/ export-ignore
3-
/phpunit.xml export-ignore
4-
/phpstan.neon export-ignore
1+
/.github/ export-ignore
2+
/test/ export-ignore
3+
/.editorconfig export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.php export-ignore
7+
/phpstan.neon export-ignore

.github/workflows/php.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
strategy:
99
matrix:
10-
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
10+
php: [ '8.2', '8.3', '8.4', '8.5' ]
1111

1212
services:
1313
mysql:
@@ -27,7 +27,7 @@ jobs:
2727
# Set health checks to wait until postgres has started
2828
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2929
ports:
30-
# Maps tcp port 5432 on service container to the host
30+
# map port 5432 on service container to the host
3131
- 5432:5432
3232

3333
steps:
@@ -46,11 +46,8 @@ jobs:
4646
- name: Validate composer.json and composer.lock
4747
run: composer validate --strict
4848

49-
- name: Validate composer.json and composer.lock
50-
run: composer validate --strict
51-
5249
- name: Install Composer dependencies
53-
run: composer install --no-progress
50+
uses: "ramsey/composer-install@v3"
5451

5552
- name: Perform static analysis
5653
run: composer analyze -- --error-format=github
@@ -62,5 +59,5 @@ jobs:
6259
POSTGRES_HOST: localhost
6360

6461
- name: Check Formatting
65-
run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no
62+
run: vendor/bin/php-cs-fixer check -v --show-progress=dots --stop-on-violation --using-cache=no
6663
if: ${{ matrix.php == '8.5' }}

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": ">=8.1",
20+
"php": ">=8.2",
2121
"ext-pdo": "*",
2222
"devtheorem/peachy-sql": "^7.0.1",
2323
"psr/http-message": "^1.1 || ^2.0",
@@ -26,7 +26,7 @@
2626
"require-dev": {
2727
"friendsofphp/php-cs-fixer": "^3.91",
2828
"phpstan/phpstan": "^2.1.32",
29-
"phpunit/phpunit": "^10.5"
29+
"phpunit/phpunit": "^11.5"
3030
},
3131
"autoload": {
3232
"psr-4": {
@@ -44,11 +44,10 @@
4444
"scripts": {
4545
"analyze": "phpstan analyze",
4646
"cs-fix": "php-cs-fixer fix -v",
47-
"test": "phpunit",
48-
"test-mssql": "phpunit --exclude-group mysql,pgsql",
49-
"test-mysql": "phpunit --exclude-group mssql,pgsql",
50-
"test-pgsql": "phpunit --exclude-group mssql,mysql",
51-
"test-without-mssql": "phpunit --exclude-group mssql",
52-
"test-without-db": "phpunit --exclude-group mssql,mysql"
47+
"test": "phpunit test --bootstrap test/bootstrap.php",
48+
"test-mssql": "@test --exclude-group mysql --exclude-group pgsql",
49+
"test-mysql": "@test --exclude-group mssql --exclude-group pgsql",
50+
"test-pgsql": "@test --exclude-group mssql --exclude-group mysql",
51+
"test-without-mssql": "@test --exclude-group mssql"
5352
}
5453
}

phpunit.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/MssqlDbTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
use DevTheorem\PeachySQL\PeachySql;
66
use DevTheorem\Phaster\Test\src\App;
77
use PDO;
8+
use PHPUnit\Framework\Attributes\Group;
89

9-
/**
10-
* @group mssql
11-
*/
10+
#[Group('mssql')]
1211
class MssqlDbTest extends DbTestCase
1312
{
1413
private static ?PeachySql $db = null;

test/MysqlDbTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
use DevTheorem\PeachySQL\PeachySql;
66
use DevTheorem\Phaster\Test\src\App;
77
use PDO;
8+
use PHPUnit\Framework\Attributes\Group;
89

9-
/**
10-
* @group mysql
11-
*/
10+
#[Group('mysql')]
1211
class MysqlDbTest extends DbTestCase
1312
{
1413
private static ?PeachySql $db = null;

test/PgsqlDbTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
use DevTheorem\PeachySQL\PeachySql;
66
use DevTheorem\Phaster\Test\src\App;
77
use PDO;
8+
use PHPUnit\Framework\Attributes\Group;
89

9-
/**
10-
* @group pgsql
11-
*/
10+
#[Group('pgsql')]
1211
class PgsqlDbTest extends DbTestCase
1312
{
1413
private static ?PeachySql $db = null;

0 commit comments

Comments
 (0)