Commit Graph

418 Commits

Author SHA1 Message Date
Andrew Ozz 23d876d86a Tests Autop: remove <option> from the list of inline tags. It is valid only in specific context (<select>, <optgroup> or <datalist>) and should not be wrapped in <p>. Props kovshenin, fixes #28217.
git-svn-id: https://develop.svn.wordpress.org/trunk@29328 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-29 19:02:36 +00:00
Dominik Schilling (ocean90) 0f93a72879 Remove unit test for `is_https_url()`, see [29309].
see #28487.

git-svn-id: https://develop.svn.wordpress.org/trunk@29310 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-27 17:18:19 +00:00
Scott Taylor 1cbe1cec12 In `sanitize_file_name()`, replace `%20` and `+` with dashes. Remove unnecessary code from `_wp_handle_upload()`.
Adds unit tests.

Props ericmann.
Fixes #16330.


git-svn-id: https://develop.svn.wordpress.org/trunk@29290 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-24 22:08:09 +00:00
Helen Hou-Sandi c72d29e63e Revert [29267], as it causes unit test breakage and appears unnecessary. see #28986.
git-svn-id: https://develop.svn.wordpress.org/trunk@29274 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-23 02:22:57 +00:00
Scott Taylor 7f9edd3e69 After [29251], set the array keys in `WP_UnitTestCase::$hooks_saved` to prevent notices in 3rd party use cases.
Props danielbachhuber.
Fixes #28986.



git-svn-id: https://develop.svn.wordpress.org/trunk@29267 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-22 17:21:40 +00:00
Scott Taylor 77ee35c4eb `wp_script_is( ..., 'enqueued' )` needs to check dependencies recursively - a single item's dependencies may only be a subset of the full dependency tree. Adds a new method on `WP_Dependencies` called `->recurse_deps()`.
Adds unit test.

Props wonderboymusic, SergeyBiryukov, mikejolley.
Fixes #28404.


git-svn-id: https://develop.svn.wordpress.org/trunk@29252 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-20 00:28:57 +00:00
Scott Taylor 36e455d018 Backup filter globals ( `$merged_filters, $wp_actions, $wp_current_filter, $wp_filter` ) statically when running unit tests, restore on `tearDown()`. This ensures that all tests initially use the same filters/actions.
Props mnelson4, wonderboymusic.
Fixes #28535.


git-svn-id: https://develop.svn.wordpress.org/trunk@29251 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 23:58:07 +00:00
Scott Taylor ca5d586b8e After [29200], switch back to using `static` vars instead of adding 2 `global`s, as per Sergey.
Fixes #28697.


git-svn-id: https://develop.svn.wordpress.org/trunk@29250 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 23:13:19 +00:00
Scott Taylor a1aa518788 Call `untrailingslashit()` when adding a theme directory in `register_theme_directory()`. This prevents double-slashing in generated URLs. Don't add a directory if it is already present.
Adds unit tests.
Props obenland, wonderboymusic.
Fixes #28662.


git-svn-id: https://develop.svn.wordpress.org/trunk@29249 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 23:06:54 +00:00
Scott Taylor 150e1367b4 In `get_adjacent_post()`, make `$excluded_terms` work as expected.
Adds unit tests.
Props jessepollak, kovshenin.
Fixes #22112.


git-svn-id: https://develop.svn.wordpress.org/trunk@29248 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 22:26:43 +00:00
Andrew Nacin 97fcbef707 Tie cookies and nonces to user sessions so they may be invalidated upon logout.
Sessions are stored in usermeta via WP_User_Meta_Session_Tokens, which extends the abstract WP_Session_Tokens class. Extending WP_Session_Tokens can allow for alternative storage, such as a separate table or Redis.

Introduces some simple APIs for session listing and destruction, such as wp_get_active_sessions() and wp_destroy_all_sessions().

This invalidates all existing authentication cookies, as a new segment (the session token) has been added to them.

props duck_, nacin, mdawaffe.
see #20276.


git-svn-id: https://develop.svn.wordpress.org/trunk@29221 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-18 09:12:05 +00:00
Andrew Ozz db9a148b34 TinyMCE:
- Update to 4.1.2, changelog: https://github.com/tinymce/tinymce/blob/master/changelog.txt
- Update the tests to 4.1.2.
Fixes #28576.

git-svn-id: https://develop.svn.wordpress.org/trunk@29203 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-17 00:58:41 +00:00
Scott Taylor bda6f0cffe Properly set `$subdomain_error` to `false` when applicable in `ms_subdomain_constants()`. This was previously untestable because it used static vars: use globals instead.
Adds unit test.
Fixes #28697.


git-svn-id: https://develop.svn.wordpress.org/trunk@29200 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-16 22:34:18 +00:00
Scott Taylor 17d67d93e7 Make `has_shortcode()` recursive/work for nested shortcodes.
Adds unit test.

Props katzwebdesign.
Fixes #26343.


git-svn-id: https://develop.svn.wordpress.org/trunk@29197 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-16 22:04:08 +00:00
Scott Taylor 722930611c Avoid a race condition when multiple windows are open so that orphaned terms cannot be created by accident.
Adds a unit test.

Props dlh.
Fixes #19205.


git-svn-id: https://develop.svn.wordpress.org/trunk@29196 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-16 21:51:40 +00:00
Sergey Biryukov 092e51042c Use assertEqualSets() instead of direct array comparison.
see #28434.

git-svn-id: https://develop.svn.wordpress.org/trunk@29134 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-13 11:27:07 +00:00
Scott Taylor d97b10eecf Wouldn't it be incredible if you could run Unit Tests without all of your uploads being indiscriminately blown away and your upload folder permissions being destroyed?
The Future Is Now.

Fixes #28847.


git-svn-id: https://develop.svn.wordpress.org/trunk@29120 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-12 07:08:15 +00:00
Peter Westwood 52aa1804e4 XMLRPC: Restore support in wp.newPost for dates to be supplied in the structured dateTime.iso8601 format as well as still supporting dates specified as strings.
Fixes #28601.


git-svn-id: https://develop.svn.wordpress.org/trunk@29063 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-10 14:16:20 +00:00
Peter Westwood c89afd5a59 XMLRPC: Extend the test cases from [28854] so that we also test valid date based strings. See #28601.
git-svn-id: https://develop.svn.wordpress.org/trunk@29062 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-10 14:05:22 +00:00
Peter Westwood 24852d4305 XMLRPC: Improve the test case from [28854] so that it truely tests an invalid date string like the test name implies. See #28601.
git-svn-id: https://develop.svn.wordpress.org/trunk@29061 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-10 13:55:46 +00:00
Andrew Nacin adbe839132 WP_Comment_Query: Add fields => 'ids' query var.
props mordauk.
fixes #28434.


git-svn-id: https://develop.svn.wordpress.org/trunk@29045 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-09 18:15:42 +00:00
John Blackbourn b3e3684d21 Add support for a full path parameter to `is_page()` and `is_single()`. Props Jesper800, engelen, johnbillion. Fixes #16802.
git-svn-id: https://develop.svn.wordpress.org/trunk@29039 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-09 16:03:17 +00:00
Scott Taylor 8ce7c39e44 Allow an `array()` to be passed as the value for `orderby` to `WP_Query`. Allows for an independent `order` value for each key.
Example: `'orderby' => array( 'title' => 'DESC', 'menu_order' => 'ASC' )`.

Adds docs and unit tests.

Props wonderboymusic, johnbillion, DrewAPicture, dd32, andy.
See #17065.


git-svn-id: https://develop.svn.wordpress.org/trunk@29027 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-08 17:15:53 +00:00
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