Make WordPress Core


Ignore:
Timestamp:
10/05/2023 10:40:48 PM (2 years 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/wpHtmlProcessorSemanticRules.php

    r56380 r56790  
    2828     */
    2929    public function test_in_body_skips_unexpected_button_closer() {
    30         $p = WP_HTML_Processor::createFragment( '<div>Test</button></div>' );
     30        $p = WP_HTML_Processor::create_fragment( '<div>Test</button></div>' );
    3131
    3232        $p->step();
     
    5353     */
    5454    public function test_in_body_button_with_no_button_in_scope() {
    55         $p = WP_HTML_Processor::createFragment( '<div><p>Click the button <button one>here</button>!</p></div><button two>not here</button>' );
     55        $p = WP_HTML_Processor::create_fragment( '<div><p>Click the button <button one>here</button>!</p></div><button two>not here</button>' );
    5656
    5757        $this->assertTrue( $p->next_tag( 'BUTTON' ), 'Could not find expected first button.' );
     
    8080     */
    8181    public function test_in_body_button_with_button_in_scope_as_parent() {
    82         $p = WP_HTML_Processor::createFragment( '<div><p>Click the button <button one>almost<button two>here</button>!</p></div><button three>not here</button>' );
     82        $p = WP_HTML_Processor::create_fragment( '<div><p>Click the button <button one>almost<button two>here</button>!</p></div><button three>not here</button>' );
    8383
    8484        $this->assertTrue( $p->next_tag( 'BUTTON' ), 'Could not find expected first button.' );
     
    115115     */
    116116    public function test_in_body_button_with_button_in_scope_as_ancestor() {
    117         $p = WP_HTML_Processor::createFragment( '<div><button one><p>Click the button <span><button two>here</button>!</span></p></div><button three>not here</button>' );
     117        $p = WP_HTML_Processor::create_fragment( '<div><button one><p>Click the button <span><button two>here</button>!</span></p></div><button three>not here</button>' );
    118118
    119119        // This button finds itself normally nesting inside the DIV.
     
    150150     */
    151151    public function test_in_body_any_other_end_tag_with_unclosed_special_element() {
    152         $p = WP_HTML_Processor::createFragment( '<div><span><p></span><div>' );
     152        $p = WP_HTML_Processor::create_fragment( '<div><span><p></span><div>' );
    153153
    154154        $p->next_tag( 'P' );
     
    173173     */
    174174    public function test_in_body_any_other_end_tag_with_unclosed_non_special_element() {
    175         $p = WP_HTML_Processor::createFragment( '<div><span><code></span><div>' );
     175        $p = WP_HTML_Processor::create_fragment( '<div><span><code></span><div>' );
    176176
    177177        $p->next_tag( 'CODE' );
Note: See TracChangeset for help on using the changeset viewer.