Make WordPress Core


Ignore:
Timestamp:
10/10/2022 03:57:11 PM (3 years 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.