Break a single test with many assertions into many tests with single assertions.
In the process, provide separate and comprehensive tests for `upload_is_user_over_quota()`, `is_upload_space_available()`, and `get_space_allowed()`.
Also removes a check for `BLOGSUPLOADDIR`, a constant that never existed. New tests will need to be introduced to handle the ms-files group.
See #30080
git-svn-id: https://develop.svn.wordpress.org/trunk@30715 602fd350-edb4-49c9-b593-d223f7449a82
Examples: if you clean up directories in a test, or a test fails before the directories are cleaned, or a test fails before the `'upload_path'` option is reset, the next call to `wp_upload_dir()` will recreate the directories you just tried to delete.
These changes ensure that `src/foo` and `/tmp/wp-unit-test` directories are deleted immediately after `wp_upload_dir()` is fired in the tests.
Fixes#30513.
git-svn-id: https://develop.svn.wordpress.org/trunk@30658 602fd350-edb4-49c9-b593-d223f7449a82
Updates the existing test for pages which should take priority over attachments in cases where an existing clash exists.
Fixes#18962
Props boonebgorges
git-svn-id: https://develop.svn.wordpress.org/trunk@30629 602fd350-edb4-49c9-b593-d223f7449a82
This is a revert of [30494], [30492], [30347], and [30334]. The latter
changeset was a revert of [30336], which was a revert of [30241].
Watch for Term Splitting, Version III in version 4.2, coming soon to a
WordPress trunk near you.
See #30335, #5809.
git-svn-id: https://develop.svn.wordpress.org/trunk@30585 602fd350-edb4-49c9-b593-d223f7449a82
These tests were written to use the `assertImageAtAlpha()` helper method, whose
internals were specific to GD. As a result, the tests could not pass. This
changeset introduces GD- and Imagick-specific versions of this method.
Props voldemortensen.
Fixes#24871.
git-svn-id: https://develop.svn.wordpress.org/trunk@30549 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes broken builds on older versions of MySQL. See #30462.
Assertions regarding indeterminate secondary ORDER BY clauses will go in
separate test methods. See #30478.
git-svn-id: https://develop.svn.wordpress.org/trunk@30548 602fd350-edb4-49c9-b593-d223f7449a82
This fixes the unit tests that fail in earlier versions, see #30471 for fixing this globally in `wp_json_encode()`.
git-svn-id: https://develop.svn.wordpress.org/trunk@30534 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the test is not polluted by permalink structure changes in
earlier tests.
git-svn-id: https://develop.svn.wordpress.org/trunk@30529 602fd350-edb4-49c9-b593-d223f7449a82
It should be defined in a common library file so that all tests have access to
it, even when run in isolation.
See [30345], #21212.
git-svn-id: https://develop.svn.wordpress.org/trunk@30528 602fd350-edb4-49c9-b593-d223f7449a82
In general, skipped tests should live only in patches, which are committed at
the same time that the corresponding bug is fixed. In cases where it's
necessary to skip a test, use `markTestSkipped()` to declare this fact
explicitly.
We continue to check Trac when using `WP_UnitTestCase` to run non-core tests.
See #30284.
git-svn-id: https://develop.svn.wordpress.org/trunk@30526 602fd350-edb4-49c9-b593-d223f7449a82
* Provide sample data that is actually encoded in Big5.
* Do some actual assertions against that data.
Props akumria.
Fixes#30455.
git-svn-id: https://develop.svn.wordpress.org/trunk@30525 602fd350-edb4-49c9-b593-d223f7449a82
In `sanitize_title_with_dashes()` and `sanitize_user()` tests, we break large
test methods into smaller ones in order to isolate those that actually describe
the bug being reported in ticket #10823. The unit tests that are continuing to
fail have been attached as a patch to that ticket.
See #30284.
git-svn-id: https://develop.svn.wordpress.org/trunk@30515 602fd350-edb4-49c9-b593-d223f7449a82
Because `setUpBeforeClass()` is called statically and creates its own factory
object, the iterator logic from previous tests is not carried over to these
fixtures, and we risk the possibility of user_email clashes when the tests are
run in certain limited configurations.
git-svn-id: https://develop.svn.wordpress.org/trunk@30512 602fd350-edb4-49c9-b593-d223f7449a82
`test_revision_order()` was written ([28541], #26042) to ensure that revision
order was properly preserved in two different cases: (1) where the post_date
varied (in which case the revisions would be sorted by post_date DESC) and
(2) where the post_date was the same (in which case sorting would fall back on
ID DESC). In an attempt to ensure that both of these scenarios arose in the
context of a single test, 100 posts were created. We can make the process far
more efficient by manually creating the revisions with the post_dates
explicitly declared, and splitting the two different cases into two separate
test methods.
This test was previously the single worst offender in the entire suite, taking
upwards of 15 seconds to run. All that most maddens and torments; all that stirs
up the lees of things; all truth with malice in it; all that cracks the sinews
and cakes the brain; all the subtle demonisms of life and thought; all evil, to
crazy Boone, were visibly personified, and made practically assailable in
`test_revision_order()`.
See #30017.
git-svn-id: https://develop.svn.wordpress.org/trunk@30511 602fd350-edb4-49c9-b593-d223f7449a82
* If the split term ID is stored as 'default_category', 'default_link_category', or 'default_email_category', update it to the new ID.
* If the split term ID is associated with a nav menu item, update that piece of postmeta to the new ID.
Props mboynes.
See #30335.
git-svn-id: https://develop.svn.wordpress.org/trunk@30494 602fd350-edb4-49c9-b593-d223f7449a82