Make WordPress Core

Changeset 61420


Ignore:
Timestamp:
12/31/2025 07:00:23 PM (5 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in populate_network() 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 [60954].

See #64324.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/populateNetworkHooks.php

    r60954 r61420  
    6060            $this->assertSame( 1, $this->action_counts['after_populate_network'], 'after_populate_network action should fire once' );
    6161
    62             $this->assertEquals( $network_id, $this->action_args['before_populate_network']['network_id'], 'Network ID should match in before_populate_network hook' );
    63             $this->assertEquals( $domain, $this->action_args['before_populate_network']['domain'], 'Domain should match in before_populate_network hook' );
    64             $this->assertEquals( $network_id, $this->action_args['after_populate_network']['network_id'], 'Network ID should match in after_populate_network hook' );
    65             $this->assertEquals( $domain, $this->action_args['after_populate_network']['domain'], 'Domain should match in after_populate_network hook' );
     62            $this->assertSame( $network_id, $this->action_args['before_populate_network']['network_id'], 'Network ID should match in before_populate_network hook' );
     63            $this->assertSame( $domain, $this->action_args['before_populate_network']['domain'], 'Domain should match in before_populate_network hook' );
     64            $this->assertSame( $network_id, $this->action_args['after_populate_network']['network_id'], 'Network ID should match in after_populate_network hook' );
     65            $this->assertSame( $domain, $this->action_args['after_populate_network']['domain'], 'Domain should match in after_populate_network hook' );
    6666
    6767            remove_action( 'before_populate_network', array( $this, 'hook_action_counter' ), 10 );
Note: See TracChangeset for help on using the changeset viewer.