Commit Graph

625 Commits

Author SHA1 Message Date
Boone Gorges 05336f904f Remove failing assertions from `is_serialized()` tests.
They have been moved to new test methods, which have been attached as a patch
to the ticket #9930.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30520 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 20:34:15 +00:00
Boone Gorges 28b45922d5 Remove failing test in the `hooks` group.
The removed test has been added as a patch to #21169.

Props MikeHansenMe.
See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30519 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 20:25:03 +00:00
Boone Gorges 63f6864a9e Remove skipped tests for `WP_Export_Query`.
These tests have been added as a patch to the ticket where the new
functionality was originally proposed, #22435.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30518 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 20:22:01 +00:00
Boone Gorges 0b9a21b451 Remove skipped tests for unimplemented JS plural functions.
The tests have been added as a patch for the original ticket, #22229.

Props MikeHansenMe.
See #22229.

git-svn-id: https://develop.svn.wordpress.org/trunk@30517 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 20:11:10 +00:00
Boone Gorges d5b277e6bd Remove failing test for unimplemented `wp_mail()` enhancement.
The removed test has been added as a patch to the original ticket, #15448.

Props MikeHansenMe.
See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30516 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 20:05:34 +00:00
Boone Gorges 73ef6bd6fc Improvements to encoded character formatting tests.
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
2014-11-22 19:53:37 +00:00
Boone Gorges 3818c645c3 Remove failing tests related to square brackets being stripped in URL sanitizers.
These tests have been added as a patch to their original ticket, #16859.

Props MikeHansenMe.
See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30514 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 15:39:38 +00:00
Boone Gorges f0b8424483 Remove failing tests related to `WP_User::__unset()`.
These tests have been added as a patch to their original ticket, #20043.

Props MikeHansenMe.
See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30513 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 15:36:00 +00:00
Boone Gorges fa76c19ecb Declare user_email when setting up fixtures for `count_user_posts()` tests.
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
2014-11-22 15:04:07 +00:00
Boone Gorges cfeae751a0 Improve performance of post revision order test.
`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
2014-11-22 14:17:21 +00:00
Boone Gorges 36315d2b3f Remove some failing unit tests from the `post` group.
These tests have been added as a patch to ticket #19373.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30510 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-22 12:03:48 +00:00
Sergey Biryukov 917a469052 Replace invalid use of ltrim() in attachment_url_to_postid() with substr().
props bradyvercher.
fixes #30346.

git-svn-id: https://develop.svn.wordpress.org/trunk@30501 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-21 06:34:23 +00:00
Boone Gorges 5e71d5f21e Improve cleanup of cached term_ids after shared terms are split.
* 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
2014-11-21 03:16:08 +00:00
John Blackbourn 8fe059d426 Correct an SQL syntax error introduced in r30158. Adds tests.
Fixes #30339
See #18962
Props julien731


git-svn-id: https://develop.svn.wordpress.org/trunk@30480 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 16:45:48 +00:00
Andrew Nacin 95dbca94e1 More tests for [30466]. props xknown.
git-svn-id: https://develop.svn.wordpress.org/trunk@30471 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 16:10:24 +00:00
Andrew Nacin aec2f2654e Prevent high resource usage when hashing large passwords. props mdawaffe, pento
git-svn-id: https://develop.svn.wordpress.org/trunk@30466 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 16:02:55 +00:00
Andrew Nacin fb28a78331 Anchor texturize to shortcodes to improve regex efficiency.
props miqrogroove.
see #29557 for segfault issues.


git-svn-id: https://develop.svn.wordpress.org/trunk@30449 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 14:27:08 +00:00
Andrew Nacin d2b4df2d4f Invalidate password keys when a user's email changes.
git-svn-id: https://develop.svn.wordpress.org/trunk@30430 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 13:39:03 +00:00
Jeremy Felt 3223d4a4b3 Prevent wpmu_delete_blog from removing the wrong uploads directory
`wp_upload_dir()` includes some logic to fall back to the default site's upload directory if a specific directory for the requested site cannot be found. Because of this, if `wpmu_delete_blog()` is fired twice in a row for the same site, the main site's upload directory could be deleted as well.

This adds some checks in `wpmu_delete_blog()` so that we are confident in the site and it's upload directory's existence before dropping the site. Tests are added for when `ms_files_rewriting` is enabled or disabled.

Fixes #30121


git-svn-id: https://develop.svn.wordpress.org/trunk@30404 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 06:52:07 +00:00
Boone Gorges 10b611b0c3 Return an empty array from `get_approved_comments()` when `$post_id` is empty.
This behavior was broken when moving the internals to `WP_Comment_Query` in
[30098]. As a result, `get_approved_comments( 0 )` was fetching *all* approved
comments, causing performance issues.

Props dd32.
Fixes #30412.

git-svn-id: https://develop.svn.wordpress.org/trunk@30402 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 01:51:38 +00:00
Gary Pendergast 78f496f378 Fix a MySQL warning in the `test_get_adjacent_post_exclude_self_term` unit test, caused by [30400].
See #21212, #22112.


git-svn-id: https://develop.svn.wordpress.org/trunk@30401 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 01:47:30 +00:00
Gary Pendergast cabcace53c WPDB: Force `STRICT_ALL_TABLES` to be enabled as soon as we connect to the MySQL server.
This improves data integrity when inserting and updating rows in the database, particularly when trying to insert emoji into posts stored with character sets that don't support emoji.

See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30400 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 01:45:10 +00:00
Andrew Ozz 7137f26a5b TinyMCE: update to the latest dev. version, 4.1.6+. Fixes #30411.
git-svn-id: https://develop.svn.wordpress.org/trunk@30397 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 00:49:38 +00:00
Boone Gorges c002bcf27e Better test method name in formatting/IsEmail.php.
Props dlh.
Fixes #30397.

git-svn-id: https://develop.svn.wordpress.org/trunk@30392 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-19 19:31:17 +00:00
Boone Gorges d1e841c03b Improvements to `wp_make_link_relative()`.
* Support relative URL input.
* When the URL being made relative has another URL as a parameter, don't make the second URL relative.

Props voldemortensen.
Fixes #30373.

git-svn-id: https://develop.svn.wordpress.org/trunk@30383 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-19 01:52:57 +00:00
Gary Pendergast de33d35d1f WPDB: When a `db.php` drop-in is being used, and it doesn't explicitly define itself as connecting to MySQL, skip the character set checks. This ensures that existing drop-ins won't accidentally run checks that they don't support.
See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30375 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-18 03:37:23 +00:00
Boone Gorges db2bd39770 Add unit test files mistakenly excluded from [30085].
See #9256, #25349.

git-svn-id: https://develop.svn.wordpress.org/trunk@30367 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-17 16:16:01 +00:00
Boone Gorges 69a167688e Flush cache for newly created term in `_split_shared_term()`.
The term itself does not have any cached values yet, but in some cases the new
term's taxonomy may need its cached hierarchy to be refreshed as a result of
the term splitting.

Props jorbin.
See #30335.

git-svn-id: https://develop.svn.wordpress.org/trunk@30347 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-14 21:52:23 +00:00
Gary Pendergast e1ca159011 If a saving a post fails, remove any invalid characters (such as emoji) from the primary text fields, then try to save it again.
See #21212.



git-svn-id: https://develop.svn.wordpress.org/trunk@30346 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-14 21:33:50 +00:00
Gary Pendergast 6df14c1612 When creating a post containing emoji, the post can be saved incorrectly if MySQL isn't using a character set that supports emoji.
This change prevents the save from occurring, so it can be handled correctly in the UI.

See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30345 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-14 21:27:17 +00:00
Boone Gorges ab96cf6614 Reinstate term splitting on term update.
Originally introduced in [30241] and reverted in [30336], term splitting is
back and better than ever. Now with *more unit tests* and *improved treatment
of child terms*!

See #30335.

git-svn-id: https://develop.svn.wordpress.org/trunk@30344 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-14 21:26:48 +00:00
Aaron Jorbin b94dd6a7ec When asserting microtime output as a number, make it a number
microtime is by default a string. Doing a greater then or less than check of that string is a bad idea since it uses the first part (the micro part of microtime) rather then the actual time. This adds a helper to convert microtime output into a float which we can then use to properly compare the output of microtime.

This fixes an intermittent test failure.

fixes #30336



git-svn-id: https://develop.svn.wordpress.org/trunk@30337 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-13 22:03:15 +00:00
boonebgorges 805021f406 Don't split shared terms on term update.
Splitting shared terms means assigning a new term_id to a given term_taxonomy_id.
It was uncovered that this change could cause problems for sites that have
cached the original term_id somehow - say, in postmeta - since future lookups
using that term_id will now fail.

Removing for 4.1-beta1. We'll look at improvements to backward compatibility
to try to get this back into a later beta.

Props mboynes.
See #30335.

git-svn-id: https://develop.svn.wordpress.org/trunk@30336 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-13 20:04:02 +00:00
Boone Gorges 3544e20e9a Introduce `$post_type` param for `count_user_posts()`.
Props Caspie, engelen, DrewAPicture.
Fixes #21364.

git-svn-id: https://develop.svn.wordpress.org/trunk@30322 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-13 02:18:30 +00:00
Boone Gorges f5d88c355e Manually delete fixture in `test_mysqli_flush_sync()`.
This test creates a dummy post and subsequently runs a query containing
`DROP PROCEDURE`. This latter query implies a `COMMIT`, which means that the
post is not cleaned up for later tests. Manually deleting the post with
`wp_delete_post()` solves this problem.

Fixes #28155.

git-svn-id: https://develop.svn.wordpress.org/trunk@30320 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-13 01:59:49 +00:00
Boone Gorges df11fb8593 Exclude external-http tests when running `phpunit`.
The external-http tests are very slow, and `Wp_Http` functionality is fairly
isolated, so the benefits of skipping these tests by default outweigh the
risks.

A `grunt phpunit:external-http` subtask has been added, to ensure that the
tests are executed during exhaustive runs of the test suite, such as in
continuous integration.

Fixes #30304.

git-svn-id: https://develop.svn.wordpress.org/trunk@30298 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 14:48:28 +00:00
Gary Pendergast 4b1aa89206 `wpdb::flush()` was not flushing results correctly when using mysqli.
This change also allows stored procedures or queries made with `mysqli_multi_query()` to be flushed.

Includes unit tests.

Fixes #28155.

Props soulseekah.


git-svn-id: https://develop.svn.wordpress.org/trunk@30297 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 05:39:50 +00:00
Boone Gorges 3c360968ef Fix PHP notice in `Tests_Feed_RSS2::test_items()`.
A notice was being thrown when `get_the_tags()` returned false, and `foreach()`
was run over that return value.

See [30283].

git-svn-id: https://develop.svn.wordpress.org/trunk@30295 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 02:04:22 +00:00
Aaron Jorbin 218924d9ee Remove failing Unbalanced tags tests
Patch with tests added to #6297 for use in the future

Props MikeHansenMe for creating patch of current unit test

see #30284


git-svn-id: https://develop.svn.wordpress.org/trunk@30291 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 23:14:28 +00:00
Aaron Jorbin 44825185f7 Remove failing shortcode unit tests
Test added to #14050 in case we want to include it in a future fix.

see #30284



git-svn-id: https://develop.svn.wordpress.org/trunk@30290 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 22:50:30 +00:00
Aaron Jorbin e7e27c2e4d Remove failing uploadfile test in trunk
The test has been added to #11946 and can be readded when that ticket is fixed.

Props MikeHansenMe for creating patch of current unit test

See #30284



git-svn-id: https://develop.svn.wordpress.org/trunk@30289 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:55:41 +00:00
Jeremy Felt 211c7ac373 Move tests for ms_files_rewriting to separate group, ms-files
When the `ms_files_rewriting` flag is enabled, `ms_upload_constants()` is required to properly set upload directory constants. Once this fires, it is impossible to clean up for a non `ms_files_rewriting` test by turning the option back off.

Excluding these tests by default offer a more consistent environment overall. Any tests written for uploaded files in multisite should ideally have a correspondign test in this area.

This commit also moves existing `ms_files_rewriting` tests for `test_switch_upload_dir()`.

Fixes #30256


git-svn-id: https://develop.svn.wordpress.org/trunk@30286 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:07:05 +00:00
Boone Gorges ffcfc0573b Remove failing test related to post galleries.
It relied on the old _WPDataset technique, which is no longer used.

The test has been added to #UT30 as a patch, in case anyone wants to make
future use of it.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30285 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:01:39 +00:00
Boone Gorges 9b425eb5e4 Improve `Tests_Feed_RSS2::test_items()`.
* Better reference to post author, to avoid PHP notices.
* Code styling.
* More reliable checking of tags and categories.

Props kurtpayne.
Fixes #UT32. See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30283 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:54:06 +00:00
Boone Gorges 13602b566d Remove failing unit tests from 'canonical' group.
Each removed test has been turned into a patch and posted to the open ticket
that it belongs to.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30282 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:36:27 +00:00
Jeremy Felt bcf340ff65 Use `remove_added_uploads()` in `tearDown()` for XMLRPC tests
This cleanup avoids false test failures due to incrementing filenames in the uploads directory.

Fixes #30290


git-svn-id: https://develop.svn.wordpress.org/trunk@30279 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:17:17 +00:00
Boone Gorges 608084a9cc In unit tests, use `wpmu_delete_user()` to delete users when `is_multisite()`.
`wp_delete_user()` doesn't remove the user from the database, which causes all
sorts of problems in certain cases.

Props jeremyfelt.
See [30277], #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30278 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 19:55:05 +00:00
Boone Gorges d63ceb08a3 Share fixtures across 'canonical' automated tests.
Sharing these fixtures results in a speed improvement of almost one minute per
run of the test suite.

My hope is that future WordPress developers will spend this extra minute with
their loved ones, for life on this earth is short, my friends, and the moments
you spend watching WP generate test data can never again be reclaimed from the
grizzled clutches of Time, and none of us are really getting younger, I mean,
geez, have you looked in the mirror lately, Gandalf?

See #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30277 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 19:28:12 +00:00
Boone Gorges fe726039bd Share fixtures across a number of query-related test classes.
This shaves 10-20 seconds off the running time for the suite.

See #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30276 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 15:29:31 +00:00
Boone Gorges f12b0f9aad Correct variable name in `WP_UnitTestCase::temp_filename()`.
git-svn-id: https://develop.svn.wordpress.org/trunk@30268 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 01:36:05 +00:00