Commit Graph

1613 Commits

Author SHA1 Message Date
Konstantin Obenland
6d951b3c5d Customize: Only add custom logo’s header text control if needed.
Dissolves `WP_CustomLogo` and adopts a structure similar to custom header and background (See `_delete_attachment_theme_mod()`).
The option to hide header text only gets added if it’s not already part of custom header, and only if selectors have been registered when theme support for custom logos was declared. Themes can add `postMessage` support for it as well.

Example:
{{{
add_theme_support( 'custom-logo', array(
    'size' => ‘large’,
    'header-text' => array( 'site-title', 'site-description' ),
) );
}}}

See #33755.


git-svn-id: https://develop.svn.wordpress.org/trunk@36915 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 23:43:49 +00:00
Konstantin Obenland
4286a3e63b Tests: Let's not reinvent wp_get_attachment_image().
See https://travis-ci.org/aaronjorbin/develop.wordpress/builds/114913862
See #36086.


git-svn-id: https://develop.svn.wordpress.org/trunk@36914 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 23:27:28 +00:00
Konstantin Obenland
bf852575e2 Tests: Account for expected attachemnt size in custom logo output.
Fixes #36086.


git-svn-id: https://develop.svn.wordpress.org/trunk@36911 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 21:56:57 +00:00
Aaron Jorbin
6adbde9340 Add Automated Tests for custom logo support
[36698] introduced custom logos, this tests the API. 

Fixes #36086. See #33755.
Props obenland.



git-svn-id: https://develop.svn.wordpress.org/trunk@36905 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 20:43:28 +00:00
Weston Ruter
dcbbeffc57 Customize: Fix regressions and harden implementation of selective refresh for nav menus.
* Request full refresh if there are nav menu instances that lack partials for a changed setting.
* Restore `WP_Customize_Nav_Menus::$preview_nav_menu_instance_args` and `WP_Customize_Nav_Menus::export_preview_data()` from 4.3, and keeping a tally of all `wp_nav_menu()` calls regardless of whether they can use selective refresh.
* Ensure that all instances of `wp_nav_menu()` are tallied, regardless of whether they are made during the initial preview call or during subsequent partial renderings. Export `nav_menu_instance_args` with each partial rendering response just as they are returned when rendering the preview as a whole.
* Fix issues with Custom Menu widget where nav menu items would fail to render when switching between menus when a menu lacked items to begin with.
* Make sure the fallback behavior is invoked when the partial is no longer associated with a menu.
* Do fallback behavior to refresh preview when all menu items are removed from a menu.

Follows [36586].
See #27355.
Fixes #35362.


git-svn-id: https://develop.svn.wordpress.org/trunk@36889 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 00:08:51 +00:00
Drew Jaynes
f07f2252fe Menus: Avoid a notice when outputting a description for an existing archive menu item for a post type that doesn't.
Props bradyvercher.
See [36859]. Fixes #35324.


git-svn-id: https://develop.svn.wordpress.org/trunk@36888 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 18:24:50 +00:00
Dominik Schilling (ocean90)
5064747619 Tests: Remove test_new_files_are_not_in_old_files_array() from [36843].
The test assumes that if a CSS file was added to `$_old_files` all three files (.css, .min.css, -rtl.min.css; it's actually missing the fourth case, -rtl.css) don't exist anymore. But this isn't always the case. The test is also incredible slow because it does three `file_exists()` checks for each file — the global contains 646 files currently.

It's important what we have in the /build directory and that's covered by `test_new_files_are_not_in_old_files_array_compiled()`.

Fixes #36083.

git-svn-id: https://develop.svn.wordpress.org/trunk@36885 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 16:44:25 +00:00
Dion Hulse
11082eea97 Tests: Remove debug from [36882].
git-svn-id: https://develop.svn.wordpress.org/trunk@36883 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 07:07:56 +00:00
Dion Hulse
adcb0b5a4a Tests: Merge the two different wp_normalize_path() tests.
See #35996, [36881].


git-svn-id: https://develop.svn.wordpress.org/trunk@36882 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 07:06:12 +00:00
Dion Hulse
8d9b0a9d22 Filesystem: Support Windows shares/DFS roots in wp_normalize_path().
Props rilwis for initial patch.
Fixes #35996.


git-svn-id: https://develop.svn.wordpress.org/trunk@36881 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 05:59:45 +00:00
Pascal Birchler
3a51ff4d2e Taxonomy: Improve backward compatibility on the wp-admin/term.php page.
Specifically, run `do_action( 'edit-tags.php' );` on this new term edit page introduced in [36308]. Changes the GET param back to `tag_ID` and properly sets the screen base in `WP_Screen`.

See #34988.

git-svn-id: https://develop.svn.wordpress.org/trunk@36874 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-07 12:55:04 +00:00
Pascal Birchler
afdf1c9ec1 Embeds: Adjust the iframe title attribute for improved accessibility.
Changes the title attribute from `Embedded WordPress Post` to `"Post name" — site title`.

Props ramiy.
Fixes #35804.

git-svn-id: https://develop.svn.wordpress.org/trunk@36873 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-07 09:59:02 +00:00
Dominik Schilling (ocean90)
00e87b40c8 Dependencies: Improve group processing of script dependencies.
This is a follow-up to [36604].

When processing dependencies `$this->group` will be the minimum of the script's registered group and all preceding siblings. This is wrong because only a scripts ancestors in the dependency chain should affect where it is loaded. Effectively `$this->group` introduced a form of global state which potentially corrupted the group of dependencies. Sorting covers up this problem.
The issue in #35873 was that script were not moving their dependencies to a lower group when necessary.

The fix:
* In `WP_Dependencies::all_deps()` pass the new `$group` value to `WP_Dependencies::all_deps()`. Previously the wrong value was passed because the parent script could have moved with `WP_Scripts::set_group()`.
* In `WP_Scripts::all_deps()` pass the `$group` parameter to `WP_Dependencies::all_deps()` so it doesn't always use `false` for `$group`. Same for `WP_Styles::all_deps()`.

Props stephenharris, gitlost.
Fixes #35956.

git-svn-id: https://develop.svn.wordpress.org/trunk@36871 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-06 19:49:54 +00:00
Aaron Jorbin
4af0645ae8 Ensure Description is respected in post type archive menu items.
Tested scenarios include: using the default (which is the post type description), Setting a custom description for that individual menu item, and setting a custom description that is blank. Introduced in r35382.

Props Toro_Unit, mayukojpn, extendwings, jorbin.
Fixes #35324. See #16075.



git-svn-id: https://develop.svn.wordpress.org/trunk@36859 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-05 22:56:31 +00:00
Aaron Jorbin
57d8c6668a Fix License test
Broken in r36855

Fixes #35278



git-svn-id: https://develop.svn.wordpress.org/trunk@36856 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-05 20:21:23 +00:00
ericlewis
59c8ba7871 Build/Test Tools: Document PHP unit test classes.
Props boonebgorges.
Fixes #35494.


git-svn-id: https://develop.svn.wordpress.org/trunk@36854 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-05 19:47:41 +00:00
John Blackbourn
48959ec76e Posts, Post Types: Ensure that non-ASCII characters in attachment slugs aren't shown in urlencoded form in the sample permalink UI.
Fixes #35980


git-svn-id: https://develop.svn.wordpress.org/trunk@36853 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-05 03:55:33 +00:00
Sergey Biryukov
fb7ada9e9a Comment out some CSS files in $_old_files that were added back as a result of [36341].
Add a unit test to make sure the `$_old_files` array does not contain any current project files.

Props joemcgill, swissspidy.
Fixes #36083.

git-svn-id: https://develop.svn.wordpress.org/trunk@36843 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-04 07:55:21 +00:00
Sergey Biryukov
95f12701fb Date/Time: Add a unit test for mysql_to_rfc3339().
Props borgesbruno.
Fixes #36054.

git-svn-id: https://develop.svn.wordpress.org/trunk@36832 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 13:16:31 +00:00
Joe Hoyle
fc0ed5e1ca REST API: Unit test for OPTIONS request should call rest_send_allow_header
In [36829] we moved this logic to rest_send_allow_header()

See #36829.


git-svn-id: https://develop.svn.wordpress.org/trunk@36831 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 11:37:48 +00:00
Joe Hoyle
b38ea44e9a OPTIONS requests to REST API should return Allow header.
An OPTIONS request was incorrectly returning an "Accept" header which
was a typo of "Allow". This meant Accept was showing "GET, POST" for example,
however it was also not running the permission checks on the endpoints.

Instead, the correct route needs to be set on the request object, which means
the normal handling for the Allow header will kick in. This technically
breaks backwards compatibility, however given the value of Accept was also wrong
then this should not be an issue.

Fixes #35975.


git-svn-id: https://develop.svn.wordpress.org/trunk@36829 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 09:54:32 +00:00
John Blackbourn
dfb666f7cf Uploads: Add tests for device upload capabilities based on user agent.
Fixes #35976
Props borgesbruno


git-svn-id: https://develop.svn.wordpress.org/trunk@36810 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 02:00:06 +00:00
Weston Ruter
0c3716670a Customize: Define params on WP_Customize_Partial::render_callback() for the sake of subclasses overriding this method.
Fixes a strict standards notice regarding the method signature needing to be compatible.

See #27355.


git-svn-id: https://develop.svn.wordpress.org/trunk@36801 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-02 06:08:38 +00:00
Pascal Birchler
4bad4cd246 Tests: Add unit tests for number_format_i18n().
Props pbearne for initial patch.
Fixes #36029.

git-svn-id: https://develop.svn.wordpress.org/trunk@36795 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-01 21:19:20 +00:00
Boone Gorges
c67a463427 Use markTestSkipped() to skip a multisite-only test.
See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36791 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:55:56 +00:00
Boone Gorges
26a8cbdb44 Ensure that user __unset() tests make assertions.
See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36790 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:49:15 +00:00
Boone Gorges
1fb24d9e8d Remove erroneous return in date_query test.
Introduced in [34989].

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36789 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:40:20 +00:00
Boone Gorges
2b19ef7b76 mbstring.func_overload test should be skipped properly.
This avoids PHPUnit notices related to "risky" tests.

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36788 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:37:42 +00:00
Boone Gorges
7e55710025 Remove tests related to wp_*_post_meta() functions.
These tests functions were introduced as part of the attempt to straighten out
metadata slashing. See [23416]. The functions were later pulled out [23554],
but the tests were not removed at the same time. Since that point, they've
done nothing, so they can safely be removed.

See #21767. See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36787 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:13:28 +00:00
Boone Gorges
0a1e0cd7d6 Tests: Make sure that test_wp_mail_break_it() makes an assertion.
Let's make what is possibly the oddest test in WordPress even a bit odder.

See https://core.trac.wordpress.org/ticket/28909#comment:47 for backstory on
the test.

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36786 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 22:04:32 +00:00
Boone Gorges
7505593ab8 Tests: setExpectedDeprecated and setExpectedIncorrectUsage tests should make assertions.
Introduced in [31306].

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36785 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 21:55:41 +00:00
Boone Gorges
603fee5749 More specific test for a bad callback in WP_Customize_Partial test.
The 'render_callback' passed to `WP_Customize_Partial` must either echo or
return a result - not both. When it's detected that the callback echoes and
returns a value, the return value takes precedence. This is now reflected in
the corresponding unit test.

Introduced in [36586].

See #27355. See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36784 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 21:53:18 +00:00
Boone Gorges
8b7fdc982f Remove test related to deprecated Customizer export_preview_data() method.
The method was gutted and deprecated in [36586], so there's no reason to keep
the test.

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36782 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 21:07:00 +00:00
Boone Gorges
070b8a6154 Put an assertion in test_nonexistent_array() test.
The point of the test is to demonstrate that PHP doesn't throw a notice when
calling `unset()` on an undefined array key. To placate PHPUnit's useless test
detection, we add a redundant assertion.

Introduced in [25240].

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36779 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 20:34:48 +00:00
Boone Gorges
60b307b941 Make sure an assertion takes place in 'visited' test for get_category_parents().
See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36778 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 20:30:04 +00:00
Sergey Biryukov
13e409ac15 Formatting: In sanitize_title_with_dashes(), convert &nbsp, &ndash, and &mdash HTML entities to hyphens on save.
Props polevaultweb for initial patch.
Fixes #31790.

git-svn-id: https://develop.svn.wordpress.org/trunk@36775 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 04:41:03 +00:00
Drew Jaynes
92dbe29078 Posts: Add tests for the cascading fallback behavior of several 'public'-related arguments in register_post_type().
Covers the 'exclude_from_search', 'publicly_queryable', 'show_ui', 'show_in_menu', 'show_in_nav_menus', and 'show_in_admin_bar' arguments, all of which eventually inherit from 'public' if not set.

Fixes #35985.


git-svn-id: https://develop.svn.wordpress.org/trunk@36768 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-28 22:58:45 +00:00
Sergey Biryukov
4f91aae382 L10n: Add unit tests for _n_noop() and _nx_noop().
Props realloc.
Fixes #35961.

git-svn-id: https://develop.svn.wordpress.org/trunk@36766 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-28 20:48:58 +00:00
Sergey Biryukov
a18e7ae7c3 Ad a unit test for bool_from_yn().
Props borgesbruno.
Fixes #35972.

git-svn-id: https://develop.svn.wordpress.org/trunk@36764 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-28 19:55:48 +00:00
John Blackbourn
54adcce28d Rewrite Rules: Ensure url_to_postid() operates as expected when it's used in the context of another site within a Multisite network that uses mixed URL schemes.
Fixes #35531


git-svn-id: https://develop.svn.wordpress.org/trunk@36750 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-28 02:12:13 +00:00
John Blackbourn
717c1c4041 HTTP API: Add the missing 1xx HTTP response codes as constants of the WP_Http class, and add tests to ensure all available response codes are covered.
Fixes #36294


git-svn-id: https://develop.svn.wordpress.org/trunk@36749 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-28 01:45:24 +00:00
Boone Gorges
3d8cade8c8 Tests: Don't modify global state before checking whether to skip get_locale() tests.
Introduced in [36740].

Props ocean90.
See #35965.

git-svn-id: https://develop.svn.wordpress.org/trunk@36741 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 20:28:07 +00:00
Boone Gorges
da128bc5e3 Add tests for get_locale().
Props realloc.
Fixes #35965.

git-svn-id: https://develop.svn.wordpress.org/trunk@36740 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 20:21:11 +00:00
John Blackbourn
48aa555ced Refactor some janky URL tests into data providers for clarity and better error reporting.
See #35954


git-svn-id: https://develop.svn.wordpress.org/trunk@36722 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 02:10:32 +00:00
John Blackbourn
1ebe4658f1 Remove (or at least reduce) the need to reset common $_SERVER variables before assertions or between tests, by introducing a method which automatically resets them during test setup.
See #35954


git-svn-id: https://develop.svn.wordpress.org/trunk@36721 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 02:08:47 +00:00
Sergey Biryukov
918da6f8c2 L10n: Add test for get_available_languages().
Props realloc.
Fixes #35950.

git-svn-id: https://develop.svn.wordpress.org/trunk@36718 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 00:38:25 +00:00
John Blackbourn
701f639e30 Correct some more tests which were using example.org instead of WP_TESTS_DOMAIN.
See #34000


git-svn-id: https://develop.svn.wordpress.org/trunk@36717 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-26 00:25:10 +00:00
John Blackbourn
6cf0caf13e Unify the initialisation of $_SERVER variables during test bootstrap. This abstracts the (re-)initialisation into a function that can be used inside of tests too, before assertions are performed.
See #35954


git-svn-id: https://develop.svn.wordpress.org/trunk@36715 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-25 21:59:56 +00:00
John Blackbourn
fd03f6ec19 Canonical: Improve the method names and inline docs for canonical redirect tests.
git-svn-id: https://develop.svn.wordpress.org/trunk@36714 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-25 21:55:57 +00:00
John Blackbourn
fd8e31e3b2 Move some assertions in HTTPS related tests, so failures that occur before the environment reset don't result in a contaminated test environment.
See #35954


git-svn-id: https://develop.svn.wordpress.org/trunk@36711 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-25 21:17:34 +00:00