Make WordPress Core

Changeset 64778


Ignore:
Timestamp:
10/27/2026 12:07:21 AM (4 weeks ago)
Author:
lancewillett
Message:

Tests: Use strict comparisons for comment query counts.

Use assertNotSame() when checking that comment queries with different types or parent filters issue another database query. Both operands come from the integer query counter returned by get_num_queries().

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14727

Props shailu25.
See #64895.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/getPageOfComment.php

    r57987 r64778  
    158158                $this->assertSame( 1, $page_comments );
    159159
    160                 $this->assertNotEquals( $num_queries, get_num_queries() );
     160                $this->assertNotSame( $num_queries, get_num_queries() );
    161161        }
    162162
  • trunk/tests/phpunit/tests/comment/query.php

    r64488 r64778  
    36413641                );
    36423642
    3643                 $this->assertNotEquals( $num_queries, get_num_queries() );
     3643                $this->assertNotSame( $num_queries, get_num_queries() );
    36443644        }
    36453645
    … …  
    36663666                );
    36673667
    3668                 $this->assertNotEquals( $num_queries, get_num_queries() );
     3668                $this->assertNotSame( $num_queries, get_num_queries() );
    36693669        }
    36703670
Note: See TracChangeset for help on using the changeset viewer.