Skip to content

Show deprecations on phpunit#1047

Merged
erikn69 merged 3 commits intoowen-it:masterfrom
erikn69:tests
Mar 27, 2026
Merged

Show deprecations on phpunit#1047
erikn69 merged 3 commits intoowen-it:masterfrom
erikn69:tests

Conversation

@erikn69
Copy link
Copy Markdown
Contributor

@erikn69 erikn69 commented Mar 23, 2026

@willpower232 I thought about failOnDeprecation, but that would imply that the vendor's deprecation would also cause fails. Example: Laravel 11 with PHP 8.5 tests

But at least we can display deprecations messages to decide how to proceed

What do you think about it?

@willpower232
Copy link
Copy Markdown
Contributor

This is what I mean, those extra settings don't seem to detect the deprecated code unless I'm looking at code which isn't covered by tests 😅

image

I also don't know what you mean about deprecations for PHP 8.5 + laravel 11, that also passes tests without any warnings 😅

@erikn69
Copy link
Copy Markdown
Contributor Author

erikn69 commented Mar 26, 2026

I'm looking at code which isn't covered by tests 😅

Because you're using PHP 8.4; if you were using PHP 8.5 you would see it.

I also don't know what you mean about deprecations for PHP 8.5 + laravel 11, that also passes tests without any warnings

With these configurations, it did show me the Laravel 11 warnings, but you should run the tests in PHP 8.5.

https://github.com/erikn69/laravel-auditing/actions/runs/23449357439/job/68221914863

1) /laravel-auditing/vendor/orchestra/testbench-core/laravel/config/database.php:61
Constant PDO::MYSQL_ATTR_SSL_CA is deprecated since 8.5, use Pdo\Mysql::ATTR_SSL_CA instead

And Laravel 11 reached its end of life before PHP 8.5 testing Laravel 11.x test
https://laravel.com/docs/13.x/releases
image

@willpower232
Copy link
Copy Markdown
Contributor

You'll see the functions have a line through in my screenshot indicating they are deprecated but that is weird as I'm not running PHP 8.5 locally. Thanks vscode I guess 😅

Its also interesting that https://github.com/erikn69/laravel-auditing/actions/runs/23449357439/job/68221914863 is running phpunit 12 but thats not in composer.json 🤔

Either way, I'll take the github actions fail over whatever garbage my computer is doing 🙏

@erikn69
Copy link
Copy Markdown
Contributor Author

erikn69 commented Mar 27, 2026

is running phpunit 12 but thats not in composer.json

"phpunit/phpunit": "^11.0|^12.5.12"

@erikn69 erikn69 merged commit 6a55a4c into owen-it:master Mar 27, 2026
11 checks passed
@erikn69 erikn69 deleted the tests branch March 27, 2026 13:21
@willpower232
Copy link
Copy Markdown
Contributor

oh of course I was using an older version for those deprecated functions 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants