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

assertObjectHasAttribute deprecated #317

Conversation

danepowell
Copy link
Collaborator

@danepowell danepowell commented Feb 7, 2023

PHPUnit deprecated assertObjectHasAttribute, arguing that any test that relies on it is of dubious value: sebastianbergmann/phpunit#4601

I tend to agree, these tests feel a little pointless to me. They're basically testing that a Response class has certain properties on it, which can never not be true unless we intentionally change the class.

@typhonius are you okay with this general approach? We use this pattern in dozens, possibly hundreds of tests. I want to be sure before I go fixing them all.

Edit: Ugh. It looks like mutation tests may indeed fail if we don't explicitly test the return types.

@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (e1b2b67) compared to base (bc1a0a7).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #317   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       255       255           
===========================================
  Files             88        88           
  Lines           1676      1676           
===========================================
  Hits            1676      1676           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -17,7 +17,7 @@
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0.0",
"phpunit/phpunit": "^9",
"phpunit/phpunit": "9.5.28",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary to keep mutation tests running while I work on this PR.

@danepowell
Copy link
Collaborator Author

I think this approach is valid, it just needs to be more targeted. See #320

@danepowell danepowell closed this Feb 8, 2023
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.

1 participant