Skip to content

Fix up bonkers PHPUnit deprecation handling. #18378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 23, 2025
Merged

Fix up bonkers PHPUnit deprecation handling. #18378

merged 8 commits into from
Apr 23, 2025

Conversation

dereuromark
Copy link
Member

Testing if this works to make them displayed by default.

For me it was:

2 tests triggered 2 deprecations:

1) /app/vendor/cakephp/cakephp/src/Core/functions.php:373
Since 5.2.0: You cannot redefine short options. This will throw an error in 5.3.0+.
/app/vendor/cakephp/cakephp/tests/TestCase/Console/ConsoleOptionParserTest.php, line: 108
You can disable all deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED`. Adding `tests/TestCase/Console/ConsoleOptionParserTest.php` to `Error.ignoredDeprecationPaths` in your `config/app.php` config will mute deprecations from that file only.

Triggered by:

* Cake\Test\TestCase\Console\ConsoleOptionParserTest::testRemoveOptionAlsoClearsShort
  /app/vendor/cakephp/cakephp/tests/TestCase/Console/ConsoleOptionParserTest.php:102

2) /app/vendor/cakephp/cakephp/src/Core/functions.php:373
Since 5.2.0: You cannot redefine short options. This will throw an error in 5.3.0+.
/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php, line: 517
You can disable all deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED`. Adding `src/Console/ConsoleOptionParser.php` to `Error.ignoredDeprecationPaths` in your `config/app.php` config will mute deprecations from that file only.

Triggered by:

* Cake\Test\TestCase\Console\ConsoleOptionParserTest::testMerge
  /app/vendor/cakephp/cakephp/tests/TestCase/Console/ConsoleOptionParserTest.php:1036

@dereuromark dereuromark marked this pull request as ready for review April 23, 2025 12:53
@ADmad ADmad added the needs squashing The pull request should be squashed before merging label Apr 23, 2025
@dereuromark dereuromark requested a review from markstory April 23, 2025 13:30
@dereuromark
Copy link
Member Author

I made it configurable, so we dont cause any issues.
You can easily disable it where needed, even though I can imagine that everyone at least wants to have control over it now that PHPUnit is leaving us out to dry.

@markstory markstory merged commit 9b973bb into 5.x Apr 23, 2025
12 of 13 checks passed
@markstory markstory deleted the 5.x-deprecations branch April 23, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations needs squashing The pull request should be squashed before merging testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants