[wp-trac] [WordPress Trac] #33968: Improve performance of Unit Tests for 4.4
WordPress Trac
noreply at wordpress.org
Thu Oct 15 04:43:39 UTC 2015
#33968: Improve performance of Unit Tests for 4.4
------------------------------+-----------------------
Reporter: jorbin | Owner: jorbin
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.4
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+-----------------------
Comment (by wonderboymusic):
In [changeset:"35186"]:
{{{
#!CommitTicketReference repository="" revision="35186"
Unit Tests: implement `setUpBeforeClass()` and `tearDownAfterClass()` on
`WP_UnitTestCase`. Use late static binding (plus a gross fallback for PHP
5.2) to check if `wpSetUpBeforeClass()` or `wpTearDownAfterClass()` exist
on the called class, and then call it and pass a static
`WP_UnitTest_Factory` instance via Dependency Injection, if it exists.
This makes it way easier to add fixtures, and tear them down, without
needing to instantiate `WP_UnitTest_Factory` in every class - removes the
need to call `commit_transaction()` in each individual class.
See #30017, #33968.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33968#comment:54>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list