Make WordPress Core

Changeset 58176


Ignore:
Timestamp:
05/20/2024 02:38:33 PM (5 months ago)
Author:
SergeyBiryukov
Message:

Tests: Correct a number of invalid @covers tags.

This resolves a few warnings when running PHPUnit with the code coverage report:

"@covers WP_Privacy_Requests_List_Table::get_views" is invalid
"@covers WP_Block_Bindings_Registry::register_block_bindings_source" is invalid
"@covers WP_Block_Patterns_Registry::_register_theme_block_patterns" is invalid

The two removed @coversDefaultClass annotations are redundant, as the class name is already included in the individual @covers tags. Removing them allows @covers ::_register_theme_block_patterns to work as expected, where _register_theme_block_patterns is an standalone function, not a class method.

Follow-up to [54215], [56733], [57373], [57562].

See #60705.

Location:
trunk/tests/phpunit/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php

    r58097 r58176  
    197197     * @ticket 42066
    198198     *
    199      * @covers WP_Privacy_Requests_List_Table::get_views
     199     * @covers WP_Privacy_Requests_Table::get_views
    200200     */
    201201    public function test_get_views_should_return_views_by_default() {
  • trunk/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php

    r57641 r58176  
    99 * @group blocks
    1010 * @group block-bindings
    11  *
    12  * @coversDefaultClass WP_Block_Bindings_Registry
    1311 */
    1412class Tests_Blocks_wpBlockBindingsRegistry extends WP_UnitTestCase {
     
    228226     * @covers WP_Block_Bindings_Registry::register
    229227     * @covers WP_Block_Bindings_Registry::unregister
    230      * WP_Block_Bindings_Source::__construct
     228     * @covers WP_Block_Bindings_Source::__construct
    231229     */
    232230    public function test_unregister_block_source() {
     
    250248     * @covers WP_Block_Bindings_Registry::register
    251249     * @covers WP_Block_Bindings_Registry::get_all_registered
    252      * WP_Block_Bindings_Source::__construct
     250     * @covers WP_Block_Bindings_Source::__construct
    253251     */
    254252    public function test_get_all_registered() {
  • trunk/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php

    r57731 r58176  
    88 *
    99 * @group blocks
    10  *
    11  * @coversDefaultClass WP_Block_Patterns_Registry
    1210 */
    13 class Tests_Blocks_wpBlockPattersRegistry extends WP_UnitTestCase {
     11class Tests_Blocks_wpBlockPatternsRegistry extends WP_UnitTestCase {
    1412
    1513    /**
Note: See TracChangeset for help on using the changeset viewer.