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
Rule php_unit_dedicate_assert
should not use assertInternalType
anymore.
#6179
Comments
Thanks for the report! Looks like we have a new feature of I believe it's a quirk that you checked the resources was open, to be honest. Looks like you check the side effect |
actually we have that rule already: |
Hi Darius, Actually I was testing if the resource was still open or not, this is why I why using: self::assertTrue(is_resource($file)); For the rest of your questions, I'll get back to you as soon as possible. |
@keradus both rules are existing, I can then use one or another, no ? |
if you want this; - self::assertTrue(is_resource($file));
+ self::assertIsResource($file);
you'll need both |
But that's the thing, this is definitely wrong because it has a different meaning. When using the function
|
but replacing with |
For me these two are completely different and should not be mixed. |
ok, check, I see now 👍 not sure how to proceed, no longer do the change, or do the change but update the docs about this, any preferences by anyone? |
IMHO: I would just no longer do the change. |
sounds good to me, can you prepare a PR for it maybe? let me know if not, no problem than I'll put it on my backlog |
I will try... I don't promise you anything. |
Hi,
I just noticed that PHP CS Fixer replace this:
However, the method
TestCase::assertInternalType
does not exist anymore in PHPUnit, it has been deprecated.On top of that, if just like me you're using the function
is_resource
to check if a resource is open or not, then replacing it withTestCase::assertInternalType
is wrong because it doesn't check that specific thing. Why? BecauseTestCase::assertInternalType
is based ongetType()
and does not check the status of the resource.The text was updated successfully, but these errors were encountered: