Skip to content

Commit e1d6459

Browse files
authored
Migrate the testsuite to PHPUnit 11 (#1977)
1 parent c1a8957 commit e1d6459

File tree

220 files changed

+1057
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+1057
-480
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
sed -i -re 's/"require": \{/"repositories": [{"type": "path","url": "..\/..\/Core", "options": {"versions": {"async-aws\/core": "dev-master"}}, "canonical": ${{matrix.strategy != 'lowest' && 'true' || 'false'}} }],"require": \{/' composer.json
5959
composer config minimum-stability dev
6060
composer config prefer-stable true
61-
composer require --dev --no-update symfony/phpunit-bridge:^7.3.2
6261
cat composer.json
6362
6463
echo ::endgroup::
@@ -71,7 +70,6 @@ jobs:
7170
echo "$CURRENT_DIR/$COMPONENT"
7271
cd "$CURRENT_DIR/$COMPONENT"
7372
74-
sed -i -re 's/"require": \{/"conflict": \{"phpunit\/phpunit": ">=10.0"\},"require": \{/' composer.json
7573
composer config minimum-stability dev
7674
composer config prefer-stable true
7775
cat composer.json
@@ -93,9 +91,7 @@ jobs:
9391
cd "$CURRENT_DIR/$COMPONENT"
9492
9593
localExit=0
96-
composer require symfony/phpunit-bridge:^7.3.2@dev --dev --no-update --no-install
9794
composer update --no-interaction --no-scripts --prefer-dist --optimize-autoloader ${{ matrix.strategy == 'lowest' && '--prefer-lowest' || '' }} $COMPOSER_OPTIONS || localExit=1
98-
./vendor/bin/simple-phpunit install
9995
echo ::endgroup::
10096
if [ $localExit -ne 0 ]; then
10197
echo "::error::$COMPONENT error"
@@ -105,19 +101,16 @@ jobs:
105101
106102
- name: Run tests
107103
env:
108-
OVERRIDE_SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.strategy == 'lowest' && 'max[self]=9999' || '' }}
104+
PHPUNIT_FLAGS: ${{ matrix.strategy == 'lowest' && '--do-not-fail-on-deprecation' || '' }}
109105
run: |
110106
ok=0
111-
if [ -n "$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER" ]; then
112-
export SYMFONY_DEPRECATIONS_HELPER=$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER
113-
fi
114107
CURRENT_DIR=$(pwd)
115108
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
116109
do
117110
echo ::group::$COMPONENT
118111
localExit=0
119112
cd "$CURRENT_DIR/$COMPONENT"
120-
./vendor/bin/simple-phpunit 2>&1 || localExit=1
113+
./vendor/bin/phpunit $PHPUNIT_FLAGS 2>&1 || localExit=1
121114
ok=$(( $localExit || $ok ))
122115
echo ::endgroup::
123116
if [ $localExit -ne 0 ]; then
@@ -163,12 +156,7 @@ jobs:
163156
- name: Download dependencies
164157
run: |
165158
composer config minimum-stability ${{ matrix.minimum_stability }}
166-
composer require --dev --no-update "phpunit/phpunit=9.6.*"
167159
composer update --no-interaction --prefer-dist --optimize-autoloader
168160
169161
- name: Run tests
170-
run: |
171-
echo ::group::Install
172-
./vendor/bin/simple-phpunit install
173-
echo ::endgroup::
174-
./vendor/bin/simple-phpunit
162+
run: ./vendor/bin/phpunit

.github/workflows/static.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ jobs:
4040
restore-keys: phpstan-
4141

4242
- name: Download dependencies
43-
run: |
44-
composer update --no-interaction --prefer-dist --optimize-autoloader
45-
./vendor/bin/simple-phpunit install
43+
run: composer update --no-interaction --prefer-dist --optimize-autoloader
4644

4745
- name: PHPStan
4846
run: vendor/bin/phpstan analyze --no-progress
@@ -104,9 +102,7 @@ jobs:
104102
restore-keys: composer-
105103

106104
- name: Download dependencies
107-
run: |
108-
composer update --no-interaction --prefer-dist --optimize-autoloader
109-
./vendor/bin/simple-phpunit install
105+
run: composer update --no-interaction --prefer-dist --optimize-autoloader
110106

111107
- name: Psalm
112108
run: vendor/bin/psalm.phar --no-progress --show-info=false --stats

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ stop-docker:
3939
docker rm async_aws_kms || true
4040

4141
test: initialize
42-
./vendor/bin/simple-phpunit
42+
./vendor/bin/phpunit
4343

4444
website-assets: website/template/assets/app.css
4545
website/template/assets/app.css: website/node_modules website/assets/*

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"illuminate/cache": "^6.18.13 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
2222
"illuminate/queue": "^6.18.11 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
2323
"illuminate/support": "^6.18.13 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
24-
"matthiasnoback/symfony-config-test": "^4.1 || ^5.0",
24+
"matthiasnoback/symfony-config-test": "^6.1",
2525
"monolog/monolog": "^1.1 || ^2.0 || ^3.0",
2626
"nette/php-generator": "^3.6 || ^4.1",
2727
"nette/utils": "^3.0 || ^4.0",
28-
"nikic/php-parser": "^4.0",
2928
"nyholm/symfony-bundle-test": "^3.0",
3029
"phpstan/phpstan": "~2.0.0",
30+
"phpunit/phpunit": "^11.5.42",
3131
"psalm/phar": "~6.13.1",
3232
"psr/cache": "^1.0 || ^2.0 || ^3.0",
3333
"swaggest/json-diff": "^3.7",
@@ -36,14 +36,16 @@
3636
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
3737
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
3838
"symfony/deprecation-contracts": "^2.1 || ^3.0",
39+
"symfony/error-handler": "^7.3.2 || ^8.0",
3940
"symfony/filesystem": "^5.0 || ^6.0 || ^7.0 || ^8.0",
4041
"symfony/finder": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
42+
"symfony/framework-bundle": "^5.4.45 || ^6.4.13 || ^7.1.6",
4143
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
42-
"symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0 || ^8.0",
43-
"symfony/polyfill-uuid": "^1.13.1"
44+
"symfony/phpunit-bridge": "^7.3.2 || ^8.0",
45+
"symfony/polyfill-uuid": "^1.13.1",
46+
"symfony/runtime": "^7.3.2 || ^8.0"
4447
},
4548
"conflict": {
46-
"phpunit/phpunit": ">=10",
4749
"symfony/http-client": "5.2.0"
4850
},
4951
"autoload": {
@@ -156,7 +158,8 @@
156158
},
157159
"config": {
158160
"allow-plugins": {
159-
"ergebnis/composer-normalize": true
161+
"ergebnis/composer-normalize": true,
162+
"symfony/runtime": false
160163
}
161164
}
162165
}

phpunit.xml.dist

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
44
backupGlobals="false"
55
colors="true"
66
bootstrap="vendor/autoload.php"
77
failOnRisky="true"
88
failOnWarning="true"
9+
failOnDeprecation="true"
10+
failOnNotice="true"
911
>
12+
<source ignoreSuppressionOfDeprecations="true" ignoreIndirectDeprecations="true">
13+
<include>
14+
<directory>./src</directory>
15+
</include>
16+
<exclude>
17+
<directory>./src/Core/tests/</directory>
18+
<directory>./src/Service/*/tests/</directory>
19+
<directory>./src/Integration/*/tests/</directory>
20+
<directory>./src/Integration/*/*/tests/</directory>
21+
</exclude>
22+
<deprecationTrigger>
23+
<function>trigger_deprecation</function>
24+
</deprecationTrigger>
25+
</source>
1026
<php>
1127
<ini name="error_reporting" value="-1"/>
1228
<env name="AWS_SHARED_CREDENTIALS_FILE" value="/dev/null" />
1329
<env name="AWS_CONFIG_FILE" value="/dev/null" />
14-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;quiet[]=indirect" />
1530
</php>
1631
<testsuites>
1732
<testsuite name="Test Suite">

psalm.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
</ignoreFiles>
2323
</projectFiles>
2424

25-
<extraFiles>
26-
<directory name="vendor/bin/.phpunit" />
27-
</extraFiles>
28-
2925
<issueHandlers>
3026
<LessSpecificReturnType errorLevel="info" />
3127

src/CodeGenerator/.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828
- name: Download dependencies
2929
run: |
3030
composer config minimum-stability dev
31-
composer req symfony/phpunit-bridge --no-update
3231
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
3332
3433
- name: Run tests
35-
run: ./vendor/bin/simple-phpunit
34+
run: ./vendor/bin/phpunit

src/CodeGenerator/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
2020
"symfony/service-contracts": "^2.0 || ^3.0"
2121
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^11.5.42",
24+
"symfony/error-handler": "^7.3.2 || ^8.0",
25+
"symfony/phpunit-bridge": "^7.3.2 || ^8.0"
26+
},
2227
"autoload": {
2328
"psr-4": {
2429
"AsyncAws\\CodeGenerator\\": "src"

src/Core/.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ jobs:
3131
- name: Download dependencies
3232
run: |
3333
composer config minimum-stability dev
34-
composer req symfony/phpunit-bridge --no-update
3534
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
3635
3736
- name: Run tests
38-
run: ./vendor/bin/simple-phpunit
37+
run: ./vendor/bin/phpunit

src/Core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ start-docker-s3:
1414
docker run -d -p 4569:4569 -p 4570:4569 --name async_aws_s3 asyncaws/testing-s3
1515

1616
test: initialize
17-
./vendor/bin/simple-phpunit
17+
./vendor/bin/phpunit
1818

1919
clean: stop-docker
2020
stop-docker:

0 commit comments

Comments
 (0)