Make WordPress Core


Ignore:
Timestamp:
05/10/2022 09:28:18 PM (3 years ago)
Author:
hellofromTonya
Message:

Editor: Use stricter assertions in comment template tests.

Backport of the remaining Comment Template block tests from Gutenberg:

  • assertEquals() replaced with assertSameSetsWithIndex().
  • assertion's argument order changed to ensure expected and then actual.

Follow-up to [53353], [53298], [53172], [53138].

Props bernhard-reiter.
Fixes #55708.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/renderCommentTemplate.php

    r53353 r53388  
    6767        );
    6868
    69         $this->assertEquals(
     69        $this->assertSameSetsWithIndex(
    7070            array(
    7171                'orderby'       => 'comment_date_gmt',
     
    124124        $block = new WP_Block( $parsed_blocks[0] );
    125125
    126         $this->assertEquals(
     126        $this->assertSameSetsWithIndex(
    127127            array(
    128128                'orderby'       => 'comment_date_gmt',
     
    422422        add_filter( 'wp_get_current_commenter', $commenter_filter );
    423423
    424         $this->assertEquals(
    425             build_comment_query_vars_from_block( $block ),
     424        $this->assertSameSetsWithIndex(
    426425            array(
    427426                'orderby'            => 'comment_date_gmt',
     
    434433                'number'             => 5,
    435434                'paged'              => 1,
    436             )
     435            ),
     436            build_comment_query_vars_from_block( $block )
    437437        );
    438438    }
Note: See TracChangeset for help on using the changeset viewer.