mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 06:05:42 +00:00
Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate.
This ensures that not only the array values being compared are equal, but also that their type is the same. These new methods replace most of the existing instances of `assertEqualSets()` and `assertEqualSetsWithIndex()`. Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable. Follow-up to [48937]. See #38266. git-svn-id: https://develop.svn.wordpress.org/trunk@48939 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -977,7 +977,7 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
$this->assertContains( 'recent-comments-2', $sidebars_widgets['wp_inactive_widgets'] );
|
||||
|
||||
// Theme mod with previous widgets was not removed.
|
||||
$this->assertEqualSets( $old_sidebars_widgets, get_theme_mod( 'sidebars_widgets' ) );
|
||||
$this->assertSameSets( $old_sidebars_widgets, get_theme_mod( 'sidebars_widgets' ) );
|
||||
|
||||
// Sidebar_widgets option was not updated.
|
||||
$this->assertNotEquals( $sidebars_widgets, wp_get_sidebars_widgets() );
|
||||
@@ -1149,7 +1149,7 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
'main' => array(),
|
||||
'wp_inactive_widgets' => array(),
|
||||
);
|
||||
$this->assertEqualSets( $expected_sidebars, $new_next_theme_sidebars );
|
||||
$this->assertSameSets( $expected_sidebars, $new_next_theme_sidebars );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user