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/multisite/site.php

    r54088 r54402  
    15561556                        $site3  = get_site( $site_id );
    15571557
    1558                         $this->assertEquals( 1, $site1->public );
    1559                         $this->assertEquals( 0, $site2->public );
    1560                         $this->assertEquals( 1, $site3->public );
     1558                        $this->assertSame( '1', $site1->public );
     1559                        $this->assertSame( '0', $site2->public );
     1560                        $this->assertSame( '1', $site3->public );
    15611561                }
    15621562
     
    24342434                        wpmu_create_blog( 'testsite1.example.org', '/new-blog/', 'New Blog', get_current_user_id(), $meta, 1 );
    24352435
    2436                         $this->assertEquals( $expected_meta, $this->wp_initialize_site_meta );
     2436                        $this->assertSameSetsWithIndex( $expected_meta, $this->wp_initialize_site_meta );
    24372437
    24382438                        $this->wp_initialize_site_meta = array();
     
    25352535                                        array(
    25362536                                                'public' => 0,
     2537                                                'foo'    => 'bar',
    25372538                                                'WPLANG' => 'en_US',
    2538                                                 'foo'    => 'bar',
    25392539                                        ),
    25402540                                ),
Note: See TracChangeset for help on using the changeset viewer.