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

Do not mark MetaboxOrchestra\BoxInfo as final #3

Open
widoz opened this issue Nov 21, 2020 · 0 comments
Open

Do not mark MetaboxOrchestra\BoxInfo as final #3

widoz opened this issue Nov 21, 2020 · 0 comments

Comments

@widoz
Copy link
Member

widoz commented Nov 21, 2020

Does make sense since the class does not implements the following methods by an interface that the class isn't marked as final.

  • id
  • title
  • context
  • priority

I understand that's just a data structure but in terms of unit tests correctness I want to mock the instance of that class but obviously it's not possible.

Additional reasons are:

  • The constructor make calls to Wp functions which is something I would not do in an unit test
  • I cannot make expectations for the instance and I have to construct more instances within the same test if I want to make smaller different tests.
  • A class should not be marked as final if there are methods which are not part of an interface. That's just an opinionable idea but like any other reason to mark a class final .
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

No branches or pull requests

1 participant