Opened 19 months ago
Last modified 19 months ago
#58006 new enhancement
Final classes & testing
Reported by: | neblabs | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | reporter-feedback |
Focuses: | coding-standards | Cc: |
Description
Sorry if this is not the place to post.
All (or most AFAIK) WordPress classes WP_* are declared final.
This is an issue when unit testing since final classes can't be mocked so unit testing a class that relies on a WP_Post instance is hard.
If I may ask, is there a reason why these classes are final? Have there been any talks to make them non-final, at least in the official testing environment that uses phpunit?
Note: See
TracTickets for help on using
tickets.
Hi @neblabs, welcome to Trac!
Can you provide some detail on what you're trying to do?