WordPress.org

Make WordPress Core

Changeset 48231


Ignore:
Timestamp:
06/30/2020 12:27:05 PM (5 months ago)
Author:
SergeyBiryukov
Message:

Tests: Place remove_filter() calls for _wp_update_comment_data_filter() before the assertions, for consistency with other tests.

Follow-up to [48154], [48222].

See #39732.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r48229 r48231  
    150150
    151151        add_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
     152
    152153        $result = wp_update_comment(
    153154            array(
     
    157158            true
    158159        );
     160
     161        remove_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
     162
    159163        $this->assertWPError( $result );
    160         remove_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
    161164    }
    162165
  • trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php

    r48228 r48231  
    28092809        $response = rest_get_server()->dispatch( $request );
    28102810
     2811        remove_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
     2812
    28112813        $this->assertErrorResponse( 'rest_comment_failed_edit', $response, 500 );
    2812 
    2813         remove_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
    28142814    }
    28152815
Note: See TracChangeset for help on using the changeset viewer.