mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Add unique messages to assertions for attachment filenames in wp_mail().
This makes the assertions more helpful, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines: > All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method. Follow-up to [55030], [55032]. Props mukesh27, costdev. See #28407. git-svn-id: https://develop.svn.wordpress.org/trunk@55087 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -477,9 +477,9 @@ class Tests_Pluggable_wpMail extends WP_UnitTestCase {
|
||||
|
||||
$attachments = $mailer->getAttachments();
|
||||
|
||||
$this->assertTrue( $mailer->attachmentExists() );
|
||||
$this->assertSame( $attachments[0][1], $attachments[0][2] );
|
||||
$this->assertSame( $attachments[1][1], $attachments[1][2] );
|
||||
$this->assertTrue( $mailer->attachmentExists(), 'There are no attachments.' );
|
||||
$this->assertSame( $attachments[0][1], $attachments[0][2], 'The first attachment name did not match.' );
|
||||
$this->assertSame( $attachments[1][1], $attachments[1][2], 'The second attachment name did not match.' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -505,9 +505,9 @@ class Tests_Pluggable_wpMail extends WP_UnitTestCase {
|
||||
|
||||
$attachments = $mailer->getAttachments();
|
||||
|
||||
$this->assertTrue( $mailer->attachmentExists() );
|
||||
$this->assertSame( 'alonac.jpg', $attachments[0][2] );
|
||||
$this->assertSame( 'selffaw.jpg', $attachments[1][2] );
|
||||
$this->assertTrue( $mailer->attachmentExists(), 'There are no attachments.' );
|
||||
$this->assertSame( 'alonac.jpg', $attachments[0][2], 'The first attachment name did not match.' );
|
||||
$this->assertSame( 'selffaw.jpg', $attachments[1][2], 'The second attachment name did not match.' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user