Make WordPress Core


Ignore:
Timestamp:
09/29/2023 03:22:12 PM (17 months ago)
Author:
jorbin
Message:

Tests: Reduce usage of assertEquals

Replaces assertSame with assertCount in a number of tests.

Props ayeshrajans, jorbin.
See #58956.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/query.php

    r56548 r56746  
    11851185        $parts = mb_split( '\)\s+AND\s+\(', $sql );
    11861186        $this->assertIsArray( $parts, 'SQL query cannot be split into multiple parts using operator AND.' );
    1187         $this->assertSame( 2, count( $parts ), 'SQL query does not contain correct number of AND operators.' );
     1187        $this->assertCount( 2, $parts, 'SQL query does not contain correct number of AND operators.' );
    11881188
    11891189        $this->assertStringNotContainsString( 'OR', $sql, 'SQL query contains conditions joined by operator OR.' );
     
    12321232        $parts = mb_split( '\)\s+OR\s+\(', $sql );
    12331233        $this->assertIsArray( $parts, 'SQL query cannot be split into multiple parts using operator OR.' );
    1234         $this->assertSame( 2, count( $parts ), 'SQL query does not contain correct number of OR operators.' );
     1234        $this->assertCount( 2, $parts, 'SQL query does not contain correct number of OR operators.' );
    12351235
    12361236        // Checking number of occurrences of AND while skipping the one at the beginning.
     
    12781278        $parts = mb_split( '\)\s+AND\s+\(', $sql );
    12791279        $this->assertIsArray( $parts, 'SQL query cannot be split into multiple parts using operator AND.' );
    1280         $this->assertSame( 2, count( $parts ), 'SQL query does not contain correct number of AND operators.' );
     1280        $this->assertCount( 2, $parts, 'SQL query does not contain correct number of AND operators.' );
    12811281
    12821282        $this->assertStringNotContainsString( 'OR', $sql, 'SQL query contains conditions joined by operator OR.' );
Note: See TracChangeset for help on using the changeset viewer.