Make WordPress Core


Ignore:
Timestamp:
10/07/2022 01:02:07 AM (3 years ago)
Author:
desrosj
Message:

Tests: Replace some occurrences of assertEquals() with assertSame().

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

Props costdev, desrosj.
See #55654.

File:
1 edited

Legend:

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

    r54186 r54402  
    367367        }
    368368        $query_count = count( $this->queries ) - $query_count;
    369         $this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
     369        $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
    370370
    371371        $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
     
    382382        }
    383383        $query_count = count( $this->queries ) - $query_count;
    384         $this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
     384        $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
    385385        remove_filter( 'query', array( $this, 'filter_db_query' ) );
    386386    }
Note: See TracChangeset for help on using the changeset viewer.