Make WordPress Core


Ignore:
Timestamp:
10/07/2022 01:02:07 AM (4 years ago)
Author:
desrosj
Message:

Tests: Replace some occurrences of assertEquals() with assertSame().

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

Props costdev, desrosj.
See #55654.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets.php

    r54112 r54402  
    12751275
    12761276                $expected_sidebars = array(
     1277                        'wp_inactive_widgets' => array(),
    12771278                        'primary'             => 1,
    1278                         'wp_inactive_widgets' => array(),
    1279                 );
    1280                 $this->assertEquals( $expected_sidebars, $new_next_theme_sidebars );
     1279                );
     1280                $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars );
    12811281        }
    12821282
     
    12961296                $new_next_theme_sidebars = wp_map_sidebars_widgets( $prev_theme_sidebars );
    12971297
    1298                 $this->assertEquals( $prev_theme_sidebars, $new_next_theme_sidebars );
     1298                $this->assertSameSetsWithIndex( $prev_theme_sidebars, $new_next_theme_sidebars );
    12991299        }
    13001300
     
    13191319                        'wp_inactive_widgets' => array(),
    13201320                );
    1321                 $this->assertEquals( $expected_sidebars, $new_next_theme_sidebars );
     1321                $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars );
    13221322        }
    13231323
     
    13631363                        'wp_inactive_widgets' => array(),
    13641364                );
    1365                 $this->assertEquals( $expected_sidebars, $new_next_theme_sidebars );
     1365                $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars );
    13661366        }
    13671367}
Note: See TracChangeset for help on using the changeset viewer.