-
Notifications
You must be signed in to change notification settings - Fork 131
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
Fix php version dependent constant deprecation #1408
Conversation
I am afk. Will fix it later today |
\define('FILTER_SANITIZE_STRING', 513); | ||
EOT; | ||
$stubData = new StubData($exampleStub, 'filter'); | ||
$stubData = $this->sourceStubber->generateConstantStub('MT_RAND_PHP'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using a real constant now. using faked data the test did not cover reality
@@ -664,14 +679,14 @@ private function isCoreExtension(string $extension): bool | |||
return in_array($extension, self::CORE_EXTENSIONS, true); | |||
} | |||
|
|||
private function isDeprecatedByPhpDocInPhpVersion(Node\Stmt\Const_ $node): bool | |||
private function isDeprecatedByPhpDocInPhpVersion(Node\Expr\FuncCall $node): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in phpstorm stubs we use define('x', 1)
and not const $x=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the infection report looks:
-4164 mutations were generated:
+4170 mutations were generated:
- 3315 mutants were killed
+ 3333 mutants were killed
0 mutants were configured to be ignored
- 14 mutants were not covered by tests
+ 2 mutants were not covered by tests
10 covered mutants were not detected
- 7 errors were encountered
+ 6 errors were encountered
0 syntax errors were encountered
14 time outs were encountered
- 804 mutants required more time than configured
+ 805 mutants required more time than configured
Thanks @staabm! |
the previous test was running against PHP 8.1, which we don't run in CI.
thats the reason why it did not catch the implementation bug