Scott Taylor
3708cdc7c2
Bring back `define( 'WP_INSTALLING', true );` in `phpunit/includes/install.php`, which was removed in [28965]. tl;dr = wp-cli. Unit tests still pass in multisite because of the skips I added.
...
Fixes #28738 , #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28988 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-04 01:38:43 +00:00
Sergey Biryukov
ff3644a220
Fix texturization of quotes when enclosed by angle brackets.
...
props miqrogroove.
fixes #28718 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28971 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 16:21:18 +00:00
Scott Taylor
16aa589a07
URLs need to be generated, not hard-coded, in `user/listAuthors.php` test.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28968 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 02:13:08 +00:00
wonderboymusic
26aa4e4e7f
Make sure permalink structure is consistent when running query tests.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28967 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 01:50:02 +00:00
Scott Taylor
f23a5ef832
Setup rewrite changes in tests in a predictable fashion. Don't mix method calls with wrapper function calls.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28966 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 01:42:57 +00:00
Scott Taylor
73bde8a278
Transient timeouts are untestable when `WP_INSTALLING` is defined and set to ANY value. Transient timeouts cannot be tested during multisite runs because `wpmu_create_blog()` sets `WP_INSTALLING`. I have zero idea how these tests ever passed.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28965 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 01:16:33 +00:00
Scott Taylor
80a817ebcc
Make sure hundreds of canonical tests don't fail in multisite every other time they are run.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28964 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 00:49:32 +00:00
Scott Taylor
4379ec80d6
This test in `post/revisions.php` is too misleading and doesn't work as expected since multiple queries can occur before the one that is intended for testing.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28962 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 19:56:50 +00:00
Scott Taylor
d38227dbae
`test_wp_get_shortlink()` assumes permalink structure is '' when it starts. It is not.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28961 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 19:49:05 +00:00
Scott Taylor
59b255c445
URLs in unit tests need to be generated, not hard-coded.
...
See #28706 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28960 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 19:44:08 +00:00
Sergey Biryukov
00a3c15185
Reorder test functions in term.php for consistency. Add @ticket references.
...
see #26570 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28953 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 01:49:41 +00:00
Sergey Biryukov
2ce93f915d
Clarify the docs and add more unit tests for wp_set_object_terms().
...
props DrewAPicture.
fixes #26570 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28951 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 01:27:07 +00:00
Scott Taylor
9ab7f4b144
Avoid polluted `$table_prefix` and `$_wp_switched_stack` in multisite unit tests.
...
Add `WP_TESTS_TABLE_PREFIX` in `bootstrap.php` to ensure the original value for `$table_prefix` is always available.
Props jeremyfelt.
Fixes #28692 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28943 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-01 18:51:46 +00:00
Sergey Biryukov
99d75b6acb
Make wp_kses_no_null() remove any invalid control characters in a string.
...
props mauteri, miqrogroove.
fixes #28506 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28942 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-01 18:00:50 +00:00
Sergey Biryukov
92a7523362
Asterisk is an allowed character in a URI and should not be stripped out by wp_sanitize_redirect().
...
fixes #28362 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28939 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-01 15:55:04 +00:00
Sergey Biryukov
8b0ef058f3
WP_Date_Query: The inclusive logic should include all times within the date range.
...
props mboynes, oso96_2000, DrewAPicture.
fixes #26653 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28935 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-01 01:17:39 +00:00
Sergey Biryukov
a756c57fd9
Add @expectedIncorrectUsage to Tests_Taxonomy::test_register_long_taxonomy().
...
see #28683 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28926 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-30 15:09:52 +00:00
Andrew Nacin
9e24832a0e
Add initial unit tests for multisite's bootstrap.
...
props jeremyfelt.
fixes #27884 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28910 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-29 22:50:44 +00:00
Andrew Nacin
02094174f9
Add index key support for wp_list_pluck(), à la array_column().
...
props trepmal.
fixes #28666 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28900 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-29 21:25:21 +00:00
John Blackbourn
3c77cf1140
Introduce `is_https_url()` for testing whether the scheme for a given URL is `https`. See #28487 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28894 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-29 11:31:25 +00:00
Scott Taylor
56e66c79b4
`wp_extract_urls()` should not match dates.
...
Updates unit tests.
Props hinnerk, sergej.mueller.
Fixes #28222 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28882 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-28 04:15:30 +00:00
Scott Taylor
dca6040b0b
In multisite, on the `updated_option` action, if the option name is one of: 'blogname', 'siteurl', 'post_count' - refresh the blog details cache for the current blog id.
...
Adds unit test.
Props kovshenin.
Fixes #26410 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28881 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-28 04:06:12 +00:00
Scott Taylor
c2b7f8022c
Add `->get_quality()` method to `WP_Image_Editor` class.
...
Adds unit tests.
Props markoheijnen.
Fixes #28154 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28879 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-28 03:49:55 +00:00
SergeyBiryukov
bc83ca24d4
Use correct data providers.
...
props miqrogroove.
see #28564 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28860 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 19:07:03 +00:00
Sergey Biryukov
f09a6ee73c
Use correct data provider.
...
see #27426 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28859 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 18:59:55 +00:00
Sergey Biryukov
146bcaa937
XML-RPC: Make sure wp.newPost does not produce a fatal error when a post_date field is included in the data.
...
props dllh.
fixes #28601 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28854 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 17:42:17 +00:00
Scott Taylor
0f45c941f6
Fix `wpautop()` unit tests. See #25646 , #22230 , #25856 .
...
Props rachelbaker.
Fixes #28638 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28853 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 17:27:49 +00:00
Scott Taylor
8103dc5ade
Use less greedy regex in `wptexturize()`. Adds unit tests.
...
Props miqrogroove.
See #28564 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28852 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 17:14:47 +00:00
Scott Taylor
b917e7998d
`get_blog_details()->post_count` should update on more actions than just `publish_post`.
...
Adds unit test.
Props 5um17, midxcat, strangerstudios.
Fixes #27952 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28835 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 00:52:25 +00:00
Scott Taylor
96484fd3f9
Optimize the `wptexturize()` loop:
...
* Take the ampersand pattern out of the loop for speed.
* Fix old bugs in the ampersand pattern.
* Refactor `_wptexturize_pushpop_element()` without PCRE for speed.
* Update unit tests.
Props miqrogroove.
Fixes #28623 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28831 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-25 17:48:20 +00:00
Scott Taylor
73fe9d548b
Ensure that a `has_children` parameter is given to `Walker::start_el()`.
...
Adds unit tests.
Props scribu, obenland.
Fixes #14041 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28824 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-24 17:05:56 +00:00
Sergey Biryukov
ddaf46505d
Add @ticket references.
...
see #27268 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28819 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-24 03:54:52 +00:00
Scott Taylor
882f41cb64
Add unit tests for [28817].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28818 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-24 00:54:22 +00:00
Scott Taylor
220fda0095
In `$wpdb->update()`, prevent explosions when `$where` is empty.
...
Adds unit tests.
Props UmeshSingla, wonderboymusic.
Fixes #26106
git-svn-id: https://develop.svn.wordpress.org/trunk@28814 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-24 00:23:09 +00:00
Sergey Biryukov
ee307dc160
Use assertCount() for consistency with other tests.
...
see #28611 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28809 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-23 22:26:12 +00:00
Sergey Biryukov
f7d7ecd0a6
Prevent multiple hierarchical posts with the same slug from being displayed in single post template.
...
fixes #28611 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28803 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-23 13:14:39 +00:00
Sergey Biryukov
f393fecbc5
Add @ticket references.
...
see #16854 , #19198 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28800 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-22 01:40:38 +00:00
Scott Taylor
5c48c4f8a8
Allow `wp_die()` to die in plain text when running the test suite.
...
Props jorbin.
Fixes #27749 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28797 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-21 19:59:28 +00:00
Scott Taylor
a7c1728f2e
Reinstate the changes from [28579] with some adjustments:
...
* Check `! empty( $postarr['file'] )` before calling `update_attached_file()`
* Add a unit test: `test_update_attachment_fields()`
* Run the same logic for empty `guid` for attachments that always ran in `wp_insert_post()`, as per #18310 . This fixes a unit test that would have broken when this ticket was marked closed.
* Updated the unit test in `Tests_Media::test_wp_prepare_attachment_for_js()` to account for `url` no longer being empty
Props kovshenin, wonderboymusic.
See #21963 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28788 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-20 18:26:17 +00:00
Scott Taylor
33275a0826
Cleanup after [28671]:
...
* Set better defaults in `paginate_links()`, so that themes don't have to calculate them on their own, like Twenty Fourteen does now.
* Don't set page 1 to `?page=1` or `/page/1/` - that will force a canonical redirect.
* Add and cleanup unit tests
Props obenland, SergeyBiryukov, wonderboymusic.
Fixes #24606 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28785 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-20 17:11:14 +00:00
Scott Taylor
5ec545d5ab
Revert [28613] and [28664]. A good idea, but too much BC baggage.
...
See #28099 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28783 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-20 16:20:35 +00:00
Scott Taylor
0688f9eb49
In `wptexturize()` + tests:
...
* Allow well-formed HTML inside of shortcode attributes
* Restrict recursion. HTML is allowed but ignored.
* Do not allow exotic HTML comments in shortcode attributes.
* Continue to ignore the [ and ] chars if they appear in any HTML attribute.
* Update related regex patterns.
* Update unit tests.
Props miqrogroove.
Fixes #28564 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28773 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-18 19:48:46 +00:00
Andrew Ozz
b8fd9d997e
TinyMCE: update to 4.0.28+. Includes all changes until 09-06-2014: 32cb108d41
. Changelog: 32cb108d41/changelog.txt
.
...
See #28391 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28768 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 23:49:00 +00:00
Scott Taylor
b11edb94d9
Fix abbreviations mixed with quotes, example: `'99% of people'`.
...
Add/alter unit tests.
Props miqrogroove.
Fixes #26850 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28765 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 20:18:38 +00:00
Scott Taylor
1f4d925102
In `wptexturize()`, adjust for the treatment of abbreviated years at the end of quotations.
...
Silence some unit tests that have never passed and may no longer be applicable.
Props miqrogroove.
Fixes #18549 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28764 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 20:13:54 +00:00
Scott Taylor
6f658551d6
Add unit tests to confirm that `---` is properly converted to `—` by `wptexturize()` where appropriate.
...
Props miqrogroove.
Fixes #28483 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28763 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 18:06:12 +00:00
Scott Taylor
14f3b15d69
Add Unit Tests for i18n and `wptexturize()`. Don't confuse closing single quotes and apostrophes.
...
See #27426 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28762 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 17:56:08 +00:00
Scott Taylor
03a6e5f1fb
`wptexturize()` adjustments:
...
* Only place an apostrophe before a number when it has exactly two digits.
* Never match '99' with the single prime pattern.
* Always assume '99' is an abbreviated year at the end of a quotation.
* Add unit tests.
* Resolves the unit test broken in [28721] for #8775 .
See #26850 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28761 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 17:40:07 +00:00
Dominik Schilling (ocean90)
106e1dbedb
Use the value of `WP_TESTS_DOMAIN` in some unit tests.
...
props danielhuesken.
fixes #28552 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28757 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-16 15:07:37 +00:00
Scott Taylor
eadc17c4f9
In `wp_insert_term()`, when no slug is provided, check for an existing term by name. If it exists, use that slug instead of calling `sanitize_title( $name )`.
...
Prevents creating an endless number of terms like `A+` or `$$$$` in any given taxonomy.
Props wonderboymusic, SergeyBiryukov, aaroncampbell.
Fixes #17689 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28733 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-11 02:27:36 +00:00
Scott Taylor
821c052473
In `wptexturize()`, ensure that texturization does not corrupt contents of HTML elements, HTML comments, and smartcode attributes.
...
Adds a variety of unit tests/assertions.
Props miqrogroove.
Fixes #12690 , #8912 , #27602 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28727 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 14:33:16 +00:00
Scott Taylor
9e347a40c2
In `wptexturize()`, allow dashes before and after curly quotes. Example: This is what she said---"Wow that is cool."
...
Adds unit tests.
Props adamsilverstein, miqrogroove.
Fixes #20342 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28726 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 14:21:36 +00:00
Scott Taylor
66b539bdab
`wptexturize()` should handle apostrophes before primes.
...
Props nacin, miqrogroove.
Fixes #22823 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28725 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 14:13:52 +00:00
Scott Taylor
013f3f14e3
Fix curly quotes around numbers when applicable.
...
Adds unit tests.
Props filosofo, mrmist, aliso, MikeHansenMe, miqrogroove.
Fixes #8775 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28721 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 02:42:35 +00:00
Scott Taylor
a66f776684
In `wptexturize()`, don't convert C-style hexadecimals to mathematical `×`.
...
Adds unit tests.
Props harrym, kurtpayne, miqrogroove.
Fixes #19308 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28719 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 02:17:24 +00:00
Scott Taylor
f9bcf40db7
In `wptexturize()`, treat ` ` like whitespace when texturizing hyphens.
...
Adds unit tests.
Props redsweater, miqrogroove.
Fixes #23185 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28718 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 02:08:05 +00:00
Scott Taylor
db7816dd0c
`smilies_init()`, treat ` ` like whitespace when converting smilies.
...
Adds unit tests.
Props miqrogroove.
Fixes #27587 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28717 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 02:02:23 +00:00
Scott Taylor
97bacb3121
Ensure that `shortcode_unautop()` treats ` ` like whitespace.
...
`shortcode_unautop()` and `wptexturize()` now use `wp_spaces_regexp()` instead of raw regex.
Adds unit tests.
Props miqrogroove.
See #27588 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28716 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 01:54:11 +00:00
Scott Taylor
cfe11de507
Fix a unit test for the now deprecated function `like_escape()`.
...
Props miqrogroove.
Fixes #10041 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28714 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 01:21:33 +00:00
Scott Taylor
4459acb59d
Remove unnecessary `->test()` method from `Tests_Canonical_HTTPS` to avoid PHP error.
...
See [28704].
git-svn-id: https://develop.svn.wordpress.org/trunk@28713 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 01:09:43 +00:00
Scott Taylor
2a551f57a4
`LIKE` escape sanity:
...
* Deprecate `like_escape()`
* Add a method to `$wpdb`, `->esc_like()`, and add unit tests
`$wpdb::esc_like()` is not used yet. As such, many unit tests will throw `Unexpected deprecated notice for like_escape`. Subsequent commits will alleviate this.
Props miqrogroove.
See #10041 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28711 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 00:29:35 +00:00
Scott Taylor
12e325582a
Update unit tests to reflect:
...
* [28673] - title attributes are no longer expected to be present in some assertions
* [28704] - Fix `Declaration of Tests_Canonical_HTTPS::test() should be compatible with Tests_Canonical::test($test_url, $expected, $ticket = 0)`
* [28679] - Add `@expectedDeprecated get_all_category_ids`
git-svn-id: https://develop.svn.wordpress.org/trunk@28706 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-09 15:58:16 +00:00
John Blackbourn
65890b4858
Add some basic unit tests for HTTPS canonical redirects. See #27954 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28704 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-09 01:05:46 +00:00
Sergey Biryukov
4fde71e75d
Avoid an empty href attribute in paginate_links(). Add unit tests.
...
props obenland, Nessworthy.
fixes #24606 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28671 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-05 02:09:12 +00:00
Scott Taylor
ee9f2e48bb
After [28613], also kill queries that explicityly pass empty arrays to `category__in`, `tag__in`, `tag_slug__in`, and `author__in` to `WP_Query`.
...
Adds unit tests.
Fixes #28099 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28664 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-04 17:49:26 +00:00
Scott Taylor
1ffe74ad6f
Fix SQL generation when `meta_query` has an `'relation' => 'OR'` for its queries and wants to `'orderby' => 'meta_value'`.
...
Adds unit test.
Props jackreichert.
Fixes #25538 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28659 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-04 05:47:19 +00:00
Sergey Biryukov
4ecfd017b8
Capitalize 'ID' correctly to avoid random failures of Tests_Tax_Query::test_term_taxonomy_id_field_no_taxonomy().
...
see #25284 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28647 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-01 03:17:16 +00:00
Scott Taylor
273fd5ca4c
Add more test coverage for `wpdb`.
...
See #26999 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28635 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-30 19:17:15 +00:00
Scott Taylor
1a1994b20f
Adds a unit test to demonstrate that the order of `case` and `default` in a `switch` statement does not matter.
...
See #27882 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28631 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-30 17:31:51 +00:00
Scott Taylor
7f49c1320a
`@uses` means something entirely different for unit tests. More: http://thephp.cc/viewpoints/blog/2014/03/phpunit-4-0-code-coverage-improvements
...
Code coverage analysis takes forever to run, and these annotations will cause it to fail in the middle.
See #26999 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28625 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 23:33:13 +00:00
Scott Taylor
8bb2117aad
If `post_status` is passed to `WP_Query` as an array containing `'any'` and anything else, don't exclude the other values if they match when running `any`'s exclusion logic.
...
Adds unit tests.
Fixes #28007 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28622 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 20:41:53 +00:00
Scott Taylor
eba9bf7171
These unit tests should point at an actual attachment file.
...
See [28619].
git-svn-id: https://develop.svn.wordpress.org/trunk@28621 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 20:39:05 +00:00
Scott Taylor
fcff169970
Add unit tests to confirm that `post__in` orderby is working as expected with `menu_order` based on comments from #28012 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28619 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 18:23:58 +00:00
Scott Taylor
8530693a51
If `post__in` or `post_parent__in` is passed to `WP_Query` as an empty array, nuke the query. Both vars are currently only checked for truthiness after which they are ignored. Setting these vars at all indicates explicit filtering being desired.
...
Adds unit test.
Fixes #28099 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28613 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 06:03:15 +00:00
Andrew Nacin
961459ee31
Forcing SSL logins now forces SSL for the entire admin, with no middle ground.
...
fixes #10267 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28609 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-29 03:58:41 +00:00
Sergey Biryukov
1140c47c30
Exclude 'test-image.bmp' from the list of non-displayable image types.
...
props atimmer.
fixes #28386 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28603 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-28 22:20:36 +00:00
Scott Taylor
4dd4a32cde
In `wp_get_object_terms()`, before returning terms (and before running them through the 'wp_get_object_terms' filter) - run them through `$terms = array_values( array_unique( $terms, SORT_REGULAR ) )`.
...
There will be "dupes" when the function is called with `'fields' => 'all_with_object_id'`, but the objects will actually be unique due to the `object_id` addition, so they shouldn't be filtered out.
Adds unit tests. All other unit tests pass.
Fixes #11003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28583 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-27 03:28:05 +00:00
Scott Taylor
b2db40a694
Add unit tests for functions in `wp-includes/category.php`.
...
Props mdbitz.
Fixes #28119 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28566 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 21:07:18 +00:00
Scott Taylor
e2a124a911
When adding queries to `tax_query`: if the query's `field` is `term_taxonomy_id`, don't require `taxonomy` to be specified. In `WP_Tax_Query::transform_query()`, `$query['taxonomy']` is never checked for the 'term_taxonomy_id' `case` because 'term_taxonomy_id' is the primary key being looked up.
...
Adds unit tests.
Props helen.
Fixes #25284 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28562 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 19:58:52 +00:00
Scott Taylor
1061a15eaf
Allow `get_comments_number()` to officially accept `$post` or `$post_id`. Adds unit tests.
...
Props coffee2code, JanHenkG.
Fixes #26240 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28558 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 17:43:03 +00:00
Sergey Biryukov
5edb7a633f
Remove unnecessary array_reverse() from wp_get_post_revisions().
...
WP_Query properly handles multiple 'orderby' values since [28541].
fixes #26042 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28543 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:50:11 +00:00
Scott Taylor
0baa73f2e4
Apply `order` to each passed value for `orderby` in `WP_Query`:
...
* Since `orderby` in `WP_Query` can accept space-delimited sets, yet only one `order` value: when multiple values are passed (and `DESC` is the order), the default sort order `ASC` is being applied to all values before the last in the set.
* There is a unit test that sporadically fails since 3.6 in `tests/post/revision` due to multiple posts having the same `post_date` from being added so rapidly
* When ordering revisions in `wp_get_post_revisions()`, order by `post_date ID`
* Change the `order` value in `wp_get_post_revisions()` to `ASC`. This will produce SQL like: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC`. Previously, this would have produced SQL like: `ORDER BY $wpdb->posts.post_date DESC`, and with the addition of ` ID`: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID DESC`. Clearly, wrong. The original SQL produced: `ORDER BY $wpdb->posts.post_date DESC`. As such, return the reversions in reverse order using `array_reverse()`. Not doing so would break "Preview Changes."
* Add unit tests to assert that all of this works.
* All existing unit tests pass with the change to ordering multiple `orderby`s in `WP_Query`.
* In the future, we should support independent `order` for each `orderby`, see #17065 .
Props SergeyBiryukov, wonderboymusic.
Fixes #26042 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28541 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:18:11 +00:00
Scott Taylor
bf54ad6054
Add missing access modifiers to methods in `WP_Query`. Add magic methods for `__get()`, `__set()`, `__isset()`, `__unset()`, and `__call()`.
...
Add unit test for magic methods.
See #27881 , #22234 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28523 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:48:56 +00:00
Scott Taylor
d6a3c2a0de
Add access modifiers to methods and members of list table classes:
...
* `WP_List_Table` is the base class that implements `__get()` and `__call()` for BC
* Adds unit tests to confirm that subclasses properly inherit magic methods
* Add modifiers to subclasses: `WP_Links_List_Table`, `WP_Media_List_Table`, `WP_MS_Sites_List_Table`, `WP_MS_Themes_List_Table`, `WP_MS_Users_List_Table`, `WP_Plugin_Install_List_Table`, `WP_Plugins_List_Table`, `WP_Posts_List_Table`, `WP_Terms_List_Table`, `WP_Theme_Install_List_Table`, `WP_Themes_List_Table`
See #27881 , #22234 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28493 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 01:16:16 +00:00
Scott Taylor
85ac5c214d
Add a unit test that demonstrates a magic getter.
...
See #27881 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28480 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-18 21:14:13 +00:00
Scott Taylor
17edee17af
Eliminate the use of `extract()` in `the_taxonomies()`. Adds unit test.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28421 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 05:24:54 +00:00
Scott Taylor
3e54a1fab5
Eliminate use of `extract()` in `get_the_taxonomies()`. Adds unit test.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28415 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 03:50:46 +00:00
Scott Taylor
c47d71feb2
Add unit tests for `wp_list_pages()`.
...
Props MikeHansenMe.
See #27326 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28400 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:17:37 +00:00
Scott Taylor
e4a800238f
Eliminate use of `extract()` in `wp_dropdown_pages()`.
...
Adds unit tests to: `tests/post/template.php`.
There was previously only one wimpy assertion for `wp_dropdown_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28399 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:11:21 +00:00
Scott Taylor
21e0370e5c
Eliminate use of `extract()` in `wp_link_pages()`.
...
Adds unit tests to a new file: `tests/post/template.php`.
There were previously no unit tests for `wp_link_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28398 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 00:43:40 +00:00
Scott Taylor
9e07b1037e
Eliminate use of `extract()` in `paginate_links()`. Adds unit tests. Moves `tests/general/template.php` (which only had one method) to `tests/general/paginateLinks.php`.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28397 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-14 22:28:08 +00:00
Scott Taylor
77731c03fc
Eliminate use of `extract()` in `wp_get_archives()`.
...
Adds unit tests: `tests/functions/getArchives.php`.
All other unit tests pass.
Props MikeHansenMe, wonderboymusic.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28379 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 04:28:56 +00:00
Scott Taylor
4e0809e3e4
Eliminate use of `extract()` in `wp_insert_category()`. Adds unit tests. All unit tests pass.
...
Props MikeHansenMe.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28374 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 03:26:51 +00:00
Scott Taylor
b70967302b
In `get_the_author_posts()`, if there is no current `$post`, return `0` and bail.
...
Props krogsgard, aaroncampbell.
Fixes #27998 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28362 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-11 00:25:29 +00:00
Andrew Nacin
cb022f4957
Multisite: Treat 'www' as a special subdomain, reversing 3.9 regression.
...
props jeremyfelt.
fixes #27927 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28280 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-06 05:31:12 +00:00
Scott Taylor
89ecbcc7cb
In `WP_Date_Query::get_sql_for_subquery()`, don't parse duplicate parameters - only parse one of `w` and `week` or `month` and `monthnum`.
...
Adds unit tests.
Props oso96_2000, ChriCo.
Fixes #25835 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28252 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-04 23:06:07 +00:00
Andrew Nacin
790cb99b27
Shortcode JS: Avoid errors when an escaped shortcode includes a newline between brackets.
...
props gcorne.
props Clorith, jorbin for tests.
see #27907 , for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28223 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-01 03:36:27 +00:00
Dominik Schilling (ocean90)
a13b695fbd
Customizer: Allow to skip cropping header images if image width is smaller than or equal to theme width.
...
Add tests.
see #27936 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28219 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 20:24:28 +00:00
Dominik Schilling (ocean90)
fd26def119
Revert [28217].
...
Misfired commit for #27936 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28218 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 20:17:59 +00:00
Dominik Schilling (ocean90)
5d8f69e0c5
Recent Posts Widget: Use `ob_end_flush()` instead of `ob_flush()`.
...
`ob_end_flush()` flushes the output buffer *and* turns output buffering off, same as `ob_get_flush()`.
props m_i_n.
see #28009 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28217 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 14:20:05 +00:00