Commit Graph

923 Commits

Author SHA1 Message Date
Sergey Biryukov 16cc16da9e Remove `svn:executable` from test files.
git-svn-id: https://develop.svn.wordpress.org/trunk@33425 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-26 09:40:58 +00:00
Sergey Biryukov 4ed7d2d05e Update `Test_WP_Customize_Nav_Menus::test_available_items_template()` after [33413].
fixes #32715.

git-svn-id: https://develop.svn.wordpress.org/trunk@33424 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-26 09:14:06 +00:00
Gary Pendergast 2e74ecfc1c Tests: Add a new test file missed in [33359].
git-svn-id: https://develop.svn.wordpress.org/trunk@33391 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-23 05:17:19 +00:00
Weston Ruter 9e383a560a Customizer: Introduce `customize_nav_menu_available_item_types` and `customize_nav_menu_available_items` filters.
Allows for new available menu item types/objects to be registered in addition to filtering the available items that are returned for each menu item type/object.

Props valendesigns, imath, westonruter.
See #32832.
Fixes #32708.


git-svn-id: https://develop.svn.wordpress.org/trunk@33366 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 20:28:03 +00:00
Gary Pendergast 7b41adf712 Shortcodes: Improve the reliablity of shortcodes inside HTML tags.
Props miqrogroove.

See #15694.



git-svn-id: https://develop.svn.wordpress.org/trunk@33359 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 05:14:50 +00:00
Gary Pendergast 7439dd7354 Capabilities: When creating an auto-draft, ensure that the current user still has permission to do so.
git-svn-id: https://develop.svn.wordpress.org/trunk@33357 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 04:01:53 +00:00
Konstantin Obenland 358ab7b010 Tests: Remove test for `delete_site_icon()`.
Removed in [33329].
H/t wonderboymusic.

See #16434.


git-svn-id: https://develop.svn.wordpress.org/trunk@33335 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-20 20:52:39 +00:00
Weston Ruter 5c76979fb8 Customizer: Finish unit tests for nav menus.
Removes object_type restriction to allow for future extensibility. Refactors some methods to improve testability. Includes new tests for Ajax requests.

Fixes #32687.
Props valendesigns, welcher, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@33322 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-18 23:19:33 +00:00
Gary Pendergast 7217a4f6e5 WPDB: `::strip_text_from_query()` doesn't pass a length to `::strip_invalid_text()`, which was causing queries to fail when they contained characters that needed to be sanity checked by MySQL.
Props dd32, mdawaffe, pento.

Fixes #32279.



git-svn-id: https://develop.svn.wordpress.org/trunk@33310 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-17 07:06:33 +00:00
Gary Pendergast bea2bf1502 WPDB: Remove some of the complexities in `::strip_invalid_text()` associated with switching character sets between queries. Instead of trying to dynamically change connection character sets, we now rely on the value of `::charset`. This also fixes the case where queries were being blocked when `DB_CHARSET` was `utf8`, but the column character set was non-`utf8`.
Fixes #32165.



git-svn-id: https://develop.svn.wordpress.org/trunk@33308 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-17 06:33:36 +00:00
Scott Taylor 3d1f8f292a After [33148]:
Don't nest `esc_attr()` and `htmlspecialchars()` when escaping the post title on the edit post screen.

Unrevert parts of [32851] and [32850].

Adds/alters unit tests.

Props miqrogroove.
Fixes #17780.


git-svn-id: https://develop.svn.wordpress.org/trunk@33271 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 17:55:07 +00:00
Boone Gorges ce4b40d794 In `wp_unique_post_slug()`, only prevent date archive conflicts when the slug is being changed.
This prevents existing posts with numeric slugs from having their permalinks
changed on update.

Fixes #5305.

git-svn-id: https://develop.svn.wordpress.org/trunk@33262 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 12:27:11 +00:00
Boone Gorges c718849baa When creating a new post with an empty `post_name` and `post_title`, don't generate a `post_name` that conflicts with a date archive permalink.
See #5305.

git-svn-id: https://develop.svn.wordpress.org/trunk@33261 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 12:27:03 +00:00
Gary Pendergast 7711b72639 WPDB: When extracting the table name from a query, we had a 1000 character limit on the SQL string that would be searched. This was a hangover from when the code was imported from HyperDB, and isn't appropriate for Core, where a wider range of queries are likely to be run.
Fixes #32763



git-svn-id: https://develop.svn.wordpress.org/trunk@33259 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 10:18:57 +00:00
Jeremy Felt 33be338e9f Tests: Use a data provider when testing site flags in `update_blog_details()`.
See #32988.


git-svn-id: https://develop.svn.wordpress.org/trunk@33255 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 06:38:19 +00:00
Jeremy Felt 76ef07903d Tests: Use a data provider when testing path slashing in `update_blog_details()`.
Trims down 11 tests to 1 clean area of testing and makes for a much saner read.

See #32988.


git-svn-id: https://develop.svn.wordpress.org/trunk@33254 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 05:51:05 +00:00
Jeremy Felt e3e828c608 Tests: Move `update_blog_details()` tests to their own file.
Reduce some of the clutter in `tests/multisite/site.php` and introduce `tests/multisite/updateBlogDetails.php`. Tests moved over are verbatum at this point.

See #32988.


git-svn-id: https://develop.svn.wordpress.org/trunk@33253 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 05:49:28 +00:00
Boone Gorges 04237900a6 Require dependencies when appropriate in some unit test files.
Previously, attempting to run certain test files in isolation would resultin
fatal errors, as the parent classes had not been loaded.

Props isaacchapman.
Fixes #32984.

git-svn-id: https://develop.svn.wordpress.org/trunk@33250 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-14 03:07:13 +00:00
Konstantin Obenland 804a008eb1 Site Icon: Add Android-specific app icon.
Falling back to Apple app icons is deprecated behavior and will not work
forever. 192px is the recommended size for that icon.

Props kraftbj.
Fixes #32964.



git-svn-id: https://develop.svn.wordpress.org/trunk@33202 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 17:57:19 +00:00
Jeremy Felt 77300bcc92 Tests: Check downsized images against dynamic rather than static filename when original is expected.
See #32971.


git-svn-id: https://develop.svn.wordpress.org/trunk@33188 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 03:33:38 +00:00
Jeremy Felt e223663d3d Add explicit testing for `pre_get_space_used()` filter.
See #30202.


git-svn-id: https://develop.svn.wordpress.org/trunk@33185 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 00:13:25 +00:00
Jeremy Felt 6df1337645 Exclude individual site directories when calculating space used for the main site.
* Add an `$exclude` parameter to `recurse_dirsize()`.
* Use this parameter in `get_dirsize()` to exclude `/sites` when on the main site.
* Add tests for main site and switched site.

Props @earnjam, @jeremyfelt.
Fixes #30202.


git-svn-id: https://develop.svn.wordpress.org/trunk@33184 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 00:06:39 +00:00
Aaron Jorbin b43acd115c Add Unit Tests for get_objects_in_term()
Props rodrigosprimo.
Fixes #32946.



git-svn-id: https://develop.svn.wordpress.org/trunk@33182 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-12 20:12:19 +00:00
Konstantin Obenland a9ca47a7be Site Icon: Unit tests for `WP_Site_Icon` and its API.
Props obenland, jorbin.
See #16434.



git-svn-id: https://develop.svn.wordpress.org/trunk@33181 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-12 20:06:10 +00:00
Aaron Jorbin c6e3b84c48 Add dbDelta insert test
Test to make sure that dbDelta properly inserts a value into the DB.

Props tryon, jtsternberg, ebinnion, JPry, avnarun, kevkoeh, salcode.
Fixes #29020.



git-svn-id: https://develop.svn.wordpress.org/trunk@33175 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-12 17:28:15 +00:00
Scott Taylor a9874b9416 Revert [32851] and [32850] for now, tl;dr encoding issues.
See #17780.



git-svn-id: https://develop.svn.wordpress.org/trunk@33148 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-09 20:55:26 +00:00
Jeremy Felt bb7f147703 Do not allow deletion of a super admin user through `wpmu_delete_user()`.
In step with the UI provided by `wp-admin/network/users.php`, super admin privileges must be removed before a user can be deleted through the API.

Props @johnjamesjacoby, @jeremyfelt.
Fixes #32935.


git-svn-id: https://develop.svn.wordpress.org/trunk@33143 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-09 16:15:30 +00:00
Weston Ruter 2a8973f117 Customizer: Remove additional wrapper element around `wp_nav_menu()` which broke some theme designs.
Also includes these related changes:
* Export `oldContainer` and `newContainer` among the `customize-preview-menu-refreshed` event params for themes to be able to more easily re-initialize the DOM elements.
* Improve performance for partial refresh by only sending settings related to the menu being previewed.
* Fix previewing of menu assigned to Custom Menu by exporting a menu `term_id` as opposed to an object, as the former is more stable for comparing in in args hashes.
* Do full refresh of preview when nav menu unassigned so that the layout can be updated.
* Harden conditions for when partial refresh is eligible for a `wp_nav_menu()` instance.

Fixes #32841.


git-svn-id: https://develop.svn.wordpress.org/trunk@33138 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 21:29:53 +00:00
Weston Ruter 3c0e4d3860 Customizer: Prevent loss of `walker` and `fallback_cb` args for `wp_nav_menu`.
These args only need to be cleared out when exported to JavaScript, when they are not JSON-serializable. So the filter now clears these when gathering args for exporting to JS, but otherwise now leaves the original values to be passed through to `wp_nav_menu()`.

Fixes #32781.


git-svn-id: https://develop.svn.wordpress.org/trunk@33131 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 20:17:52 +00:00
John Blackbourn 389fb33d76 Skip the `Tests_Option_Transient::test_nonexistent_key_old_timeout()` tests on multisite for now.
See #31130
Fixes #30380


git-svn-id: https://develop.svn.wordpress.org/trunk@33125 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 18:23:46 +00:00
ocean90 94e3540dcc Update PHPMailer to 5.2.10 from 5.2.7.
Includes two modifications for WordPress:
* Removes support for NTLM in `class-smtp.php` since the required client (`extras/ntlm_sasl_client.php`) is not distributed as part of WordPress.
* Requires `class-smtp.php` for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used. See [27385].

This also includes a change to our `MockMailer` for unit tests. It now overrides `postSend() instead of `send()`, and `preSend()`.
`preSend()` resets `$this->Encoding` because PHPMailer doesn't clean up after itself / presets all variables. This becomes an issue when `PHPMailer::createBody()` sets `$this->Encoding = 'quoted-printable'` (away from it's default of 8bit) when it encounters a line longer than 998 characters. `Tests_Comment::test_comment_field_lengths` is such a case.

props MattyRob, dd32.
fixes #28909.

git-svn-id: https://develop.svn.wordpress.org/trunk@33124 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 17:15:02 +00:00
Aaron Jorbin 08d5df5f44 Remove PHP4 constructors from Unit Tests
If you are subclassing these classes in your own tests, you'll need to update your code.

Props johnbillion
See #31982



git-svn-id: https://develop.svn.wordpress.org/trunk@33123 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 16:04:11 +00:00
John Blackbourn 0888ce55b1 Introduce unit tests for `sanitize_option()`.
Props MikeHansenMe, welcher, johnbillion
See #32351


git-svn-id: https://develop.svn.wordpress.org/trunk@33119 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 00:05:17 +00:00
John Blackbourn 063637755b Allow shortcode parameter names (attributes) to contain dashes.
Props aaroncampbell, tyxla, izem
Fixes #9405


git-svn-id: https://develop.svn.wordpress.org/trunk@33118 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-07 23:58:49 +00:00
Scott Taylor 138d68a58a In `wp_insert_user()`, comparing an email address against the user's old email address should not be case-sensitive.
Adds unit tests.

Props tyxla.
Fixes #32158.


git-svn-id: https://develop.svn.wordpress.org/trunk@33115 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-07 19:28:46 +00:00
Dominik Schilling (ocean90) daa477e3b8 Transients: If `get_option( $transient_timeout )` returns false, don't bother trying to delete the transient in `get_transient()`.
props jamesgol, ericmann.
fixes #30380.

git-svn-id: https://develop.svn.wordpress.org/trunk@33110 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-07 16:44:08 +00:00
Boone Gorges 8e6997b652 Use `assertEqualSets()` in `WP_Query::parse_tax_query()` tests.
Props ocean90.
See #32454.

git-svn-id: https://develop.svn.wordpress.org/trunk@33102 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-07 00:57:04 +00:00
Konstantin Obenland 2cafc0d787 Check for all required caps before (un)sticking a post.
In cases where a user has the `edit_others_posts` capability but not
`publish_posts`, it was possible for that user to unstick a post after editing,
since the input field was never made available in that context.

Props ericmann, chriscct7.
Fixes #24153.



git-svn-id: https://develop.svn.wordpress.org/trunk@33096 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-06 22:40:59 +00:00
Boone Gorges 53021ef6fe In `WP_Query::parse_tax_query()`, allow taxonomy querystring to be formatted as an array.
Props Veraxus.
Fixes #32454.

git-svn-id: https://develop.svn.wordpress.org/trunk@33095 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-06 20:36:18 +00:00
Weston Ruter 1b02636793 Customizer: Ensure that a newly-added nav menu item gets the Original link populated in its control.
Props valendesigns.
Fixes #32858.



git-svn-id: https://develop.svn.wordpress.org/trunk@33089 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-06 05:52:59 +00:00
Jeremy Felt 14f39faab1 Usernames in multisite should be restricted to 60 characters or fewer.
Only 60 characters can be stored in the database for a username, which could cause lookup issues when attempting to use similar usernames of extreme length.

Props @DJPaul.
See #17904, Fixes #26784.


git-svn-id: https://develop.svn.wordpress.org/trunk@33083 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-04 05:52:46 +00:00
Weston Ruter a21c6e76d6 Customizer: Fix saving menus with empty names or names that are already used.
Adds validation for initially-supplied nav menu name, blocking empty names from being supplied. If later an empty name is supplied and the nav menu is saved, the name "(unnamed)" will be supplied instead and supplied back to the client. If a name is supplied for the menu which is currently used by another menu, then the name conflict is resolved by adding a numerical counter similar to how `post_name` conflicts are resolved. Includes unit tests.

Fixes #32760.



git-svn-id: https://develop.svn.wordpress.org/trunk@33071 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-03 20:46:48 +00:00
Aaron Jorbin a547d6fed1 Don't strip newline in esc_url() when protocol is mailto:
The mailto protocol is a bit different than the other protocols in that new lines are something you might realistically want to include. Includes tests to make sure that http protocol urls that contain mailto: aren't affected. Tests for stripping newlines in general already exist.

Fixes #31632
Props danielbachhuber



git-svn-id: https://develop.svn.wordpress.org/trunk@33064 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-03 14:27:11 +00:00
Sergey Biryukov 8a8fc13bd0 Update `test_filter_wp_nav_menu_args()` after [33035].
see #32781.

git-svn-id: https://develop.svn.wordpress.org/trunk@33043 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-02 01:17:58 +00:00
Konstantin Obenland efdce1da51 Turn of comments for pages by default.
Pages are static content, for which comments are not expected out of the box.

Props valendesigns, rachelbaker.
Fixes #31168.



git-svn-id: https://develop.svn.wordpress.org/trunk@33041 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-02 00:21:28 +00:00
Dominik Schilling (ocean90) caab22e5b2 l10n: Update `wp_get_installed_translations()` to support variants of a language.
* A variant of a language has its own locale, for example the locale of the formal variant of German is `de_DE_formal`.
* Update `remove_accents()` and some CSS rules to support `de_DE_formal`.
* Add tests for `get_bloginfo( 'language' )`.
* API changes will be deployed over the next few days.

see #28303.

git-svn-id: https://develop.svn.wordpress.org/trunk@33027 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 15:42:32 +00:00
Boone Gorges f7b8ff5a2e Don't allow `$field` param to be passed to `get_term_link()`.
The new parameter creates inconsistencies in the signatures of the various
functions for fetching term links (`get_term_feed_link()`,
`get_edit_term_link()`, etc.).

Reverts [32553].

See #14156.

git-svn-id: https://develop.svn.wordpress.org/trunk@33022 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 12:53:05 +00:00
Boone Gorges e8a16ec322 Allow 'comment_agent' and 'comment_author_IP' to be set via `wp_new_comment()`.
Props mrutz, wonderboymusic, rachelbaker.
Fixes #14601.

git-svn-id: https://develop.svn.wordpress.org/trunk@33021 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 12:07:28 +00:00
Dion Hulse 5b58664439 Expire password reset links after 24 hours (by default). This causes existing password reset links to become invalid.
Props markjaquith, voldemortensen, johnbillion, MikeHansenMe, dd32
See #32429


git-svn-id: https://develop.svn.wordpress.org/trunk@33019 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 06:32:07 +00:00
Boone Gorges 3a982b1590 Fix `Tests_Post_GetPostClass::test_taxonomy_classes_hit_cache()` after [32994].
[32994] results in an additional database query during automated testing, so
the query count being compared in this specific test must be incremented
manually.

See #16434.

git-svn-id: https://develop.svn.wordpress.org/trunk@32997 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-29 14:31:52 +00:00