#29896 closed enhancement (fixed)
Organize Multisite Unit Tests
Reported by: | jeremyfelt | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
In the near future, I'd like to expand what we're testing in our multisite unit tests quite a bit. The single ms.php
file we have now is getting long and unwieldy.
The attached patch:
- Adds a
multisite/
directory with test classes for sites, users, and bootstrap. - Adds groups ms-sites, ms-users, ms-bootstrap to handle the running of similar tests in an easier way.
I've left a handful of tests in the original ms.php
file and am pondering where to put these. This may be good for now until other tests in those areas are written.
Attachments (3)
Change History (10)
This ticket was mentioned in IRC in #wordpress-dev by jeremyfelt. View the logs.
10 years ago
#4
@
10 years ago
- Owner set to jeremyfelt
- Status changed from new to assigned
The only thing I'd suggest is we try to follow the existing UT naming conventions:
- ms.php should become multisite.php to correspond with the multisite/ directory.
- multisite/users.php would be multisite/user.php, sites.php would be site.php.
Thought: should these instead be user/multisite.php?
Huge +1.
#5
@
10 years ago
Replying to nacin:
Thought: should these instead be user/multisite.php?
Yes.
I think if we have multisite specific tests for other components (users, options, media, taxonomy), we should use a multisite.php
in that directory. (i.e. similar to focuses and components in Trac)
For the "networks and sites" component as well as the multisite boot process, I think we're good with a multisite/
directory.
We go this direction in 29896.3.diff:
ms.php
becomesmultisite.php
and retains a couple registration related tests. We can move these out over time once we start testing that process.- Tests specific to options move from
option/blogOption.php
tooption/multisite.php
. This also brings one multisite specific test fromoption/siteOption.php
. Really,*_site_option()
is*_option()
in single site, so the naming here can get confusing. - Tests specific to users are in
user/multisite.php
- Tests specific to sites on a network are in
multisite/site.php
- Tests specific to networks are in
multisite/network.php
- Tests specific to the bootstrap / load process are in
multisite/bootstrap.php
We can now run tests with ms-site
, ms-user
, ms-option
, ms-network
, and ms-bootstrap
groups, which is nice.
I'm going to sleep on it, but it's feeling good and everything is still passing. :)
Big +1.