Make WordPress Core


Ignore:
Timestamp:
04/26/2024 01:51:06 PM (2 years ago)
Author:
dmsnell
Message:

HTML API: Tests should use expectedIncorrectUsage phpunit annotation

Some tests in the HTML API test suite use setExpectedIncorrectUsage.
The annotation @expectedIncorrectUsage can be used to simplify the tests.

Developed in https://github.com/WordPress/wordpress-develop/pull/6449
Discussed in https://core.trac.wordpress.org/ticket/61080

Fixes #61080.
Props dmsnell, jonsurrell.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php

    r57805 r58048  
    415415     *
    416416     * @covers WP_HTML_Tag_Processor::set_bookmark
     417     * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark
    417418     */
    418419    public function test_limits_the_number_of_bookmarks() {
     
    424425        }
    425426
    426         $this->setExpectedIncorrectUsage( 'WP_HTML_Tag_Processor::set_bookmark' );
    427427        $this->assertFalse( $processor->set_bookmark( 'final bookmark' ), "Allocated $i bookmarks, which is one above the limit" );
    428428    }
Note: See TracChangeset for help on using the changeset viewer.