Make WordPress Core


Ignore:
Timestamp:
10/05/2023 10:40:48 PM (7 months ago)
Author:
SergeyBiryukov
Message:

HTML API: Rename WP_HTML_Processor::createFragment() to follow WPCS.

WP_HTML_Processor::create_fragment() is the correct method name as per the WordPress PHP coding standards.

Follow-up to [56274].

Props dmsnell, jrf, hellofromTonya, SergeyBiryukov.
Fixes #59547.

File:
1 edited

Legend:

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

    r56493 r56790  
    5353     */
    5454    public function test_get_tag_is_null_once_document_is_finished() {
    55         $p = WP_HTML_Processor::createFragment( '<div class="test">Test</div>' );
     55        $p = WP_HTML_Processor::create_fragment( '<div class="test">Test</div>' );
    5656        $p->next_tag();
    5757        $this->assertSame( 'DIV', $p->get_tag() );
     
    7070     */
    7171    public function test_stops_processing_after_unsupported_elements() {
    72         $p = WP_HTML_Processor::createFragment( '<p><x-not-supported></p><p></p>' );
     72        $p = WP_HTML_Processor::create_fragment( '<p><x-not-supported></p><p></p>' );
    7373        $p->next_tag( 'P' );
    7474        $this->assertFalse( $p->next_tag(), 'Stepped into a tag after encountering X-NOT-SUPPORTED element when it should have aborted.' );
     
    9696     */
    9797    public function test_clear_to_navigate_after_seeking() {
    98         $p = WP_HTML_Processor::createFragment( '<div one><strong></strong></div><p><strong two></strong></p>' );
     98        $p = WP_HTML_Processor::create_fragment( '<div one><strong></strong></div><p><strong two></strong></p>' );
    9999
    100100        while ( $p->next_tag() ) {
     
    145145     */
    146146    public function test_fails_to_reconstruct_formatting_elements() {
    147         $p = WP_HTML_Processor::createFragment( '<p><em>One<p><em>Two<p><em>Three<p><em>Four' );
     147        $p = WP_HTML_Processor::create_fragment( '<p><em>One<p><em>Two<p><em>Three<p><em>Four' );
    148148
    149149        $this->assertTrue( $p->next_tag( 'EM' ), 'Could not find first EM.' );
Note: See TracChangeset for help on using the changeset viewer.