Skip to content

Commit 1c0644e

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61420 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f7d457d commit 1c0644e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/phpunit/tests/multisite/populateNetworkHooks.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public function test_before_populate_network_hook() {
5959
$this->assertSame( 1, $this->action_counts['before_populate_network'], 'before_populate_network action should fire once' );
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 );
6868
remove_action( 'after_populate_network', array( $this, 'hook_action_counter' ), 10 );

0 commit comments

Comments
 (0)