Skip to content

Commit 78b37f3

Browse files
Tests: Use assertSame() in new_admin_email_subject filter test.
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 [57283]. See #59655. git-svn-id: https://develop.svn.wordpress.org/trunk@57706 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7ee50fe commit 78b37f3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/phpunit/tests/admin/includesMisc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public function test_shorten_url() {
3232
* @ticket 59520
3333
*/
3434
public function test_new_admin_email_subject_filter() {
35-
// Default value
35+
// Default value.
3636
$mailer = tests_retrieve_phpmailer_instance();
3737
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
38-
$this->assertEquals( '[Test Blog] New Admin Email Address', $mailer->get_sent()->subject );
38+
$this->assertSame( '[Test Blog] New Admin Email Address', $mailer->get_sent()->subject );
3939

40-
// Filtered value
40+
// Filtered value.
4141
add_filter(
4242
'new_admin_email_subject',
4343
function () {
@@ -51,6 +51,6 @@ function () {
5151

5252
$mailer = tests_retrieve_phpmailer_instance();
5353
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
54-
$this->assertEquals( 'Filtered Admin Email Address', $mailer->get_sent()->subject );
54+
$this->assertSame( 'Filtered Admin Email Address', $mailer->get_sent()->subject );
5555
}
5656
}

0 commit comments

Comments
 (0)