Commit Graph

2836 Commits

Author SHA1 Message Date
Sergey Biryukov c95b962b77 Tests: Correct a "false positive" assertion in `test_media_handle_upload_ignores_page_parent_for_directory_date()`.
Props birgire.
Fixes #42736.

git-svn-id: https://develop.svn.wordpress.org/trunk@42743 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:46:44 +00:00
Sergey Biryukov 557103ede6 Tests: Avoid hardcoded domain name in `test_media_handle_upload_uses_post_parent_for_directory_date()`.
Props birgire.
See #42736.

git-svn-id: https://develop.svn.wordpress.org/trunk@42742 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:42:26 +00:00
Adam Silverstein d8a4215abb Unit Tests: add a DIR_TESTROOT constant to avoid relative paths.
Fix an issue that prevents tests from running correctly when run outside their normal context.

Props PressLabs, johnbillion.
Fixes #40071.



git-svn-id: https://develop.svn.wordpress.org/trunk@42741 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:06:49 +00:00
Adam Silverstein 74ccb68c56 Taxonomy: restore TagSearch unit tests and correct deprecated version string.
Reverts unit test removal, instead changing them to expect the function to be deprecated.
Correct the version the ajax callback was deprecated.

Amends [42614].

Props dlh, ocean90.
Fixes #38922.



git-svn-id: https://develop.svn.wordpress.org/trunk@42737 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 16:27:57 +00:00
Sergey Biryukov 3f4fe54b43 Menus: When checking if a Custom Link matches the current URL to add the `current-menu-item` class, check for decoded URL as well.
Props soulseekah, campusboy1987.
Fixes #43401.

git-svn-id: https://develop.svn.wordpress.org/trunk@42732 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-24 13:43:07 +00:00
Gary Pendergast 1e3781cd71 REST API: Show taxonomy visibility settings.
For Gutenberg and other admin-type interfaces, it's useful to be able to see the visibility settings for taxonomies.

Props joehoyle, pento.
Fixes #42707.



git-svn-id: https://develop.svn.wordpress.org/trunk@42729 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-22 00:24:00 +00:00
Aaron Jorbin 53a61339e4 Community Events Dashboard: Always show a WordCamp if one is coming up
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Fixes #41112.



git-svn-id: https://develop.svn.wordpress.org/trunk@42726 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 23:00:50 +00:00
Sergey Biryukov 9e31509293 Tests: Replace use of `$this->server` with `rest_get_server()` for better memory recycling.
Props danielbachhuber.
Fixes #41641.

git-svn-id: https://develop.svn.wordpress.org/trunk@42724 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 16:24:30 +00:00
Sergey Biryukov 0711e585fb Media: After [42693], update HTML4 markup in `img_caption_shortcode()` to avoid an empty ID attribute as well.
Add a unit test for `aria-describedby` in `img_caption_shortcode()`.

See #34595.

git-svn-id: https://develop.svn.wordpress.org/trunk@42694 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-11 15:39:20 +00:00
Helen Hou-Sandi 05b37069a4 Options: Use strings in the test suite that follow community guidelines.
Also somewhat explain to future maintainers why this pairing of strings was chosen, besides this committer's musical preferences. Social opinions on cancer are fairly clear, as are commonly accepted definitions of profanity and family-friendly language.

Shout out to the close contender, which would have been particularly appropriate here: "You could be the king // But watch the queen conquer".

see #43207, #38176


git-svn-id: https://develop.svn.wordpress.org/trunk@42667 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 22:41:48 +00:00
Aaron Jorbin 2c6f1b18f4 Options: Use most appropriate language in the test suite.
The test suite's opinion of cancer should be clear.

Reverts r42659.

See #43207, #38176




git-svn-id: https://develop.svn.wordpress.org/trunk@42663 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 20:58:21 +00:00
John Blackbourn 9b46512501 Options: Use more appropriate language in the test suite.
See #43207, #38176


git-svn-id: https://develop.svn.wordpress.org/trunk@42659 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 18:51:55 +00:00
Felix Arntz ea13c56d7f Options: Unhook default option filter when setting is unregistered.
Fixes #43207.


git-svn-id: https://develop.svn.wordpress.org/trunk@42655 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-06 14:48:46 +00:00
John Blackbourn d512973c84 Canonical: Add `$x_redirect_by` parameter to `wp_safe_redirect()`.
See [42633] and [42408].

Fixes #42313.


git-svn-id: https://develop.svn.wordpress.org/trunk@42647 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-04 16:04:10 +00:00
Drew Jaynes 311531a964 Tests: Simplify `@covers` annotations for `WP_Error` test coverage. Also fix a typo in a test method name.
See #42742.


git-svn-id: https://develop.svn.wordpress.org/trunk@42646 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-03 17:37:51 +00:00
Drew Jaynes 86d486d67d Tests: Fix two typos introduced for a get_term_field() test in [35270].
See #33968.


git-svn-id: https://develop.svn.wordpress.org/trunk@42645 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-03 17:10:51 +00:00
Sergey Biryukov 59e1b7318d Tests: Correct erroneous `@covers` and `@use` tags.
Props jipmoors.
Fixes #43203.

git-svn-id: https://develop.svn.wordpress.org/trunk@42636 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 16:08:04 +00:00
Sergey Biryukov 07bff5d8bd Tests: Improve tests for `wp_get_post_parent_id()` added in [42397].
Props frank-klein.
Fixes #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42635 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 16:02:26 +00:00
Sergey Biryukov 40f76ae917 Canonical: Add `$x_redirect_by` parameter to `wp_redirect()` that allows applications doing the redirect to identify themselves.
This complements the `x_redirect_by` filter added in [42408].

Props NathanAtmoz, johnbillion.
Fixes #42313.

git-svn-id: https://develop.svn.wordpress.org/trunk@42633 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 15:05:50 +00:00
Adam Silverstein 1c4f57f425 Remove unit tests for deprecated ajax tag search function.
Fixes unit tests failing since r42614.

Ammends [42614].
See #38922.


git-svn-id: https://develop.svn.wordpress.org/trunk@42619 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 02:28:14 +00:00
Weston Ruter bba8d65216 Widgets: Fix Text widget unit test which broke due to global scope not being cleaned.
Amends [42613].
See #42495.


git-svn-id: https://develop.svn.wordpress.org/trunk@42617 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 00:33:03 +00:00
Weston Ruter 0e818c7aee Customize: Ensure `customize_autosaved` requests only use revision of logged-in user.
Props dlh, westonruter.
See #42433, #39896.
Fixes #42450.


git-svn-id: https://develop.svn.wordpress.org/trunk@42615 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 00:20:37 +00:00
Weston Ruter 07e4b7565e Customize: Ensure media playlists get initialized after selective refresh; expose new `wp.playlist.initialize()` API.
In particular allows audio and video playlists to be added to the Text widget and previewed.

Props bpayton, westonruter.
See #40854.
Fixes #42495.


git-svn-id: https://develop.svn.wordpress.org/trunk@42613 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-29 23:55:44 +00:00
Weston Ruter b31563e561 Customize: Include nav menu item for Home custom link in search results for "Home".
Props audrasjb, westonruter.
Fixes #42991.


git-svn-id: https://develop.svn.wordpress.org/trunk@42611 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-29 22:09:55 +00:00
Aaron Jorbin 47f6031fbd Query: Improve tests for set_found_posts dealing with non arrays
Use a data provider and include tests for `false` and `''`.

Previous: [42581] [42585]

See #42860



git-svn-id: https://develop.svn.wordpress.org/trunk@42594 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 20:51:06 +00:00
Sergey Biryukov dd9122b011 Tests: Update emoji base URL in `Tests_Formatting_Emoji` after [42590].
See #42862.

git-svn-id: https://develop.svn.wordpress.org/trunk@42592 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 17:25:03 +00:00
Gary Pendergast 33a3d61b22 Tests: Improve the old date redirect tests.
Props frank-klein.
See #15397.



git-svn-id: https://develop.svn.wordpress.org/trunk@42587 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 06:38:58 +00:00
Dion Hulse f35ed94605 Tests: Skip newly added tests from [42581] on PHP 5.2 as they require ReflectionMethod.
See #42860.


git-svn-id: https://develop.svn.wordpress.org/trunk@42585 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 04:20:26 +00:00
Aaron Jorbin 818a0f1ccf Query: Fix warning on counting non countable
Adds tests to continue the behavior for both null and strings.

See https://wiki.php.net/rfc/counting_non_countables for information on the PHP change.

Fixes #42860.
Props janak007 and ayeshrajans for initial patches.





git-svn-id: https://develop.svn.wordpress.org/trunk@42581 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 01:20:24 +00:00
Peter Wilson ec8734bc2e REST API: Update the fixture data for `wp-api.js` tests following [42359].
Props danielbachhuber.
See #41014.



git-svn-id: https://develop.svn.wordpress.org/trunk@42540 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 06:33:02 +00:00
Dion Hulse 2cb36cab72 General: Allow `wp_list_pluck()` to operate on arrays of references without overwriting the referenced items.
Fixes #16895.


git-svn-id: https://develop.svn.wordpress.org/trunk@42527 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-18 05:17:23 +00:00
Dion Hulse ade2dd5dfe Tests: Remove redundant `assertEquals()` calls in listFilter tests.
As these tests are already validating that two arrays match, checking that the counts also match before is redundant and makes it harder to debug when the test fails.

See #16895


git-svn-id: https://develop.svn.wordpress.org/trunk@42526 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-18 05:14:28 +00:00
Pascal Birchler 95ec25564b Posts, Post Types: Add tests for `get_post_type_labels()`.
These were accidentally omitted in [38157].

See #38157.


git-svn-id: https://develop.svn.wordpress.org/trunk@42490 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 08:32:55 +00:00
Sergey Biryukov 70dc1d9256 Media: Add `small-audio.flac` for a unit test added in [42451].
See #42225.

git-svn-id: https://develop.svn.wordpress.org/trunk@42453 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 22:32:47 +00:00
Sergey Biryukov 02ccaeed2c Media: Add `flac` to the list of allowed file types.
Props blobfolio.
Fixes #42225.

git-svn-id: https://develop.svn.wordpress.org/trunk@42451 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 22:16:33 +00:00
Peter Wilson 2b56623d89 Formatting: Do not run formatting and texturization on author bios.
Removes the formatting and texturization added to author bios in #40040 due to back-compatibility concerns.

Reverts [41172], [41173].

Props 0x6f0, rabmalin for review.
Fixes #42578.



git-svn-id: https://develop.svn.wordpress.org/trunk@42441 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-13 01:10:56 +00:00
Andrea Fercia 1258d1d9d2 Accessibility: use `aria-current` for the paginated post links output by `wp_link_pages()`.
Continues the introduction in core of the aria-current attribute after [41683], [41359], and [41371].

- changes the `wp_link_pages()` (see the `nextpage` quicktag) output to use an `aria-current` attribute on the current item
- adds `post-nav-links` and `post-page-numbers` CSS classes to help themes style these links
- updates the related tests

Props antonioeatgoat, alexstine.
Fixes #41859.


git-svn-id: https://develop.svn.wordpress.org/trunk@42440 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-12 20:16:56 +00:00
Mike Schroder 07d244a054 Media: Skip `test_remove_orientation_data_on_rotate` if missing deps.
The `test_remove_orientation_data_on_rotate()` test was failing on systems that did not have the `exif` extension available.

Skips test when the `exif_read_data()` function does not exist.

Props danielbachhuber, desrosj.
Fixes #42447.

git-svn-id: https://develop.svn.wordpress.org/trunk@42431 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-10 01:16:56 +00:00
Gary Pendergast 9cf7385eb3 Formatting: Fix capital_P_dangit() not capital P-ing, dangit.
Unfortunately, in my overzealous desire to fix all the un-capitalised Ps, [42343] capitalled some Ps that intentionally should not be capitals.

This commit fixes the incorrectly capitalling of Ps, as well as including unit tests and PHPCS instructions to ensure we never capitulate to capitalisationing them again.

Props superdav42.
Fixes #43040.
Fixes #43041.



git-svn-id: https://develop.svn.wordpress.org/trunk@42429 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-08 10:35:13 +00:00
Rachel Baker ab58308a41 REST API: Adjust unit testes to expect a 401 status code in error responses from permission callbacks when user is not authenticated.
Missed in [42421].

Fixes #42828.

git-svn-id: https://develop.svn.wordpress.org/trunk@42423 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-01 02:30:39 +00:00
Boone Gorges 617372e21e Improve performance of `wp_list_pages()` tests.
The changeset also removes the use of hardcoded post/author IDs.

Props frank-klein.
Fixes #42903.

git-svn-id: https://develop.svn.wordpress.org/trunk@42402 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 11:15:00 +00:00
Gary Pendergast c07972d774 Canonical URLs: Redirect to the correct URL when the post date changes.
When a post slug is changed, we store a copy of the old slug, so that we can redirect visitors visiting the old URL to the new URL.

In the same way, this stores a copy of the old date, when the post date changes, so we can redirect visitors to the new URL.

Props nickmomrik.
Fixes #15397 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@42401 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 08:30:50 +00:00
Sergey Biryukov 4fbe6e0801 Docs: Add missing parameter description in `wp_get_post_parent_id()` function DocBlock.
Rename `$post_ID` to `$post` for consistency with other functions.

Add unit tests for `wp_get_post_parent_id()`.

Props keesiemeijer.
Fixes #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42397 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 01:01:01 +00:00
Dion Hulse da689558a5 Filesystem: Allow `wp_normalise_path()` to handle PHP stream wrappers such as `php://` correctly.
Props calin, dd32.
Fixes #42837.


git-svn-id: https://develop.svn.wordpress.org/trunk@42387 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-12 04:15:54 +00:00
John Blackbourn a7488c9441 Build/Test tools: Switch to PHPUnit's `expectOutputString()` method instead of manually using output buffers for output assertions.
Props birgire
Fixes #42098


git-svn-id: https://develop.svn.wordpress.org/trunk@42382 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-10 00:30:32 +00:00
John Blackbourn 07be59d34b Build/Test tools: Remove unnecessary PHP functionality tests from the test suite.
Props Frank Klein
Fixes #42277


git-svn-id: https://develop.svn.wordpress.org/trunk@42381 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-09 23:08:24 +00:00
John Blackbourn 61350144fb Role/Capability: When checking capabilities before setting a post slug, ensure the correct post type capabilities are used.
Previously, only the `publish_posts` capability was checked. Now, the correct meta or primitive capability for the post type is used where appropriate.

Props peterwilsoncc

Fixes #42464


git-svn-id: https://develop.svn.wordpress.org/trunk@42380 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-09 22:50:13 +00:00
John Blackbourn 3a7ff0e2e6 Build/Test tools: Add inline documentation to undocumented methods in the `WP_UnitTestCase` class.
Props Frank Klein

Fixes #42731


git-svn-id: https://develop.svn.wordpress.org/trunk@42379 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-08 21:00:08 +00:00
Boone Gorges 2e5bbe0667 `category_description()` should be taxonomy-agnostic.
This change reinstates the previous de facto behavior of `category_description()`.
See [40979], [42364]. Because `term_description()` no longer passes `$taxonomy` to
`get_term_field()`, the parameter is no longer needed and has been deprecated.

Fixes #42605. See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42368 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 21:48:24 +00:00
Boone Gorges ffb86c0552 `get_the_category_by_ID()` should be taxonomy-agnostic.
Prior to 4.9, this function was accidentally taxonomy-agnostic in most cases.
The fix in [40979] caused a regression in this function. For backward
compatibility, we make it explicit that the query is by ID only.

See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42367 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 21:02:10 +00:00