wordpress-develop/tests/phpunit/tests/blocks
Felix Arntz bb6de6b8c0 Editor: Simplify usage of block_has_support() function by supporting a string.
Most block feature checks are for a single feature string, and for such cases it is not intuitive to require an array for the `$feature` parameter of the `block_has_support()` function.

This changeset brings it in line with other functions like `post_type_supports()`, allowing to pass a string for the `$feature`. An array is still supported for more complex cases where support for sub-features needs to be determined. This change furthermore includes a very minor performance tweak by avoiding calls to the `_wp_array_get()` function if a single feature string is being checked for.

Props thekt12, nihar007, mukesh27, swissspidy.
Fixes #58532.


git-svn-id: https://develop.svn.wordpress.org/trunk@56382 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 16:47:00 +00:00
..
context.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
editor.php Editor: rename reusable blocks to patterns. 2023-06-26 08:55:31 +00:00
getBlockTemplates.php Tests: Move the basic get_block_templates() test to the dedicated file. 2022-09-18 13:08:33 +00:00
register.php Editor: Register core block styles in one place. 2023-06-26 21:15:21 +00:00
registerCoreBlockStyleHandles.php Script Loader: Fix performance issues in wp_common_block_scripts_and_styles. 2023-06-27 11:26:12 +00:00
render.php Build/Tests Tools: Add unit tests for Gallery blocks. 2023-03-07 05:46:16 +00:00
renderCommentTemplate.php Editor: Add test for context setting in Comment Template block. 2023-07-18 16:07:49 +00:00
renderReusable.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
serialize.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
supportedStyles.php Editor: Lazily load Duotone settings only when needed. 2023-07-13 11:32:19 +00:00
wpBlock.php Editor: Simplify usage of block_has_support() function by supporting a string. 2023-08-10 16:47:00 +00:00
wpBlockList.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
wpBlockParser.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
wpBlockType.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
wpBlockTypeRegistry.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00