#7620 closed enhancement (fixed)
Update shared fixture architecture for WP 4.4+
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | |
Cc: |
Description
WordPress 4.4 saw some changes in the way shared fixtures are handled. The summary:
- The factory should be fetched using
self::factory()
rather than$this->factory
. This allows better consistency in iterators across all tests. - Shared fixtures should be created in
wpSetUpBeforeClass()
rather thansetUpBeforeClass()
, and should use the$factory
object passed to the method. (This also helps to keep incrementors synced.) - There's no longer a need to clean up core data (posts, users, etc) in
tearDownAfterClass()
- WP does it automatically, using_delete_all_data()
. At the very least, we can take advantage of this. We might also consider implementing our own version of the same thing.
Change History (7)
#5
@
7 years ago
The quirks in our own API and the way that WP handle shared fixtures may mean that it's not possible to inherit the cleanup routines (wpTearDownAfterClass()
) that WP has in place. We can still look into mass-deleting our own content, similar to _delete_all_data()
, but this needs more attention that I can't devote at the moment.
#6
@
7 years ago
- Resolution set to fixed
- Status changed from new to closed
Since there was work done against this, I'm going to mark it complete as we can track progress.
Future improvements can be documented and implemented as/when a contributor is interested.
#7
@
5 years ago
WP 4.4's cannot be inherited with user cleanup between tests, because
all test methods are static.
The deletion process only runs after the main test suite has been unlinked from
certain actions.
To run necessary cleanup tasks in our own delete_user()
method, toy must ensure that it's the method is called in every case.
And Speaking of Architecture, we do have a client of ours that is a real life Architect they carry out Link: Architecture drawings in Primrose Hill Check them out.
In 11734: