Make WordPress Core


Ignore:
Timestamp:
02/18/2024 06:59:24 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in WP_Query tests involving ::$max_num_pages property.

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

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Follow-up to [48937], [54402], [54768], [57648].

Props costdev.
See #58683, #59655.

File:
1 edited

Legend:

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

    r56747 r57653  
    39893989
    39903990        $this->assertSame( 3, $q->found_comments );
    3991         $this->assertEquals( 2, $q->max_num_pages );
     3991        $this->assertSame( 2, $q->max_num_pages );
    39923992    }
    39933993
     
    40184018
    40194019        $this->assertSame( 3, $q->found_comments );
    4020         $this->assertEquals( 2, $q->max_num_pages );
     4020        $this->assertSame( 2, $q->max_num_pages );
    40214021    }
    40224022
Note: See TracChangeset for help on using the changeset viewer.