Andrew Nacin
fbb2e1dc89
Transients: Allow a non-expiring transient to be updated with an expiry.
...
props shahpranaf, sandyr.
fixes #22807 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27719 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 18:22:49 +00:00
Andrew Nacin
07eb830a9b
Ensure the $path is trailing-slashed in domain_exists().
...
Adds tests for [27717].
props ejdanderson, ericmann.
fixes #20589 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27718 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 17:39:08 +00:00
Andrew Nacin
c9531d6d67
Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri().
...
props SergeyBiryukov.
fixes #21969 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27710 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 13:06:21 +00:00
Andrew Nacin
3e28e2fae8
Multisite: Don't set the $super_admins global in grant_super_admin(), revoke_super_admin().
...
Adds tests and docs.
props jdgrimes.
see #27205 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27706 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 12:13:40 +00:00
Andrew Nacin
05f0bcabec
Use the current post's post type when determining post adjacency.
...
props ethitter.
fixes #26937 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27692 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 21:29:14 +00:00
Scott Taylor
82ba1702df
When using meta_query
in a WP_Query
, passing NOT EXISTS
or ''
to compare
should not require value
to be set. The resulting SQL should then produce the appropriate OR
clause for existence of non-existence after passing the query to the $key_only_queries
stack internally.
...
Adds unit tests.
Props chrisguitarguy, for the original patch.
Fixes #23268 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27689 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 19:56:54 +00:00
Scott Taylor
710f11f2df
When using WP_Query's "fields" => "ids"
(or "fields" => "id=>parent"
), the returned values should be an array of integers, not array of integers represented by strings.
...
Adds unit tests. All other unit tests pass.
Props danielbachhuber.
Fixes #27252 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27686 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 18:54:38 +00:00
Scott Taylor
651b4a5f5b
Fix the video shortcode unit test after [27519].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27685 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 17:13:48 +00:00
Scott Taylor
88b610dc72
Fix a swath of broken unit tests from Tests_User_ListAuthors
.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27684 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 16:52:38 +00:00
Andrew Ozz
2dc003fb02
Two files weren't deleted in [27679], see #27014
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27680 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 06:12:08 +00:00
Andrew Ozz
0898014ebd
Update the TinyMCE tests.
...
In 4.0.20 all tests were reworked. The 'testrunner' was removed and the PhantomJS Runner QUnit plugin was added making it possible to run the tests from cli. However it is still necessary to run the tests in all supported browsers to test the fixes for all browser quirks and normalization. Also all tests are loaded in one html file.
See #27014
git-svn-id: https://develop.svn.wordpress.org/trunk@27679 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 05:59:45 +00:00
Andrew Nacin
0963ea19a0
Fix various issues with WP_Adjacent_Post:
...
* Performance / number of queries.
* Incorrect results caused by sticky posts.
* Back compat for filters, which had used "WHERE" while WP_Query does not; and fixing table references.
props ethitter.
fixes #26937 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27635 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-20 02:58:48 +00:00
Andrew Nacin
681ca37c63
Return false from metadata_exists() if the get_$type_metadata filter returns a false value.
...
props xknown.
fixes #22746 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27562 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-17 19:39:31 +00:00
Andrew Nacin
05911cc3d4
Explicitly assign menu term relationship rather than piggybacking on wp_insert_post() with the tax_input argument.
...
That argument currently depends on user context (see #19373 ).
Adds unit test for properly updating orphaned menu items.
props danielbachhuber.
fixes #27113 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27556 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 06:06:41 +00:00
Andrew Nacin
f4cc32fac9
XML-RPC: In wp.editPost, Remove all terms in a taxonomy when an empty array is explicitly passed.
...
props jstraitiff, maxcutler.
fixes #26686 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27554 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 05:08:40 +00:00
Andrew Nacin
0ed014743d
Allow query strings for servers in IXR_Client and WP_HTTP_IXR_Client.
...
props cfinke.
fixes #26947 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27552 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 05:00:27 +00:00
Andrew Nacin
8355232a65
Avoid saving slashed data in XML-RPC's wp.setOptions.
...
props danielbachhuber.
fixes #22936 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27551 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 04:46:53 +00:00
Andrew Nacin
5adf89fe26
Pass feed_type arg in wp_list_authors() to get_author_feed_link().
...
Adds a slate of tests for wp_list_authors().
props MikeHansenMe.
fixes #26538 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27550 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 04:42:57 +00:00
John Blackbourn
22eb8b34ef
Improve paginate_links()
performance by not calling number_format_i18n()
unnecessarily. Fixes #25735 with tests. Props johnpbloch.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27523 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-13 17:38:51 +00:00
Scott Taylor
36df368171
In WP_Query::get_queried_object()
, account for pre_get_posts
by checking for tag
when tag_id
isn't present. Tags still need to be rolled up into tax_query
. Add a unit test confirming expected query vars during and after pre_get_posts
.
...
Props mattonomics for a patch.
See #27362 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27511 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-12 04:07:41 +00:00
Andrew Nacin
020ba8e15a
Revert [27492]. see #27112 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27493 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-10 23:29:49 +00:00
Andrew Nacin
f36e40de2c
Add widget customizer tests missing from [27419]. see #27112 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27492 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-10 23:04:53 +00:00
Andrew Nacin
036cb74d46
Add unit tests for searching by relevance.
...
props wonderboymusic.
see #7394 , #20044 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27474 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 21:26:26 +00:00
Andrew Nacin
f225973b62
Allow $crop in add_image_size() to receive crop anchors (top, left, right, bottom, center).
...
This also applies to set_post_thumbnail_size() and image_resize_dimensions().
props bradt, wonderboymusic, DH-Shredder.
fixes #19393 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27472 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 06:13:27 +00:00
Scott Taylor
613b28cc81
Remove a cache-busting hack from Tests_Term_getTerms::test_get_terms_exclude_tree()
. It is no longer necessary after #14485 and #25711 .
...
See [27300].
Props SergeyBiryukov.
Fixes #27313 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27459 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 19:35:55 +00:00
Scott Taylor
3010c5aa20
In get_terms()
, leverage get_term_children()
over _get_term_children()
when making sure to show empty terms that have children in a hierarchical taxonomy while avoiding duplicates.
...
Adds unit test for `child_of` param. Adjusts unit tests for `get_terms()`.
See [27108] and [27125].
Props SergeyBiryukov.
Fixes #27123 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27458 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 19:29:01 +00:00
Scott Taylor
dfc11a170b
On second thought, allow posts_per_rss
to be set in pre_get_posts
to override the posts_per_rss
option. There are backwards compatibility concerns otherwise.
...
Props nacin.
Partially reverts [27455]. Updates the unit test. See #25380 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27456 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 18:58:33 +00:00
Scott Taylor
65932f71fd
When setting posts_per_page
in WP_Query::get_posts()
, check for is_feed()
in the same place where posts_per_page
is set when it is not already set. Previously, when is_feed()
was true, posts_per_page
would be arbitrarily overwritten. This fix allows posts_per_page
to be set during pre_get_posts
when is_feed()
is true and not be overwritten.
...
Adds unit test.
Props wokamoto.
Fixes #25380 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27455 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 18:32:40 +00:00
Andrew Nacin
a14b999605
Always convert auto-drafts to drafts in edit_draft() and _wp_translate_postdata().
...
This regressed due to refactoring in [26995]. This commit fixes Quick Draft.
see #25272 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27405 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-05 06:25:31 +00:00
Andrew Nacin
ed43f002b8
Add has_password and post_password query variables to WP_Query.
...
* has_password true means posts with passwords, false means posts without.
* post_password can query for posts with a particular password.
props wonderboymusic, robmiller.
fixes #20308 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27395 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 07:44:28 +00:00
Andrew Nacin
5edec1d792
Don't default to current user for capability checks when dealing with a post without an author (post_author = 0).
...
Undoes [12053]. While it risks breakage, this is a far safer and saner default for these situations.
props danielbachhuber.
fixes #27020 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27390 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 03:08:54 +00:00
Andrew Ozz
e5bed6707f
TinyMCE: update to 4.0.18, see #24067
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27387 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 01:56:57 +00:00
Andrew Nacin
eef62a9d0d
Update PHPMailer to 5.2.7 from 5.2.4.
...
Includes two trivial modifications for WordPress:
* Doesn't use the autoloader, so the check to enforce the autoloader from the constructor is removed.
* Requires class-smtp.php for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used.
props bpetty.
fixes #25560 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27385 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 20:24:31 +00:00
Andrew Nacin
260b7f08ca
Let get_the_date() accept a post object.
...
props tanner-m, adamsilverstein, bigdawggi.
fixes #13771 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27380 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 17:59:11 +00:00
Mark Jaquith
7937358328
Eliminate some of our last remaining create_function()
instances
...
* Moved some into private function callbacks
* Eliminated some that weren't necessary anymore
props obenland, markjaquith, nacin. fixes #14424
git-svn-id: https://develop.svn.wordpress.org/trunk@27373 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 16:20:12 +00:00
Sergey Biryukov
7f3c71eff3
Add missing word. props bassgang. fixes #27259 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27371 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 09:46:36 +00:00
Andrew Nacin
6869d203d0
Introduce get_site_by_path() and further rewrite the site detection process for multisite.
...
This is the first big step to supporting arbitrary domains and paths. In this new approach, sites are detected first where possible, then the network is inferred. Allows filtering for arbitrary path segments, smooths out some weirdness, and removes various restrictions. A sunrise plugin could do much of its work by adding filters, if those are even needed.
see #27003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27359 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 22:24:50 +00:00
Sergey Biryukov
3038bdc80f
Restore $content_width global value after changing it in test_constrain_size_for_editor_*().
...
props ericlewis, georgestephanis, salcode, jorbin.
fixes #27256 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27358 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 22:22:41 +00:00
Sergey Biryukov
f213decc7e
Skip import tests if WordPress Importer plugin is missing.
...
props mattheu.
fixes #27250 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27349 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 10:34:58 +00:00
Andrew Nacin
8a617607a7
Strip backslashes, not just forward slashes, from untrailingslashit().
...
trailingslashit() will now remove any forward or backslashes from the end of a string before appending a forward slash.
props knutsp, willmot.
fixes #22267 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27344 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-01 21:44:43 +00:00
Andrew Nacin
88f1b6e7ec
Add a $default argument to get_query_var() and WP_Query::get(). fixes #16471 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27304 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 23:57:10 +00:00
Andrew Nacin
68c8b9cf0f
Introduce doing_filter() and doing_action() to identify hooks in progress.
...
did_action() returns true the moment a hook is initially run, leaving you no way to tell if the hook is still in progress. Hooks can be nested and this checks the entire stack, versus current_filter() which only identifies the final hook in the stack. This commit also introduces current_action() for parity.
To tell if a hook has completed, one can use did_action() and ! doing_action() together.
The functions do not require an argument. In that situation, they indicate whether the stack is empty.
props ericmann for the initial unit tests.
fixes #14994 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27294 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 18:43:59 +00:00
Mark Jaquith
1d91296b3b
Return 404 when querying author's posts who is not a member and has no posts on the site
...
fixes #20601 . props yoavf, nacin, SergeyBiryukov, wonderboymusic, markjaquith.
git-svn-id: https://develop.svn.wordpress.org/trunk@27290 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 18:11:36 +00:00
Andrew Nacin
1d8d862e97
Make get_adjacent_post() wrap a new WP_Get_Adjacent_Post object that uses WP_Query.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27285 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 17:09:54 +00:00
Andrew Nacin
a407ae2363
Allow user_id to be an array of IDs in WP_Comment_Query.
...
props mordauk.
fixes #27064 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27258 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 16:34:25 +00:00
Andrew Nacin
f8af178264
Use ext/mysqli in PHP 5.5 or greater. Expect minor explosions.
...
props aaroncampbell, pento.
see #21663 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27250 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 00:39:28 +00:00
Andrew Nacin
b74f222d33
Remove theme support for 'menus' in unregister_nav_menu() when there are no more menus.
...
props kovshenin.
fixes #26900 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27220 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-21 18:13:52 +00:00
Sergey Biryukov
1cda3b44cf
Add @ticket references. see #26903 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27197 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-20 02:20:40 +00:00
Scott Taylor
c2efafbddb
Add some more assertions to Tests_Query_Conditionals
, specifically for is_single()
, is_page()
, and is_attachment()
.
...
See [27016].
Fixes #24257 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27187 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 22:10:57 +00:00
Scott Taylor
7bdca44b97
Make WP_User_Query::prepare_query()
public by allowing it to be passed an array of args. Previously, if the WP_User_Query
constructor was not passed args, the object was basically unusable. Adds unit tests, all other tests pass.
...
Props scribu, for the initial patch.
Fixes #21119 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27185 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 21:40:04 +00:00
Scott Taylor
a31a167359
Reset $wp_query
and $post
during WP_UnitTestCase::tearDown()
to avoid spillage of globals between tests.
...
See #26321 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27183 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 21:03:43 +00:00
Andrew Ozz
920a9799cf
TinyMCE tests: remove 'coverage' for now, has unsatisfied dependencies. Tweak the test runner so it auto-starts. See #27014 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27180 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-15 21:25:15 +00:00
Andrew Nacin
31d3af406c
Multisite: Add get_network_by_path() and wp_get_network() to begin cleanup of multisite load.
...
Tries to get network detection under control by simplifying wpmu_current_site(). It now also pops off each subdomain to find a more general match. Adds unit tests for get_network_by_path() and a new network factory for unit tests.
Much of this is likely to change in 3.9 as more of ms-load.php and ms-settings.php gets hacked to bits.
props jeremyfelt.
see #27003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27178 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-13 23:06:12 +00:00
Andrew Nacin
36fe6c1c27
Don't use HTTPS in unit tests if OpenSSL isn't loaded.
...
props bpetty.
fixes #27114 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27168 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-12 20:39:21 +00:00
Scott Taylor
fd8d6cddcd
Don't iterate over $wp_query->posts
in update_post_thumbnail_cache()
if it is empty. Adds unit tests.
...
Props SergeyBiryukov, for the original patch.
Fixes #26321 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27166 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-12 04:48:14 +00:00
Scott Taylor
2e9d155703
Partially revert [27101], [27102], [27141], and [27142]. Those commits introduced new functions to sync up cache invalidation events. The current commit alters existing internals.
...
"The cache invalidation with static was introduced in r9102 with version 2.7. Multisite wasn't in core back then, so something like switch_to_blog() wasn't a concern, but now it breaks if you switch the blog in between calls to clean_term_cache."
This solution is simpler. All unit tests pass. Removes unnecessary tests linked to removed functions.
Props kovshenin.
Fixes #14485 , #22526 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27163 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-11 16:49:11 +00:00
Andrew Ozz
ce2dcccf86
Incorporate the TinyMCE tests into our JS tests:
...
- Modified the original tests so TinyMCE can be loaded from /src/wp-includes/js/tinymce.
- Added "WP" option to the UI to select only tests relevant to our integration (excludes most of the default plugins tests).
- Added tests for obsolete HTML elements and attributes (html4 back-compat).
See #27014 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27155 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-10 01:11:25 +00:00
Dominik Schilling (ocean90)
586cb2b140
Nav Menu: Remove post/page items from the Nav Menu when the post/page is deleted.
...
This was broken through a change in [25163]. `_menu_item_object` in wp_get_associated_nav_menu_items() is not relevant for post types.
Adds unit tests.
props UmeshSingla for initial patch.
fixes #26795 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27150 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-09 21:36:15 +00:00
Scott Taylor
e966a23683
Reuse the terms
cache group for taxonomy cache invalidation.
...
See #22526 , #14485 , [27101], [27102].
git-svn-id: https://develop.svn.wordpress.org/trunk@27142 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-09 17:41:07 +00:00
Andrew Nacin
522670cef2
Various JSHint fixes. see #26446 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27131 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-08 00:51:14 +00:00
Andrew Nacin
baeadcfedc
Add remove_image_size() and tests for it and has_image_size(), added in [27128].
...
props mordauk, markoheijnen.
fixes #26768 . see #26951 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27129 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-08 00:40:15 +00:00
Scott Taylor
81679ef453
When a term_id
matches in _get_term_children()
, recurse through its children until there is no more depth in the hierarchy. Since get_terms()
return terms with a count
of 0
when their children are not empty, we must return all children so that get_terms()
can check their count.
...
In [27108], #26903 was fixed, but only because we were using the example in the ticket, leaving out infinite depth for hierarchical taxonomies.
Adds unit tests, including `Tests_Term_getTerms::test_get_terms_seven_levels_deep()`.
Fixes #26903 . Again.
git-svn-id: https://develop.svn.wordpress.org/trunk@27125 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-07 19:53:01 +00:00
Scott Taylor
8dad11bfe2
In get_terms()
, don't set automatically hierarchical
to false
when parent => 0
is passed. The default value for parent
is ''
.
...
In `_get_term_children()`, don't skip a top-level term without first including its children in the returned term list. Ironically, the call to `_get_term_children()` in `get_terms()` has a comment stating `"Make sure we show empty categories that have children."`, but it didn't work if you were retrieving top-level categories only.
All unit tests pass. Added a unit test based on the use case described in this ticket.
Fixes #26903 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27108 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-06 17:44:50 +00:00
Scott Taylor
2127c9322d
Move some cache related tests to the new term/cache.php
from [27103].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27104 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-06 05:19:05 +00:00
Scott Taylor
324b2799b3
Add the unit test from #25711 . The patch was unnecessary due to [27102], but the test is useful.
...
Props dd32.
See #25711 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27103 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-06 03:39:22 +00:00
Scott Taylor
50a96f165e
Regenerate the term hierarchy cache ({taxonomy}_children
) when it is out of sync with the passed taxonomy's last_changed
value.
...
Introduces `taxonomy_hierarchy_is_fresh()`, which is only called in `_get_term_hierarchy()`. The taxonomy's `last_changed` value is checked against the value of `wp_cache_get( 'hierarchy_last_changed', $taxonomy )`.
Adds a unit test - `Tests_Term:test_hierachy_invalidation()`.
See [27101], which makes this type of cache invalidation possible.
Fixes #14485 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27102 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-06 01:58:01 +00:00
Scott Taylor
e33ef0c6ac
Add cache invalidation when updating a term, example: create a category, assign it to a post, edit the category. Currently, the post's term cache is not updated. When updating terms in a given taxonomy, invalidate the object term caches linked to that taxonomy.
...
Introduce `get_taxonomy_last_changed()`, `set_taxonomy_last_changed()`, and `post_taxonomy_is_fresh()`.
`post_taxonomy_is_fresh()` is only called in `get_object_term_cache()` - at which point the taxonomy's `last_changed` value is checked against the post's `{$taxonomy}_last_changed` value.
`set_taxonomy_last_changed()` is called whenever directory database queries are made that insert new terms or affect existing terms.
Fixes #22526 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27101 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-06 01:40:05 +00:00
Scott Taylor
9b85472ac9
The unit test for the video shortcode needs to mimic the default params for width and post ID.
...
See #26628 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27100 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-05 05:16:22 +00:00
Scott Taylor
22fef7cf4b
Add a unit test demonstrating the failure to invalidate a post's term cache when the term is updated.
...
See #22526 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27099 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-05 03:49:48 +00:00
wonderboymusic
71947f18d3
When a video shortcode has content in its body, append it as inner HTML in the resulting <video>
.
...
Reverts [27096].
Fixes #26628 .
See #27016 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27097 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-05 01:42:02 +00:00
Scott Taylor
3ccf9e9d29
The video shortcode unit test shouldn't be expected to maintain HTML comments.
...
See #26864 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27096 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-05 01:24:58 +00:00
Andrew Ozz
6a0251847b
Consolidate handling of <object>, <audio> and <video> in wpautop() and add unit tests for them. Part props wonderboymusic, see #26864
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27094 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-05 00:45:53 +00:00
Scott Taylor
050e4f26e9
Invalidate the post cache for posts associated with a user who has been removed from a blog in remove_user_from_blog()
. Adds a unit test.
...
Props nprasath002 for the initial patch.
Fixes #25545 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27087 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-04 04:12:52 +00:00
Andrew Nacin
e07424147c
Test suite: Trim queries before deciding whether to create temporary tables.
...
props jdgrimes.
fixes #24800 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27086 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-03 22:39:47 +00:00
Scott Taylor
28bab15d16
Properly invalidate the cache for wp_count_posts()
on insert, trash, or when transitioning post_status
inside of _transition_post_status()
. Introduces _count_posts_cache_key()
. Adds unit tests.
...
Props mark8barnes, for bringing this to our attention in an initial patch.
Fixes #21879 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27081 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-03 19:41:40 +00:00
Andrew Nacin
194d6a94b7
When the MySQL server has "gone away," attempt to reconnect and retry the query.
...
props pento.
see #5932 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27075 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 22:06:42 +00:00
Andrew Nacin
435df55864
Throw an incorrect usage notice when the query argument of wpdb::prepare() does not include a placeholder.
...
props ounziw.
fixes #25604 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27073 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 21:46:07 +00:00
Andrew Nacin
0558df56ce
Ensure compatibility with MySQL 5.6 which has stricter SQL modes by default.
...
Disables NO_ZERO_DATE, ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, STRICT_ALL_TABLES, TRADITIONAL. Introduces wpdb::set_sql_mode() with an incompatible_sql_modes filter so a plugin can alter the set mode after the fact.
props pento.
fixes #26847 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27072 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 21:38:34 +00:00
Scott Taylor
b8e7bbb0f2
Fix an error in SQL generation when perm
is set and an array is passed for post_status
. Adds unit test.
...
Props oso96_2000.
Fixes #25523 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27067 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 07:35:54 +00:00
Scott Taylor
99ef83d7aa
Add Unit Tests for get_comment_pages_count()
. Fix a notice caused when $wp_query->comments
is not set in that function.
...
Props mdbitz, markjaquith.
Fixes #20633 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27055 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-29 05:16:58 +00:00
Andrew Nacin
0406e11513
Basic unit tests and additional documentation for wp_strip_all_tags().
...
props joehoyle.
fixes #25507 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27042 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-27 03:15:29 +00:00
Andrew Nacin
c759a54b2c
Test framework: Parse CREATE TABLE queries the same way we do DROP TABLE queries.
...
props soulseekah.
fixes #24800 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27041 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-27 03:09:13 +00:00
Andrew Nacin
9b414abc2d
Remove duplicated and superceded balance tags unit tests.
...
props coffee2code.
fixes #26222 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27040 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-27 02:57:51 +00:00
Sergey Biryukov
344bcddbf7
Remove byte order mark (BOM) from GetUrlInContent.php. see #26171 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27019 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-23 09:49:27 +00:00
Scott Taylor
300cb7451e
Let is_attachment()
accept an $attachment parameter, similar to is_page()
and is_single()
. Adds Unit Tests for all 3.
...
Props alex-ye for the initial patch.
Fixes #24257 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27016 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-22 22:30:36 +00:00
Andrew Ozz
9aba880b53
Autosave: refactor autosave.js, use heartbeat for transport and move all "Add/Edit Post" related functionality to post.js. See #25272 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26995 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-22 04:55:37 +00:00
Andrew Nacin
d0bb9e8f86
Ensure that SSL YouTube URLs receive SSL embeds.
...
props adamsilverstein, Otto42, JayCC.
fixes #23149 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26978 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-17 19:45:51 +00:00
Scott Taylor
1a4a017923
Add (Q)Unit Tests for the wp.shortcode
JS class.
...
Fixes #26514 .
Props jorbin.
git-svn-id: https://develop.svn.wordpress.org/trunk@26976 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-17 18:01:34 +00:00
Andrew Nacin
5cb20092ce
make_clickable: When cleaning up accidental links within links, account for the tag being split by newlines.
...
props dd32.
fixes #19028 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26974 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-17 09:31:59 +00:00
Andrew Nacin
9f5c78b676
Unit tests for get_url_in_content(). Return false when no content is passed, to match the return value of no links being found.
...
props mdbitz.
#26171 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26972 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-17 07:46:33 +00:00
Andrew Nacin
b807bea28c
Test framework: Override PHPMailer during installation.
...
props bpetty.
fixes #26836 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26944 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-14 21:55:41 +00:00
Andrew Nacin
146bcccaa2
Update package.json. props TobiasBg. fixes #26629 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26940 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-13 18:20:38 +00:00
Andrew Nacin
ac39123beb
Tests: Add a placeholder file to the broken-theme directory so it isn't removed when synced to git.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26910 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-06 18:26:07 +00:00
Andrew Nacin
007e4ef160
Tracs are now forced SSL.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26909 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-06 18:09:12 +00:00
Sergey Biryukov
3852dd4936
Add unit test for [26874]. see #26728 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26875 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-28 05:24:32 +00:00
Sergey Biryukov
af9a2ca5e5
Add @ticket reference. see #26627 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26873 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-27 19:02:55 +00:00
Andrew Nacin
2105b8683d
Test runner: Extend WP_PHPUnit_Util_Getopt instead of PHPUnit_TextUI_Command to parse incoming options.
...
props wawco.
fixes #26725 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26871 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-27 15:07:07 +00:00
Scott Taylor
5cb2ad494e
Fix a regression for get_queried_object()
by checking for category_name
when cat
isn't set - mainly is_category()
being true for Uncategorized or when queried object is accessed in pre_get_posts
. Also check for $query['terms']
when trying to assign a term as the queried object when is_tax()
is true. Adds a unit test. See [26007] for how I originally broke this while fixing a bigger issue.
...
Props Chouby, jeremyfelt.
Fixes #26634 , #26627 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26864 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-22 18:30:09 +00:00
Andrew Nacin
4e10a092d1
Add unit test to verify all bundled themes have valid text domain declared.
...
fixes #26566 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26858 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-12 00:36:27 +00:00
Andrew Nacin
e159b7b28a
Unit Tests: Avoid using mime_content_type() as it fails miserably in PHP 5.2.
...
props bpetty.
fixes #26155 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26705 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-05 23:36:50 +00:00
Andrew Nacin
7b9c30f2e3
Remove certain accents in the Danish language.
...
props tlamedia.
fixes #23907 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26585 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-03 20:38:03 +00:00
Andrew Nacin
4cc8c5b241
Restore @ticket reference. Reverts [26093], see #25913 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26552 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-03 03:57:24 +00:00
Scott Taylor
8a10f4a942
Change comments in unit test to reflect patched scenario in #26339 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26511 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-02 00:03:39 +00:00
Scott Taylor
b595282dff
Fix lingering reference problem in wp_get_object_terms()
by not setting the foreach
'd vars to a reference. Adds unit test.
...
Props stephenharris.
Fixes #26339 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26510 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 23:59:13 +00:00
Sergey Biryukov
042370471c
Fix strict notices in Tests_POMO_PO.
...
props markoheijnen for initial patch.
fixes #25631 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26500 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 12:47:35 +00:00
Sergey Biryukov
d050f5d3ff
Use assertEqualSets() instead of direct array comparison.
...
fixes #26345
git-svn-id: https://develop.svn.wordpress.org/trunk@26490 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 00:42:39 +00:00
Sergey Biryukov
ce8d689ceb
Make sure the version extracted from readme.html does not include a newline.
...
fixes #26344 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26489 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 00:26:07 +00:00
Sergey Biryukov
a754d62f49
Update unit tests for convert_smilies(). see #25529 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26488 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 00:14:45 +00:00
Sergey Biryukov
efc2c12458
Restore @ticket reference. see #18897 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26479 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-29 21:23:49 +00:00
Helen Hou-Sandi
eaa7c65263
Add remove_option(), remove_options(), and get_options() methods to WP_Screen, along with unit tests. props ocean90, DrewAPicture. fixes #25799 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26456 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-28 05:09:06 +00:00
Peter Westwood
be669106d5
Unit Tests: Add the ticket number to the new tests. See #26290
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26431 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-27 14:47:03 +00:00
Peter Westwood
02ab2c69bb
Unit Tests: Add some simple test cases to highlight the types of html entity that kses currently blocks. See #26290
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26430 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-27 14:44:57 +00:00
Scott Taylor
3c671f031e
When setting WP_TESTS_FORCE_KNOWN_BUGS
to true
, it is preferable that some forced tests are still skipped when they call classes or functions that do not exist, producing fatal errors.
...
Fixes #26248 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26370 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-25 22:49:51 +00:00
Scott Taylor
1dc930ba13
Add unit tests for links_add_target()
. Alter the patterns in links_add_target()
and _links_add_target()
slightly based on learnings after running tests.
...
Props mdbitz.
Fixes #26164 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26328 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-22 16:24:25 +00:00
Scott Taylor
b209e63234
Introduce unit tests for the normalize_whitespace()
function.
...
Props mdbitz.
Fixes #26163 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26327 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-22 16:17:59 +00:00
Sergey Biryukov
27972a39a1
Skip image mime type tests if both fileinfo PHP extension and mime_content_type() function are missing.
...
fixes #26155 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26318 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-22 05:37:35 +00:00
Scott Taylor
926427e9ee
In update_meta_cache()
, ensure that meta is always stored in the same order. Removes an unnecessary $wpdb->prepare
statement. Adds unit test.
...
Props mattheu.
Fixes #25511 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26307 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-21 19:30:35 +00:00
Scott Taylor
72a3c91855
Mark test skipped when not in multisite. See #25883 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26305 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-21 19:13:53 +00:00
Scott Taylor
36a5af537e
Prefix the notoptions
cache key in the multisite site-options
group with $wpdb->siteid
to avoid collisions and race conditions when using a fancy multi-network setup. Adds unit test.
...
Fixes #25883 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26304 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-21 19:06:26 +00:00
Scott Taylor
ff4f1bb170
For unit tests that call wpmu_create_blog()
, Blog factory, or installation code that attempts to clear transients: suppress database errors on setUp
and restore on tearDown
.
...
There are a few places in core that were preventing this from working by explicity setting `$wpdb->suppress_errors` to `false`. Instead, they should inherit the value that existed before errors were suppressed.
This allows Multisite unit tests to run without explosive database errors, and allows `$wpdb->suppress_errors` to be overridden all the way down the chain.
Fixes #26102 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26252 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-18 20:44:34 +00:00
Sergey Biryukov
cbad0abaae
Normalize slashes in WP_Filesystem_MockFS::mkdir() and WP_Filesystem_MockFS::locate_parent_node() to avoid an infinite loop on Windows.
...
fixes #26091 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26246 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-18 15:32:47 +00:00
Andrew Nacin
f82e1c5d23
Add JavaScript tests for shortcode.js.
...
props jorbin, iandunn.
see #25784 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26222 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-15 20:40:54 +00:00
Scott Taylor
15c1c2f130
Don't place smilies inside of pre or code tags. Don't skip smilie after a smilie with an 8 in it. Fix regular expression used for smiley translations to work when there is only one registered emoticon.
...
Props solarissmoke, soulseekah, mdbitz, yonasy. ht to mdbitz for the Unit Tests and a comprehensive patch.
Fixes #16448 , #20124 , #25303 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26191 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-15 02:45:39 +00:00
Scott Taylor
5de39fc2f1
Remove the Featured Content term filters when running Unit Tests. Set the return value of wp_get_object_terms()
to a var before passing to array_shift()
in test_get_object_terms_types()
, which expects a var to be passed by reference.
...
See #25282 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26187 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-15 02:32:16 +00:00
Andrew Nacin
4bb79a2ce3
Add a unit test to confirm that the version number in readme.html matches version.php.
...
3.7.1 shipped with 3.7 in the readme. Not a big deal, but this should prevent it in the future.
git-svn-id: https://develop.svn.wordpress.org/trunk@26166 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-14 16:50:21 +00:00
Scott Taylor
6603f4802a
Always clean install in PHPUnit Tests.
...
Props bpetty.
Fixes #25871 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26095 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 22:14:24 +00:00
Scott Taylor
2ccc101050
Make HTML tag searches for <code>
and <pre>
case-insensitive in make_clickable()
.
...
Props bpetty.
Fixes #23756 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26094 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 21:53:08 +00:00
Scott Taylor
8120f2861c
The test for #5953 doesn't require the ticket to be closed for its assertions to pass.
...
See #25913 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26093 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 21:23:39 +00:00
Scott Taylor
a8e76ea8f9
Set the page_comments
option to true
in Tests_Canonical
to properly check canonical redirection for paged comments. By doing so, one assertion tied to #20388 no longer needs to be.
...
See #20388 , 25913.
git-svn-id: https://develop.svn.wordpress.org/trunk@26091 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 18:57:11 +00:00
Scott Taylor
3cbb68c3af
Avoid Out of range value for column 'post_parent'
error in Tests_Ajax_MediaEdit::_make_attachment()
by setting the default parent id to 0
instead of -1
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26088 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 17:51:29 +00:00
Scott Taylor
0fdff310fd
Fix a failing unit test: an XML-RPC unit test for getPosts with filters was failing. The cause of the failure: a set of posts was created with create_many() and then paginated results were requested. The paginated results were meant to equal the original resultset when diff'd after all pages were joined. create_many() was assigning the same timestamp to all posts, so the LIMIT clause in the generated SQL was not operating as expected. I replaced the create_many() call with a create() loop that increments time by 1 each time. Unit test now passes.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26087 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 17:45:36 +00:00
Scott Taylor
e86c049a50
Fix inexcusable whitespace in tests/phpunit/tests/post/query.php
.
...
Props wonderboymusic.
git-svn-id: https://develop.svn.wordpress.org/trunk@26056 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-08 23:13:41 +00:00
Scott Taylor
047f7fb8bd
Produce proper CAST
for DECIMAL
and NUMERIC
in Meta Query. Adds a bunch of unit tests.
...
Props ericlewis.
Fixes #23033 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26055 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-08 23:10:41 +00:00
Scott Taylor
cc19bb3a57
Respect the compare
operator value in meta_query
when value
evaluates to null
. Adds Unit Test.
...
Props bradyvercher, gradyetc.
Fixes #22967 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26053 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-08 22:51:03 +00:00
Scott Taylor
0670cf7cc4
Don't convert URLs inside <pre>
and <code>
tags when parsing string using make_clickable()
.
...
Adds Unit Tests.
Props johnjamesjacoby, helen, nacin, adamsilverstein, sirbrillig.
Fixes #23756 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26052 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-08 22:37:41 +00:00
Andrew Nacin
aacc286f7c
Use only one var per scope in our password-strength-meter tests.
...
props kadamwhite.
see #25187 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26040 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-07 20:40:12 +00:00
Sergey Biryukov
fc8d09e2a6
A negative term parent value should be sanitized to 0, not 1. Fix a regression in sanitize_term_field() caused by [26010].
...
props mattheu for initial patch.
fixes #25852 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26028 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-06 23:40:46 +00:00
Scott Taylor
d8f57f88ad
Respect paged
when offset
is used in WP_Query
. Adds unit tests.
...
Props coffee2code.
Fixes #18897 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26012 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-05 01:34:44 +00:00
Scott Taylor
ed22220a0f
Cast proper fields to int
when returning from wp_get_object_terms()
. Add term_taxonomy_id
and object_id
to the list in sanitize_term()
and sanitize_term_field()
.
...
Fixes #17646 . Adds unit tests.
Props simonwheatley, dd32, kovshenin.
git-svn-id: https://develop.svn.wordpress.org/trunk@26010 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-05 01:18:02 +00:00
Scott Taylor
0923b7b93a
Category and tag are typically checked before checking for a custom taxonomy. If the global query matches category or tag (even if it also has tax_query set), return category/tag as the queried object, instead of arbitrarily returning the first term in the tax_query
stack (typically those added with 'pre_get_posts').
...
Real world example: http://www.emusic.com/17dots/topics/daily-download/ - "tag" page, regionalized for US-only content using `pre_get_posts` passing in the terms "US" and "ALL" for "region" (custom tax). All of the theme functions would output "ALL" as the term name. Even though it was a tag archive, the queried object was an arbitrary term from `tax_query`.
See [26006]. All unit tests pass.
Fixes #20767 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26007 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-04 23:53:55 +00:00
Scott Taylor
5321bc4957
WP_UnitTestCase::go_to()
tried its best to clean up global space, but ultimately fell short. Because it was blowing away WP
every time it was called, it was dropping all the query vars that were registered for custom taxonomies and custom post types (ouch).
...
Introduces `_cleanup_query_vars()`. This is a prerequisite for the unit tests on #20767 . All unit tests pass with this change.
See #20767 .
Fixes #25818 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26006 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-04 22:46:44 +00:00
Scott Taylor
2f38d2efc6
Move Tests_Query_Conditionals::assertQueryTrue()
to WP_UnitTestCase
. It should be available to all unit test classes. The conditionals class is huge, other classes are necessary for better coverage.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@26005 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-04 21:55:12 +00:00
Scott Taylor
ecbcfc5a20
Set the default parent id to 0, instead of -1, in Tests_Post_Attachments::_make_attachment()
. Prevents Out of range value for column 'post_parent'
database error without papering over it in core.
...
See #25282 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26004 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-04 21:39:35 +00:00
Andrew Nacin
5c63859ffb
Add jshintrc to qunit.
...
props jorbin.
see #25187 .
git-svn-id: https://develop.svn.wordpress.org/trunk@25992 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-30 14:38:37 +00:00
Andrew Nacin
9b9311ae2b
Move the unit test added in [25974] to the more appropriate file. see #25750 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@25975 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-29 01:47:48 +00:00
Andrew Nacin
2cac0fde8a
Avoid resetting the 'hierarchical' argument in get_pages() when 'parent' is -1, the default.
...
Fixes a regression introduced in [25270]. Adds unit tests.
props chrisbliss18.
fixes #25750 .
git-svn-id: https://develop.svn.wordpress.org/trunk@25974 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-29 01:46:01 +00:00
Sergey Biryukov
ddf0147a4f
Move test_get_pages_include_exclude() and test_get_pages_parent() to tests/post/getPages.php. Add a @ticket reference. see [25168] and [25244].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@25972 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-28 21:49:27 +00:00
Andrew Nacin
add8bc4e57
Add a $taxonomy argument to each of the adjacent post functions.
...
Each took an array of category (IDs) when to search. Those can now be term IDs and each function now has $taxonomy = 'category' as an optional argument.
Functions affected: get_previous_post(), get_next_post(), get_adjacent_post(), get_adjacent_post_rel_link(), adjacent_posts_rel_link(), next_post_rel_link(), prev_post_rel_link(), get_boundary_post(), get_previous_post_link(), previous_post_link(), get_next_post_link(), next_post_link(), get_adjacent_post_link(), adjacent_post_link().
props ethitter.
finally fixes #17807 .
git-svn-id: https://develop.svn.wordpress.org/trunk@25959 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-27 21:39:51 +00:00
Andrew Nacin
90b55d0279
Fix the exclude_tree argument in get_terms(), which fixes the exclude argument in wp_list_categories().
...
This was a 3.7 regression caused by [25162].
props dd32.
see #25710 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@25933 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-26 15:03:10 +00:00
Andrew Nacin
559dc21202
3.7 regression from [25119]: Have in_category() return false when the first argument is empty.
...
Adds unit tests.
props ericlewis.
fixes #25706 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@25923 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-26 02:53:30 +00:00