wordpress-develop/tests/phpunit/tests
Peter Wilson 260f13ab57 Media: Do not lazy load hidden images or embeds.
Improve the check for sourceless or dimensionless media when determining if the lazy loading attribute should be added to iframes and images. Never include the lazy loading attribute on embeds of WordPress posts as the iframe is initially hidden.

Including `loading="lazy"` on initially hidden iframes and images can prevent the media from loading in some browsers.

Props adamsilverstein, fabianpimminger, flixos90, johnbillion, jonkastonka, joyously, peterwilsoncc, SergeyBiryukov, SirStuey, swissspidy.
Fixes #52768.



git-svn-id: https://develop.svn.wordpress.org/trunk@50682 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-07 00:59:18 +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 Editor: Make block type aware of variations 2021-03-12 13:33:21 +00:00
ajax Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +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 Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +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: Move the get_current_commenter() method next to the test it's used in. 2021-03-21 12:53:24 +00:00
customize Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +00:00
date Tests: Rename some classes in phpunit/tests/date/ per the naming conventions. 2021-02-11 21:20:41 +00:00
db Tests: Add missing @covers tags for files in phpunit/tests/db/. 2021-02-11 14:02:42 +00:00
dependencies Build/Test Tools: Switch back to running the PHPUnit test suite against the src directory instead of build. 2021-02-26 14:07:53 +00:00
editor Tests: Simplify @covers tags in editor/wpEditors.php using @coversDefaultClass annotation. 2021-02-13 13:45:23 +00:00
error-protection Tests: Correct some newly introduced @covers tags. 2021-03-16 18:44:40 +00:00
external-http Tests: Add missing @covers tags for files in phpunit/tests/external-http/. 2021-02-11 20:53:51 +00:00
feed Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite. 2021-02-27 16:54:52 +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 Docs: Update inline comments in some test files per the documentation standards. 2021-03-04 10:11:38 +00:00
functions Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
general Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
hooks Tests: Rename classes in phpunit/tests/hooks/ per the naming conventions. 2021-02-14 12:20:34 +00:00
http Tests: Correct some newly introduced @covers tags. 2021-03-16 18:44:40 +00:00
image Docs: Update inline comments in some test files per the documentation standards. 2021-03-04 10:11:38 +00:00
import Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
includes Tests: Consistently use the expectException() method instead of the older @expectedException annotation. 2020-09-18 13:22:22 +00:00
l10n Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
link Tests: Add missing @covers tags for files in phpunit/tests/link/. 2021-02-28 17:09:39 +00:00
load Tests: Add missing @covers tags for files in phpunit/tests/load/. 2021-02-28 17:12:03 +00:00
media Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
menu Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +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 Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
oembed Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +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 Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
privacy Docs: Add documentation for the ::setup_export_contents_test method used in personal data export tests. 2021-03-30 14:22:48 +00:00
query Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
rest-api REST API: Correct enum validation for numeric values. 2021-04-04 18:05:10 +00:00
rewrite Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
sitemaps Docs: Update inline comments in some test files per the documentation standards. 2021-03-04 10:11:38 +00:00
taxonomy Tests: Add missing parent::setUp() calls to all test classes. 2019-01-14 04:54:01 +00:00
term Taxonomy: Use a consistent check for the $rewrite['hierarchical'] parameter. 2021-03-23 13:53:50 +00:00
theme Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +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 Docs: Update inline comments in some test files per the documentation standards. 2021-03-04 10:11:38 +00:00
widgets General: Remove noreferrer from wp_targeted_link_rel() and other uses. 2020-10-19 23:37:53 +00:00
xmlrpc Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +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: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite. 2021-02-27 16:54:52 +00:00
auth.php Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +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 Docs: Spell "non-existent" in a consistent way. 2021-03-27 13:32:55 +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: Revert the introduction of the opt-in comment approval notification feature. 2021-02-17 13:06:43 +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 Docs: Spell "non-existent" in a consistent way. 2021-03-27 13:32:55 +00:00
db.php Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
dbdelta.php Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +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 Security, Site Health: Do not store HTTPS request error messages in an option. 2021-03-02 15:06:34 +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 Docs: Spell "non-existent" in a consistent way. 2021-03-27 13:32:55 +00:00
media.php Media: Do not lazy load hidden images or embeds. 2021-04-07 00:59:18 +00:00
meta.php Tests: Replace a few instances of assertNotEquals() with assertNotFalse(). 2020-09-07 04:11:54 +00:00
multisite.php Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +00:00
pluggable.php Cache API: Introduce wp_cache_get_multi(). 2020-06-09 19:45:27 +00:00
post.php Tests: Rename stick_post() and unstick_post() tests for a bit more clarity. 2021-02-18 12:02:42 +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 Robots: Remove contradictory directive check in wp_robots(). 2021-03-23 23:00:03 +00:00
shortcode.php Build/Test Tools: Ensure the test_php_and_js_shortcode_attribute_regexes_match() test can run when testing using either the src or build directory. 2021-03-05 15:26:22 +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 Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite. 2021-02-27 16:54:52 +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 Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite. 2021-02-27 16:54:52 +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