You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: tests/phpunit/tests/multisite/populateNetworkHooks.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -59,10 +59,10 @@ public function test_before_populate_network_hook() {
59
59
$this->assertSame( 1, $this->action_counts['before_populate_network'], 'before_populate_network action should fire once' );
60
60
$this->assertSame( 1, $this->action_counts['after_populate_network'], 'after_populate_network action should fire once' );
61
61
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' );
0 commit comments