wordpress-develop/tests/phpunit/tests
Boone Gorges c1b8f1f72a In Walker_CategoryDropdown::start_el(), cast values to strings before deciding whether to append 'selected' attribute.
As of [32484], `wp_dropdown_categories()` uses the `$value_field` value to
decide whether a given `<option>` should be 'selected'. However, `$value_field`
can refer to a value that is a string, such as a category's slug. This causes
problems when doing a loose comparison (`==`) with the value of the `'selected'`
parameter, which defaults to `0`, because when doing a loose comparison
between an integer and a string, PHP will cast the string to an integer. This
creates false matches, resulting in `<option>` elements getting a 'selected'
attribute incorrectly.

We address the issue by casting the comparison values to strings, and then
using the strict comparison operator `===`.

Fixes #33452 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@33681 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-21 01:10:34 +00:00
..
actions Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
admin Disallow post slugs that will result in permalinks that conflict with date archive URLs. 2015-05-29 12:52:17 +00:00
ajax Capabilities: Fall back to the edit_posts capability for orphaned comments. 2015-08-13 22:30:26 +00:00
attachment Fix typo in a comment in slashing tests. 2015-01-07 07:08:47 +00:00
canonical In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
category In wp_list_categories(), 'All' link should point to post type archive if taxonomy is not registered for 'post' or 'page'. 2015-04-24 14:56:37 +00:00
comment In WP_Comment_Query, parse meta_query vars after the pre_get_comments hook. 2015-06-23 14:35:29 +00:00
customize Customizer: Fix failing tests on PHP 5.2 after [33488]. 2015-07-31 13:01:16 +00:00
date WP_Date_Query date validation should not fail for hour = 0. 2015-01-20 19:12:48 +00:00
db Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
dependencies Add a return value to wp_register_script() and wp_register_style() which matches the return value of WP_Dependencies::add(). 2015-05-10 19:56:15 +00:00
feed Use shared fixtures in RSS2 unit tests. 2015-03-20 12:34:28 +00:00
filesystem Require dependencies when appropriate in some unit test files. 2015-07-14 03:07:13 +00:00
formatting Fix creating of extra <br /> tags in both PHP and JS variants of wpautop(). Add PHP tests to catch similar problems in the future. 2015-08-17 17:35:58 +00:00
functions Ignore case when checking string 'false' in wp_validate_boolean(). 2014-11-03 15:54:42 +00:00
general In paginate_links(), improve handling of custom pagination query vars. 2015-05-05 21:58:23 +00:00
http WP_HTTP: ensure that the temporary file is created within the temporary directly when stream is specified without a filename parameter. 2015-06-09 03:54:49 +00:00
image Tests: Remove test for delete_site_icon(). 2015-07-20 20:52:39 +00:00
import Require dependencies when appropriate in some unit test files. 2015-07-14 03:07:13 +00:00
includes Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
link In get_next_comments_link(), ensure proper pagination when no 'cpage' query var is found. 2015-03-05 03:56:21 +00:00
meta Avoid returning duplicate matches when using a meta query in WP_User_Query. 2015-06-09 17:41:35 +00:00
multisite Tests: Use a data provider when testing site flags in update_blog_details(). 2015-07-14 06:38:19 +00:00
option Skip the Tests_Option_Transient::test_nonexistent_key_old_timeout() tests on multisite for now. 2015-07-08 18:23:46 +00:00
pomo Fix strict notices in Tests_POMO_PO. 2013-12-01 12:47:35 +00:00
post Introduce post_name__in parameter for WP_Query. 2015-08-20 02:18:05 +00:00
query Require dependencies when appropriate in some unit test files. 2015-07-14 03:07:13 +00:00
rewrite When parsing what appears to be a date archive request, check for a post with a clashing permalink before resolving to the archive. 2015-05-29 13:09:26 +00:00
template Tests: Update Site Icon tests to account for changes in [33605]. 2015-08-11 18:41:01 +00:00
term wp_update_term() should return a true integer for 'term_taxonomy_id'. 2015-08-19 19:32:04 +00:00
theme Clean up 'post-thumbnail' theme support unit tests. 2014-11-01 04:00:59 +00:00
user Capabilities: When creating an auto-draft, ensure that the current user still has permission to do so. 2015-07-22 04:01:53 +00:00
xmlrpc After [33325], supply a missing post_type in ->mw_editPost(). 2015-08-13 15:27:57 +00:00
actions.php Introduce doing_filter() and doing_action() to identify hooks in progress. 2014-02-26 18:43:59 +00:00
adminbar.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
auth.php Expire password reset links after 24 hours (by default). This causes existing password reset links to become invalid. 2015-07-01 06:32:07 +00:00
avatar.php Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
basic.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
cache.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
canonical.php Implement canonical and url_to_postid() tests for child pages which share a post name with other child pages. 2015-06-24 00:40:45 +00:00
category.php In Walker_CategoryDropdown::start_el(), cast values to strings before deciding whether to append 'selected' attribute. 2015-08-21 01:10:34 +00:00
comment.php Allow 'comment_agent' and 'comment_author_IP' to be set via wp_new_comment(). 2015-07-01 12:07:28 +00:00
compat.php WPDB: When checking that a string can be sent to MySQL, we shouldn't use mb_convert_encoding(), as it behaves differently to MySQL's character encoding conversion. 2015-05-06 02:59:50 +00:00
cron.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
db.php 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. 2015-07-14 10:18:57 +00:00
dbdelta.php Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
dependencies.php Remove tests for code still in development, see #22229. If accidentally run, they produce fatal errors. 2013-10-07 14:17:13 +00:00
file.php Tests: Clean up the resulting /tmp/foo* files from the tempnam call. 2015-03-31 02:10:52 +00:00
filters.php In remove_all_filters(), only remove callbacks that match the $priority parameter. 2014-12-31 19:06:29 +00:00
functions.php Add unit test asserting that serializable objects will never pass is_serialized(). see #17375. 2015-05-28 05:22:14 +00:00
kses.php Shortcodes: Improve the reliablity of shortcodes inside HTML tags. 2015-07-22 05:14:50 +00:00
l10n.php Remove failing is_textdomain_loaded() test. 2014-11-22 20:36:51 +00:00
link.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
mail.php Update PHPMailer to 5.2.10 from 5.2.7. 2015-07-08 17:15:02 +00:00
media.php Fix a unit test failure after [33489]. 2015-07-29 22:14:33 +00:00
meta.php Update the tests for get_metadata() to reflect the revert in r30701. 2014-12-02 03:43:17 +00:00
multisite.php Improve tests for is_email_address_unsafe(). 2015-05-28 16:05:30 +00:00
post.php When generating a fallback post_name using the post ID, wp_insert_post() should clear the post cache immediately. 2015-08-18 02:50:23 +00:00
query.php Use assertEqualSets() in WP_Query::parse_tax_query() tests. 2015-07-07 00:57:04 +00:00
rewrite.php Implement canonical and url_to_postid() tests for child pages which share a post name with other child pages. 2015-06-24 00:40:45 +00:00
shortcode.php Shortcodes: Trim whitespace after sanitizing the shortcode output. 2015-08-09 20:48:02 +00:00
taxonomy.php Add Unit Tests for get_objects_in_term() 2015-07-12 20:12:19 +00:00
term.php Improve unit tests for wp_unique_term_slug(). 2015-05-15 20:37:51 +00:00
theme.php Fix formatting in [29946]. 2014-10-17 22:14:49 +00:00
upload.php wp_upload_dir() has a (little-known?) side effect: if you call it, it will attempt to create an uploads directory for the current month. As such, tearDown() and cleanup routines have to be in sync with this behavior when deleting bogus directories used in unit tests. 2014-11-30 19:05:52 +00:00
url.php In get_adjacent_post(), return private post if the current user has the capacity to read it. 2015-01-30 02:19:46 +00:00
user.php In wp_insert_user(), comparing an email address against the user's old email address should not be case-sensitive. 2015-07-07 19:28:46 +00:00
walker.php Add unit tests for Walker class. 2014-08-01 20:35:25 +00:00
widgets.php Add support for WP_Widget::get_settings() returning ArrayIterator/ArrayObject instances. 2015-05-26 16:50:03 +00:00