wordpress-develop/tests/phpunit/tests
Sergey Biryukov 3d259c2b22 Tests: Use assertSame() in some newly introduced tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [49904], [49925], [49992], [50012], [50013], [50065], [50075], [50131], [50150], [50157].

See #38266, #52482.

git-svn-id: https://develop.svn.wordpress.org/trunk@50284 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-10 13:24:24 +00:00
..
actions Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
admin Tests: Ignore EOL differences in WP_List_Table::get_bulk_items() test for optgroups. 2020-11-24 20:41:13 +00:00
ajax Build/Test Tools: Run the Ajax test group for multisite. 2020-12-18 14:38:28 +00:00
attachment Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
blocks Editor: Introduce a dynamic filter for the content of a single block: 2021-02-01 18:04:36 +00:00
bookmark Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
canonical Canonical: Rename wp_force_plain_ugly_permalink() to match UI terminology. 2021-02-10 05:38:23 +00:00
category Menus: In Walker_Nav_Menu, Walker_Category, and Walker_Page, properly output link attributes having a legitimate "empty" value, for example an HTML data attribute with a value of zero (0). 2019-10-06 15:04:18 +00:00
comment Tests: Use shared post fixture in comment template tests. 2020-12-22 07:42:23 +00:00
customize Robots: Introduce Robots API. 2021-01-21 01:35:16 +00:00
date Tests: Add missing @covers tags for files in phpunit/tests/date/. 2021-02-09 19:55:35 +00:00
db Tests: Use consistent trailing punctuation in markTestSkipped() messages. 2020-09-21 14:05:23 +00:00
dependencies Fix wp.i18n.isRTL() 2021-02-08 23:49:33 +00:00
editor Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
error-protection Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
external-http Docs: Improve inline comments per the documentation standards. 2020-01-29 00:43:23 +00:00
feed Feed: Merge multiple header values to avoid fatal error. 2020-12-16 00:49:32 +00:00
filesystem Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
formatting 5.7-alpha-50000 🎉🙌❤️ 2021-01-21 12:37:39 +00:00
functions Security: add Content-Security-Policy script loaders. 2021-02-02 20:53:53 +00:00
general Robots: Introduce Robots API. 2021-01-21 01:35:16 +00:00
hooks Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
http Code Modernization: Use explicit visibility for class property declarations. 2020-10-17 16:24:35 +00:00
image Tests: Correct @ticket references in some test files. 2020-12-05 15:49:25 +00:00
import Tests: Use consistent trailing punctuation in fail() messages. 2020-09-22 12:32:39 +00:00
includes Tests: Consistently use the expectException() method instead of the older @expectedException annotation. 2020-09-18 13:22:22 +00:00
l10n I18N: Avoid PHP notices for relative URLs in load_script_textdomain(). 2020-11-17 20:50:21 +00:00
link Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
load Bootstrap: Enhance core's memory limit handling. 2016-07-08 14:36:37 +00:00
media Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
menu General: Remove noreferrer from wp_targeted_link_rel() and other uses. 2020-10-19 23:37:53 +00:00
meta Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
multisite Multisite: Cache absolute dirsize paths to avoid PHP 8 fatal. 2020-12-03 20:37:43 +00:00
oembed Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
option General: Replace older-style PHP type conversion functions with type casts. 2020-10-08 21:13:57 +00:00
pomo Tests: Simplify PluralFormsTest::test_exceptions(). 2020-09-18 14:11:11 +00:00
post Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
privacy Privacy: Rename the $send_confirmation_email parameter of wp_create_user_request() to $status, for clarity. 2021-02-05 15:48:59 +00:00
query Tests: Correct @ticket references in tests/query/invalidQueries.php. 2020-12-23 15:04:54 +00:00
rest-api Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
rewrite Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
sitemaps Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
taxonomy Tests: Add missing parent::setUp() calls to all test classes. 2019-01-14 04:54:01 +00:00
term Taxonomy: Add filter for post statuses when updating term count. 2021-02-02 21:04:58 +00:00
theme Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
url Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
user Security, Site Health: Make migrating a site to HTTPS a one-click interaction. 2021-02-02 00:08:01 +00:00
widgets General: Remove noreferrer from wp_targeted_link_rel() and other uses. 2020-10-19 23:37:53 +00:00
xmlrpc XML-RPC: Emit an appropriate HTTP status code when an error is returned in response to an XML-RPC request. 2020-12-21 20:21:12 +00:00
actions.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
adminbar.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
auth.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
avatar.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
basic.php Build/Test Tools: Fix tests after [50185]. 2021-02-05 03:36:26 +00:00
cache.php Build/Test Tools: Don't mark the Tests_Cache::test_flush() test as risky when running the test suite with an object cache in place. 2020-12-21 17:49:20 +00:00
canonical.php Canonical: Support multiple post types in redirect_guess_404_permalink(). 2020-10-18 23:21:03 +00:00
category.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
comment-submission.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
comment.php Comments: Fix a coding standards issue introduced in [50109]. 2021-01-31 18:16:35 +00:00
compat.php Tests: Consistently use the expectException() method instead of the older @expectedException annotation. 2020-09-18 13:22:22 +00:00
cron.php Cron API: Introduce a $wp_error parameter to functions that write to the cron array. 2021-02-02 13:47:46 +00:00
db.php Coding Standards: Replace alias PHP functions with the canonical names. 2020-10-18 17:25:10 +00:00
dbdelta.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
dependencies.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
file.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
filters.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
functions.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
https-detection.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
https-migration.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
kses.php Build/Test Tools: Use dataProviders for some kses tests. 2020-11-25 04:49:04 +00:00
l10n.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
link.php Canonical: Prevent ID enumeration of private post slugs. 2021-02-02 00:38:40 +00:00
locale.php Tests: Fix the failure in test_get_weekday_undefined_index() on PHP 8. 2020-09-18 10:56:27 +00:00
mail.php Mail: Introduce a pre_wp_mail filter to allow short-circuiting the wp_mail() function without having to override the pluggable function. 2020-12-20 15:07:23 +00:00
media.php Canonical: Prevent ID enumeration of private post slugs. 2021-02-02 00:38:40 +00:00
meta.php Tests: Replace a few instances of assertNotEquals() with assertNotFalse(). 2020-09-07 04:11:54 +00:00
multisite.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
pluggable.php Cache API: Introduce wp_cache_get_multi(). 2020-06-09 19:45:27 +00:00
post.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
query.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
rest-api.php General: Remove admin and login exceptions for https in get_home_url(). 2021-02-02 19:01:18 +00:00
rewrite.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
robots.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
shortcode.php Tests: Update third-party video URLs in unit tests with more permanent videos. 2020-10-10 01:37:18 +00:00
site-health.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
taxonomy.php Taxonomy: Revert Light-weight/partial term counts. 2020-10-30 04:57:16 +00:00
template.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
term.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
theme.php Bundled Themes: Make Twenty Twenty-One the default theme. 2020-10-20 02:02:37 +00:00
upload.php Code Modernization: Use explicit visibility for class property declarations. 2020-10-17 16:24:35 +00:00
url.php General: Remove admin and login exceptions for https in get_home_url(). 2021-02-02 19:01:18 +00:00
user.php Tests: Correct @ticket references in some test files. 2020-12-05 15:49:25 +00:00
walker.php Code Modernization: Use explicit visibility for class property declarations. 2020-10-17 16:24:35 +00:00
widgets.php Widgets: Introduce before_sidebar and after_sidebar arguments for register_sidebar(). 2020-10-19 15:38:11 +00:00
wp.php Coding Standards: Fix the remaining issues in /tests. 2019-07-08 00:55:20 +00:00