Skip to content
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

Silenced E_DEPRECATED errors are reported #5176

Closed
kukulich opened this issue Feb 6, 2023 · 2 comments
Closed

Silenced E_DEPRECATED errors are reported #5176

kukulich opened this issue Feb 6, 2023 · 2 comments
Assignees
Labels
feature/test-runner CLI test runner type/bug Something is broken version/10 Something affects PHPUnit 10

Comments

@kukulich
Copy link
Contributor

kukulich commented Feb 6, 2023

Q A
PHPUnit version 10.0.4
PHP version 8.2.2
Installation Method Composer

Summary

Silenced deprecated errors are reported.

Current behavior

In BetterReflection is this code:

// @ because access to deprecated constant throws deprecated warning
$constantValue           = @constant($constantName);

Since PHPUnit 10 the deprecated errors are reported:

....................DDD.DDDD.DDD.DD.DDD.DD.DDDDDDDDDDDD.DDD 10030 / 13001 ( 77%)
.DDDDDDDDDDDD.DDDDDDDDDD..DD.DD.DDDDD.DDDDDD.DDDD.DDDDDDDDD 10089 / 13001 ( 77%)
DDDDDDDDDD..DDD.DDD.D..DDDDDDD.DDDDDDDDD..DDD.DD.D...DD.DDD 10148 / 13001 ( 78%)
DDD.DDDDDDDD.DD.DDDDDDDDDDD.DDDDDDD.DDDDD.DD.DDDD.DDDDDD..D 10207 / 13001 ( 78%)
Tests: 13001, Assertions: 73217, Deprecations: 398, Skipped: 5.

See https://github.com/Roave/BetterReflection/actions/runs/4107910137/jobs/7087976443

With --display-deprecations

304) Roave\BetterReflectionTest\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest::testConstantInPhpVersion with data set #4
* Constant FILTER_SANITIZE_STRING is deprecated

* Constant FILTER_SANITIZE_STRIPPED is deprecated

better-reflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:950

305) Roave\BetterReflectionTest\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest::testConstantInPhpVersion with data set #2
* Constant FILTER_SANITIZE_STRING is deprecated

* Constant FILTER_SANITIZE_STRIPPED is deprecated

better-reflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:950

306) Roave\BetterReflectionTest\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest::testConstantInPhpVersion with data set #3
* Constant FILTER_SANITIZE_STRING is deprecated

* Constant FILTER_SANITIZE_STRIPPED is deprecated

better-reflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:950

It also looks the same error is reported many times.

How to reproduce

Roave/BetterReflection#1326

Eg.

vendor\bin\phpunit test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php --display-deprecations

Expected behavior

No D in progressbar and no deprecations reported.

@kukulich kukulich added the type/bug Something is broken label Feb 6, 2023
@sebastianbergmann sebastianbergmann added feature/test-runner CLI test runner version/10 Something affects PHPUnit 10 labels Feb 7, 2023
@sebastianbergmann sebastianbergmann changed the title Silenced deprecated errors are reported Silenced E_DEPRECATED errors are reported Feb 7, 2023
@sebastianbergmann sebastianbergmann self-assigned this Feb 7, 2023
@sebastianbergmann
Copy link
Owner

@kukulich Thank you for reporting this! What do you think about #5177?

@kukulich
Copy link
Contributor Author

kukulich commented Feb 8, 2023

Thank you for the quick fix! #5177 may be useful - however I don't currently see any use-case for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/bug Something is broken version/10 Something affects PHPUnit 10
Projects
None yet
Development

No branches or pull requests

2 participants