Skip to content

Commit 3b9179e

Browse files
committed
Update assertions to account for deleted addCustomHeader code
1 parent ee57f4f commit 3b9179e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/phpunit/tests/pluggable/wpMail.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ public function test_wp_mail_custom_boundaries() {
8383

8484
// We need some better assertions here but these catch the failure for now.
8585
$this->assertSameIgnoreEOL( $body, $mailer->get_sent()->body );
86-
$this->assertStringContainsString( 'boundary="----=_Part_4892_25692638.1192452070893"', $mailer->get_sent()->header );
87-
$this->assertStringContainsString( 'charset=', $mailer->get_sent()->header );
86+
$headers = iconv_mime_decode_headers( $mailer->get_sent()->header );
87+
$this->assertArrayHasKey( 'Content-Type', $headers, 'Expected Content-Type header to be sent.' );
88+
$content_type_headers = (array) $headers['Content-Type'];
89+
$this->assertCount( 1, $content_type_headers, "Expected only one Content-Type header to be sent. Saw:\n" . implode( "\n", $content_type_headers ) );
90+
$this->assertSame( 'multipart/mixed; boundary="----=_Part_4892_25692638.1192452070893"; charset=', $content_type_headers[0], 'Expected Content-Type to match.' );
8891
}
8992

9093
/**

0 commit comments

Comments
 (0)