Skip to content

Commit 9ee5a2d

Browse files
Merge branch '7.4' into 8.0
* 7.4: run tests using PHPUnit 11.5 make data provider static [Lock] Fix using fractional TTLs on all platforms [Lock] Fixes an issue with PostgreSQL when using fractional TTLs [Console][Table] Fix unnecessary wrapping [DependencyInjection] Deprecate registering a service without a class when its id is a non-existing FQCN disable detecting modified indexes with DBAL 4.3 [cache] RedisTrait::doFetch should use pipeline instead of mget for Relay\Cluster relax assertions for forward compatibility with Symfony 7.4 [Console][Table] Fix invalid UTF-8 due to text wrapping
2 parents 03f9d5d + 53e759a commit 9ee5a2d

File tree

269 files changed

+2460
-1589
lines changed

Some content is hidden

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

269 files changed

+2460
-1589
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
git diff --exit-code src/ || (echo '::error::Run "php .github/sync-translations.php" to fix XLIFF files.' && exit 1)
253253
254254
- name: Run tests
255-
run: ./phpunit --group integration -v
255+
run: ./phpunit --group integration
256256
env:
257257
INTEGRATION_FTP_URL: 'ftp://test:test@localhost'
258258
REDIS_HOST: 'localhost:16379'

.github/workflows/psalm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
export COMPOSER_ROOT_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+').x-dev
4545
export COMPOSER_ROOT_VERSION=7.4.x-dev # to be removed once deps allow ^8.0
4646
composer remove --dev --no-update --no-interaction symfony/phpunit-bridge
47-
composer require --no-progress --ansi --no-plugins psalm/phar:@stable phpunit/phpunit:^9.6 php-http/discovery psr/event-dispatcher mongodb/mongodb jetbrains/phpstorm-stubs
47+
composer require --no-progress --ansi --no-plugins psalm/phar:@stable phpunit/phpunit:^11.5 php-http/discovery psr/event-dispatcher mongodb/mongodb jetbrains/phpstorm-stubs
4848
4949
- name: Generate Psalm baseline
5050
run: |

.github/workflows/unit-tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
7474
7575
echo COLUMNS=120 >> $GITHUB_ENV
76-
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data,integration,transient" >> $GITHUB_ENV
76+
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group integration --exclude-group transient" >> $GITHUB_ENV
7777
echo COMPOSER_UP='composer update --no-progress --ansi'$([[ "${{ matrix.mode }}" != low-deps ]] && echo ' --ignore-platform-req=php+') >> $GITHUB_ENV
7878
7979
SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
@@ -129,7 +129,7 @@ jobs:
129129
fi
130130
131131
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
132-
[[ "${{ matrix.mode }}" = high-deps && $SYMFONY_VERSION = *.4 ]] && echo LEGACY=,legacy >> $GITHUB_ENV || true
132+
[[ "${{ matrix.mode }}" = high-deps && $SYMFONY_VERSION = *.4 ]] && echo LEGACY=" --exclude-group legacy" >> $GITHUB_ENV || true
133133
134134
echo SYMFONY_VERSION=$SYMFONY_VERSION >> $GITHUB_ENV
135135
echo COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev >> $GITHUB_ENV
@@ -186,13 +186,13 @@ jobs:
186186
fi
187187
188188
if [[ "${{ matrix.mode }}" = low-deps ]]; then
189-
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT'"
189+
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT --do-not-fail-on-deprecation'"
190190
191191
exit 0
192192
fi
193193
194194
# matrix.mode = high-deps
195-
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
195+
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP && $PHPUNIT$LEGACY --do-not-fail-on-deprecation'" || X=1
196196
197197
# get a list of the patched components (relies on .github/build-packages.php being called in the previous step)
198198
PATCHED_COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
@@ -212,7 +212,7 @@ jobs:
212212
echo "::group::install phpunit"
213213
./phpunit install
214214
echo "::endgroup::"
215-
echo "$PATCHED_COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
215+
echo "$PATCHED_COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT --exclude-group tty,benchmark,intl-data,integration,transient,legacy'" || X=1
216216
fi
217217
fi
218218
@@ -240,12 +240,12 @@ jobs:
240240
241241
mkdir -p /opt/php/lib
242242
echo memory_limit=-1 > /opt/php/lib/php.ini
243-
./build/php/bin/php ./phpunit --colors=always src/Symfony/Component/Process
243+
./phpunit install
244+
./build/php/bin/php ./phpunit src/Symfony/Component/Process
244245
245-
- name: Run PhpUnitBridge tests with PHPUnit 11
246+
- name: Run PhpUnitBridge tests with PHPUnit 9.6
246247
if: '! matrix.mode'
247248
run: |
248249
./phpunit src/Symfony/Bridge/PhpUnit
249250
env:
250-
SYMFONY_PHPUNIT_VERSION: '11.3'
251-
SYMFONY_DEPRECATIONS_HELPER: 'disabled'
251+
SYMFONY_PHPUNIT_VERSION: '9.6'

.github/workflows/windows.yml

Lines changed: 102 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
windows:
15+
windows-minimal-exts:
1616
name: x86 / minimal-exts / lowest-php
1717

1818
defaults:
@@ -23,7 +23,83 @@ jobs:
2323

2424
env:
2525
COMPOSER_NO_INTERACTION: '1'
26-
SYMFONY_DEPRECATIONS_HELPER: 'strict'
26+
ANSICON: '121x90 (121x90)'
27+
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: '1'
28+
29+
steps:
30+
- name: Setup Git
31+
run: |
32+
git config --global core.autocrlf false
33+
git config --global user.email ""
34+
git config --global user.name "Symfony"
35+
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 2
40+
41+
- name: Setup PHP
42+
run: |
43+
$env:Path = 'c:\php;' + $env:Path
44+
mkdir c:\php && cd c:\php
45+
iwr -outf php.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php-8.2.0-Win32-vs16-x86.zip
46+
7z x php.zip -y >nul
47+
Copy php.ini-development php.ini
48+
"memory_limit=-1" >> php.ini
49+
"serialize_precision=-1" >> php.ini
50+
"max_execution_time=1200" >> php.ini
51+
"post_max_size=2047M" >> php.ini
52+
"upload_max_filesize=2047M" >> php.ini
53+
"date.timezone=`"America/Los_Angeles`"" >> php.ini
54+
"extension_dir=ext" >> php.ini
55+
"extension=php_xsl.dll" >> php.ini
56+
"extension=php_mbstring.dll" >> php.ini
57+
"extension=php_openssl.dll" >> php.ini
58+
cd ${{ github.workspace }}
59+
iwr -outf composer.phar https://getcomposer.org/download/latest-stable/composer.phar
60+
61+
- name: Install dependencies
62+
id: setup
63+
run: |
64+
$env:Path = 'c:\php;' + $env:Path
65+
mkdir $env:APPDATA\Composer && Copy .github\composer-config.json $env:APPDATA\Composer\config.json
66+
67+
$env:SYMFONY_VERSION=(Select-String -CaseSensitive -Pattern " VERSION =" -SimpleMatch -Path src/Symfony/Component/HttpKernel/Kernel.php | Select Line | Select-String -Pattern "([0-9][0-9]*\.[0-9])").Matches.Value
68+
$env:COMPOSER_ROOT_VERSION=$env:SYMFONY_VERSION + ".x-dev"
69+
70+
php .github/build-packages.php HEAD^ $env:SYMFONY_VERSION src\Symfony\Bridge\PhpUnit
71+
php composer.phar update --no-progress --ansi
72+
73+
- name: Install PHPUnit
74+
run: |
75+
$env:Path = 'c:\php;' + $env:Path
76+
77+
php phpunit install
78+
79+
- name: Run tests
80+
run: |
81+
$env:Path = 'c:\php;' + $env:Path
82+
$x = 0
83+
84+
Remove-Item -Path src\Symfony\Bridge\PhpUnit -Recurse
85+
mv src\Symfony\Component\HttpClient\phpunit.xml.dist src\Symfony\Component\HttpClient\phpunit.xml
86+
php phpunit src\Symfony --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group network --exclude-group transient-on-windows || ($x = 1)
87+
# HttpClient tests need to run separately, they block when run with other components' tests concurrently
88+
php phpunit src\Symfony\Component\HttpClient || ($x = 1)
89+
90+
exit $x
91+
92+
windows-all-extensions:
93+
name: x86 / all extensions / lowest-php
94+
95+
defaults:
96+
run:
97+
shell: pwsh
98+
99+
runs-on: windows-2022
100+
101+
env:
102+
COMPOSER_NO_INTERACTION: '1'
27103
ANSICON: '121x90 (121x90)'
28104
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: '1'
29105

@@ -53,30 +129,28 @@ jobs:
53129
iwr -outf php_redis.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_redis-6.2.0-8.4-ts-vs17-x86.zip
54130
7z x php_redis.zip -y >nul
55131
cd ..
56-
Copy php.ini-development php.ini-min
57-
"memory_limit=-1" >> php.ini-min
58-
"serialize_precision=-1" >> php.ini-min
59-
"max_execution_time=1200" >> php.ini-min
60-
"post_max_size=2047M" >> php.ini-min
61-
"upload_max_filesize=2047M" >> php.ini-min
62-
"date.timezone=`"America/Los_Angeles`"" >> php.ini-min
63-
"extension_dir=ext" >> php.ini-min
64-
"extension=php_xsl.dll" >> php.ini-min
65-
"extension=php_mbstring.dll" >> php.ini-min
66-
Copy php.ini-min php.ini-max
67-
"zend_extension=php_opcache.dll" >> php.ini-max
68-
"opcache.enable_cli=1" >> php.ini-max
69-
"extension=php_openssl.dll" >> php.ini-max
70-
"extension=php_apcu.dll" >> php.ini-max
71-
"extension=php_igbinary.dll" >> php.ini-max
72-
"extension=php_redis.dll" >> php.ini-max
73-
"apc.enable_cli=1" >> php.ini-max
74-
"extension=php_intl.dll" >> php.ini-max
75-
"extension=php_fileinfo.dll" >> php.ini-max
76-
"extension=php_pdo_sqlite.dll" >> php.ini-max
77-
"extension=php_curl.dll" >> php.ini-max
78-
"extension=php_sodium.dll" >> php.ini-max
79-
Copy php.ini-max php.ini
132+
Copy php.ini-development php.ini
133+
"memory_limit=-1" >> php.ini
134+
"serialize_precision=-1" >> php.ini
135+
"max_execution_time=1200" >> php.ini
136+
"post_max_size=2047M" >> php.ini
137+
"upload_max_filesize=2047M" >> php.ini
138+
"date.timezone=`"America/Los_Angeles`"" >> php.ini
139+
"extension_dir=ext" >> php.ini
140+
"extension=php_xsl.dll" >> php.ini
141+
"extension=php_mbstring.dll" >> php.ini
142+
"zend_extension=php_opcache.dll" >> php.ini
143+
"opcache.enable_cli=1" >> php.ini
144+
"extension=php_openssl.dll" >> php.ini
145+
"extension=php_apcu.dll" >> php.ini
146+
"extension=php_igbinary.dll" >> php.ini
147+
"extension=php_redis.dll" >> php.ini
148+
"apc.enable_cli=1" >> php.ini
149+
"extension=php_intl.dll" >> php.ini
150+
"extension=php_fileinfo.dll" >> php.ini
151+
"extension=php_pdo_sqlite.dll" >> php.ini
152+
"extension=php_curl.dll" >> php.ini
153+
"extension=php_sodium.dll" >> php.ini
80154
cd ${{ github.workspace }}
81155
iwr -outf composer.phar https://getcomposer.org/download/latest-stable/composer.phar
82156
@@ -103,32 +177,13 @@ jobs:
103177
run: |
104178
choco install --no-progress memurai-developer
105179
106-
- name: Run tests (minimal extensions)
107-
if: always() && steps.setup.outcome == 'success'
108-
run: |
109-
$env:Path = 'c:\php;' + $env:Path
110-
$env:SYMFONY_PHPUNIT_SKIPPED_TESTS = 'phpunit.skipped'
111-
$x = 0
112-
113-
Copy c:\php\php.ini-min c:\php\php.ini
114-
Remove-Item -Path src\Symfony\Bridge\PhpUnit -Recurse
115-
mv src\Symfony\Component\HttpClient\phpunit.xml.dist src\Symfony\Component\HttpClient\phpunit.xml
116-
php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || ($x = 1)
117-
# HttpClient tests need to run separately, they block when run with other components' tests concurrently
118-
php phpunit src\Symfony\Component\HttpClient || ($x = 1)
119-
120-
exit $x
121-
122180
- name: Run tests
123-
if: always() && steps.setup.outcome == 'success'
124181
run: |
125182
$env:Path = 'c:\php;' + $env:Path
126-
$env:SYMFONY_PHPUNIT_SKIPPED_TESTS = 'phpunit.skipped'
127183
$x = 0
128184
129-
Copy c:\php\php.ini-max c:\php\php.ini
130-
php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || ($x = 1)
185+
php phpunit src\Symfony --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group network --exclude-group transient-on-windows --requires-php-extension apcu --requires-php-extension curl --requires-php-extension fileinfo --requires-php-extension igbinary --requires-php-extension intl --requires-php-extension openssl --requires-php-extension pdo_sqlite --requires-php-extension redis --requires-php-extension sodium || ($x = 1)
131186
# HttpClient tests need to run separately, they block when run with other components' tests concurrently
132-
php phpunit src\Symfony\Component\HttpClient || ($x = 1)
187+
php phpunit src\Symfony\Component\HttpClient --requires-php-extension curl --requires-php-extension openssl || ($x = 1)
133188
134189
exit $x

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ composer.lock
33
phpunit.xml
44
.php-cs-fixer.cache
55
.php-cs-fixer.php
6+
.phpunit.cache
67
.phpunit.result.cache
78
composer.phar
89
package.tar

UPGRADE-7.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ DependencyInjection
2222
-------------------
2323

2424
* Add argument `$target` to `ContainerBuilder::registerAliasForArgument()`
25+
* Deprecate registering a service without a class when its id is a non-existing FQCN
2526

2627
DoctrineBridge
2728
--------------

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
66
exit(1);
77
}
88
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
9-
putenv('SYMFONY_PHPUNIT_VERSION=9.6');
9+
putenv('SYMFONY_PHPUNIT_VERSION=11.5');
1010
}
1111
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
1212
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');

phpunit.xml.dist

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"
8+
failOnDeprecation="true"
89
failOnRisky="true"
910
failOnWarning="true"
1011
>
@@ -46,7 +47,7 @@
4647
</exclude>
4748
</groups>
4849

49-
<coverage>
50+
<source ignoreSuppressionOfDeprecations="true">
5051
<include>
5152
<directory>./src/Symfony/</directory>
5253
</include>
@@ -65,28 +66,11 @@
6566
<directory>./src/Symfony/Component/*/*/vendor</directory>
6667
<directory>./src/Symfony/Contracts/*/vendor</directory>
6768
</exclude>
68-
</coverage>
69+
</source>
6970

70-
<listeners>
71-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
72-
<arguments>
73-
<array>
74-
<element key="time-sensitive">
75-
<array>
76-
<element key="0"><string>Cache\IntegrationTests</string></element>
77-
<element key="1"><string>Symfony\Bridge\Doctrine\Middleware\Debug</string></element>
78-
<element key="2"><string>Symfony\Bridge\Doctrine\Middleware\IdleConnection</string></element>
79-
<element key="3"><string>Symfony\Component\Cache</string></element>
80-
<element key="4"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
81-
<element key="5"><string>Symfony\Component\Cache\Tests\Traits</string></element>
82-
<element key="6"><string>Symfony\Component\Cache\Traits</string></element>
83-
<element key="7"><string>Symfony\Component\Console</string></element>
84-
<element key="8"><string>Symfony\Component\HttpFoundation</string></element>
85-
<element key="9"><string>Symfony\Component\Uid</string></element>
86-
</array>
87-
</element>
88-
</array>
89-
</arguments>
90-
</listener>
91-
</listeners>
71+
<extensions>
72+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension">
73+
<parameter name="clock-mock-namespaces" value="Cache\IntegrationTests,Symfony\Bridge\Doctrine\Middleware\Debug,Symfony\Bridge\Doctrine\Middleware\IdleConnection,Symfony\Component\Cache,Symfony\Component\Cache\Tests\Fixtures,Symfony\Component\Cache\Tests\Traits,Symfony\Component\Cache\Traits,Symfony\Component\Console,Symfony\Component\HttpFoundation,Symfony\Component\Uid" />
74+
</bootstrap>
75+
</extensions>
9276
</phpunit>

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Doctrine\ORM\EntityManager;
2020
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
2121
use Doctrine\ORM\ORMSetup;
22+
use PHPUnit\Framework\Attributes\DataProvider;
2223
use PHPUnit\Framework\TestCase;
2324
use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor;
2425
use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy;
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"
8+
failOnDeprecation="true"
89
failOnRisky="true"
910
failOnWarning="true"
1011
>
@@ -18,7 +19,7 @@
1819
</testsuite>
1920
</testsuites>
2021

21-
<coverage>
22+
<source ignoreSuppressionOfDeprecations="true">
2223
<include>
2324
<directory>./</directory>
2425
</include>
@@ -27,20 +28,11 @@
2728
<directory>./Tests</directory>
2829
<directory>./vendor</directory>
2930
</exclude>
30-
</coverage>
31+
</source>
3132

32-
<listeners>
33-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
34-
<arguments>
35-
<array>
36-
<element key="time-sensitive">
37-
<array>
38-
<element key="0"><string>Symfony\Bridge\Doctrine\Middleware\Debug</string></element>
39-
<element key="1"><string>Symfony\Bridge\Doctrine\Middleware\IdleConnection</string></element>
40-
</array>
41-
</element>
42-
</array>
43-
</arguments>
44-
</listener>
45-
</listeners>
33+
<extensions>
34+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension">
35+
<parameter name="clock-mock-namespaces" value="Symfony\Bridge\Doctrine\Middleware\Debug,Symfony\Bridge\Doctrine\Middleware\IdleConnection" />
36+
</bootstrap>
37+
</extensions>
4638
</phpunit>

0 commit comments

Comments
 (0)