MetaboxOrchestra
MetaboxOrchestra copied to clipboard
Do not mark `MetaboxOrchestra\BoxInfo` as final
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.