Make WordPress Core

Changeset 54446


Ignore:
Timestamp:
10/10/2022 03:57:11 PM (17 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in some WP_Theme_JSON tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Previously committed in [54402], these instances appear to be accidentally reverted to assertEquals() in [54443].

Follow-up to [52275], [54162], [54402], [54443].

See #55654.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r54444 r54446  
    34123412        );
    34133413
    3414         $this->assertEquals(
     3414        $this->assertSame(
    34153415            'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1rem; }body { --wp--style--block-gap: 1rem; }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: 1rem;margin-block-end: 0;}body .is-layout-flex{gap: 1rem;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}.wp-block-post-content{color: gray;}.wp-block-social-links.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flex{gap: 0;}.wp-block-buttons.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flex{gap: 0;}',
    34163416            $theme_json->get_stylesheet()
  • trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php

    r54444 r54446  
    389389        }
    390390        $query_count = count( $this->queries ) - $query_count;
    391         $this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
     391        $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
    392392
    393393        $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
     
    404404        }
    405405        $query_count = count( $this->queries ) - $query_count;
    406         $this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
     406        $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
    407407        remove_filter( 'query', array( $this, 'filter_db_query' ) );
    408408    }
Note: See TracChangeset for help on using the changeset viewer.