mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Tests: Use assertSame() in some newly introduced tests.
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 [50380], [50959], [50960], [50973], [50993], [51003], [51051], [51054]. See #52482. git-svn-id: https://develop.svn.wordpress.org/trunk@51079 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1782,7 +1782,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
function test_stick_post_with_duplicate_post_id_does_not_update_option() {
|
||||
update_option( 'sticky_posts', array( 1, 2, 2 ) );
|
||||
stick_post( 2 );
|
||||
$this->assertEquals( array( 1, 2, 2 ), get_option( 'sticky_posts' ) );
|
||||
$this->assertSameSets( array( 1, 2, 2 ), get_option( 'sticky_posts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1794,6 +1794,6 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
function test_unstick_post_with_non_sticky_post_id_does_not_update_option() {
|
||||
update_option( 'sticky_posts', array( 1, 2, 2 ) );
|
||||
unstick_post( 3 );
|
||||
$this->assertEquals( array( 1, 2, 2 ), get_option( 'sticky_posts' ) );
|
||||
$this->assertSameSets( array( 1, 2, 2 ), get_option( 'sticky_posts' ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user