Skip to content

Commit b5cba0a

Browse files
authored
ci: patch phpunit deprecations inside component (#7103)
1 parent 108d92d commit b5cba0a

37 files changed

+190
-145
lines changed

.github/patches/phpunit.patch

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

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,14 @@ jobs:
264264
continue-on-error: true
265265

266266
phpunit-components:
267-
name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.deprecations && 'no deprecations' || '' }})
267+
name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}${{ matrix.php.deprecations && 'no deprecations' || '' }})
268268
runs-on: ubuntu-latest
269269
timeout-minutes: 20
270270
strategy:
271271
matrix:
272272
php:
273273
- version: '8.2'
274274
- version: '8.3'
275-
- version: '8.4'
276275
- version: '8.4'
277276
coverage: true
278277
- version: '8.4'
@@ -305,18 +304,19 @@ jobs:
305304
tools: pecl, composer
306305
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
307306
ini-values: memory_limit=-1
308-
- name: Allow unstable project dependencies
309-
if: matrix.php.deprecations == true
310-
run: composer config minimum-stability dev
311-
- name: Run ${{ matrix.component }} install
307+
- name: Linking
312308
run: |
313309
composer global require soyuka/pmu
314310
composer global config allow-plugins.soyuka/pmu true --no-interaction
315311
composer global link . --permanent
316-
composer ${{matrix.component}} update
317-
- name: Patch phpunit
312+
- name: Allow unstable project dependencies
318313
if: matrix.php.deprecations == true
319-
run: git apply --directory vendor/phpunit/phpunit .github/patches/phpunit.patch
314+
run: |
315+
cd $(composer ${{matrix.component}} --cwd)
316+
composer config minimum-stability dev
317+
- name: Run ${{ matrix.component }} install
318+
run: |
319+
composer ${{matrix.component}} update
320320
- name: Run ${{ matrix.component }} tests
321321
run: |
322322
mkdir -p /tmp/build/logs/phpunit
@@ -867,8 +867,6 @@ jobs:
867867
composer global link .
868868
- name: Clear test app cache
869869
run: tests/Fixtures/app/console cache:clear --ansi
870-
- name: Patch phpunit
871-
run: git apply --directory vendor/phpunit/phpunit .github/patches/phpunit.patch
872870
- name: Run PHPUnit tests
873871
run: vendor/bin/phpunit --fail-on-deprecation --display-deprecations
874872

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@
150150
"phpstan/phpstan-doctrine": "^1.0",
151151
"phpstan/phpstan-phpunit": "^1.0",
152152
"phpstan/phpstan-symfony": "^1.0",
153-
"phpunit/phpunit": "^11.2",
153+
"phpunit/phpunit": "11.5.x-dev",
154154
"psr/log": "^1.0 || ^2.0 || ^3.0",
155155
"ramsey/uuid": "^4.7",
156156
"ramsey/uuid-doctrine": "^2.0",
157157
"soyuka/contexts": "^3.3.10",
158-
"soyuka/pmu": "^0.0.15",
158+
"soyuka/pmu": "^0.1.0",
159159
"soyuka/stubs-mongodb": "^1.0",
160160
"symfony/asset": "^6.4 || ^7.0",
161161
"symfony/browser-kit": "^6.4 || ^7.0",
@@ -208,5 +208,9 @@
208208
"symfony/web-profiler-bundle": "To use the data collector.",
209209
"webonyx/graphql-php": "To support GraphQL."
210210
},
211-
"type": "library"
211+
"type": "library",
212+
"repositories": [
213+
{"type": "vcs", "url": "https://github.com/soyuka/phpunit"}
214+
],
215+
"minimum-stability": "dev"
212216
}

src/Doctrine/Common/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"doctrine/mongodb-odm": "^2.10",
3535
"doctrine/orm": "^2.17 || ^3.0",
3636
"phpspec/prophecy-phpunit": "^2.2",
37-
"phpunit/phpunit": "^11.2"
37+
"phpunit/phpunit": "11.5.x-dev"
3838
},
3939
"conflict": {
4040
"doctrine/persistence": "<1.3"
@@ -73,5 +73,11 @@
7373
},
7474
"scripts": {
7575
"test": "./vendor/bin/phpunit"
76-
}
76+
},
77+
"repositories": [
78+
{
79+
"type": "vcs",
80+
"url": "https://github.com/soyuka/phpunit"
81+
}
82+
]
7783
}

src/Doctrine/Odm/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"doctrine/doctrine-bundle": "^2.11",
3636
"doctrine/mongodb-odm-bundle": "^5.0",
3737
"phpspec/prophecy-phpunit": "^2.2",
38-
"phpunit/phpunit": "^11.2",
38+
"phpunit/phpunit": "11.5.x-dev",
3939
"symfony/cache": "^6.4 || ^7.0",
4040
"symfony/framework-bundle": "^6.4 || ^7.0",
4141
"symfony/property-access": "^6.4 || ^7.0",
@@ -73,5 +73,11 @@
7373
},
7474
"scripts": {
7575
"test": "./vendor/bin/phpunit"
76-
}
76+
},
77+
"repositories": [
78+
{
79+
"type": "vcs",
80+
"url": "https://github.com/soyuka/phpunit"
81+
}
82+
]
7783
}

src/Doctrine/Orm/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"require-dev": {
3434
"doctrine/doctrine-bundle": "^2.11",
3535
"phpspec/prophecy-phpunit": "^2.2",
36-
"phpunit/phpunit": "^11.2",
36+
"phpunit/phpunit": "11.5.x-dev",
3737
"ramsey/uuid": "^4.7",
3838
"ramsey/uuid-doctrine": "^2.0",
3939
"symfony/cache": "^6.4 || ^7.0",
@@ -73,5 +73,11 @@
7373
},
7474
"scripts": {
7575
"test": "./vendor/bin/phpunit"
76-
}
76+
},
77+
"repositories": [
78+
{
79+
"type": "vcs",
80+
"url": "https://github.com/soyuka/phpunit"
81+
}
82+
]
7783
}

src/Documentation/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
}
3838
},
3939
"require-dev": {
40-
"phpunit/phpunit": "^11.2"
41-
}
40+
"phpunit/phpunit": "11.5.x-dev"
41+
},
42+
"repositories": [
43+
{
44+
"type": "vcs",
45+
"url": "https://github.com/soyuka/phpunit"
46+
}
47+
]
4248
}

src/Elasticsearch/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"require-dev": {
3939
"phpspec/prophecy-phpunit": "^2.2",
40-
"phpunit/phpunit": "^11.2"
40+
"phpunit/phpunit": "11.5.x-dev"
4141
},
4242
"autoload": {
4343
"psr-4": {
@@ -73,5 +73,11 @@
7373
},
7474
"scripts": {
7575
"test": "./vendor/bin/phpunit"
76-
}
76+
},
77+
"repositories": [
78+
{
79+
"type": "vcs",
80+
"url": "https://github.com/soyuka/phpunit"
81+
}
82+
]
7783
}

src/Elasticsearch/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<directory>./Tests/</directory>
99
</testsuite>
1010
</testsuites>
11-
<source>
11+
<source ignoreSuppressionOfDeprecations="true" ignoreIndirectDeprecations="false" >
1212
<deprecationTrigger>
1313
<function>trigger_deprecation</function>
1414
</deprecationTrigger>

src/GraphQl/composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
3636
"symfony/mercure-bundle": "*",
3737
"symfony/routing": "^6.4 || ^7.0",
38-
"phpunit/phpunit": "^11.2"
38+
"phpunit/phpunit": "11.5.x-dev"
3939
},
4040
"autoload": {
4141
"psr-4": {
@@ -76,5 +76,11 @@
7676
},
7777
"scripts": {
7878
"test": "./vendor/bin/phpunit"
79-
}
79+
},
80+
"repositories": [
81+
{
82+
"type": "vcs",
83+
"url": "https://github.com/soyuka/phpunit"
84+
}
85+
]
8086
}

0 commit comments

Comments
 (0)