Opened 3 years ago
Closed 4 months ago
#58006 closed enhancement (duplicate)
Final classes & testing
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | |
| 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?
Change History (2)
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?