mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Coding Standards: Add visibility to methods in tests/phpunit/tests/.
Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods. Adds a `private` visibility to helper methods within test classes. Renames callbacks and helpers that previously started with a `_` prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit. Props costdev, jrf, hellofromTonya. Fixes #54177. git-svn-id: https://develop.svn.wordpress.org/trunk@52010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
* @group mail
|
||||
*/
|
||||
class Tests_Mail extends WP_UnitTestCase {
|
||||
function set_up() {
|
||||
public function set_up() {
|
||||
parent::set_up();
|
||||
reset_phpmailer_instance();
|
||||
}
|
||||
|
||||
function tear_down() {
|
||||
public function tear_down() {
|
||||
reset_phpmailer_instance();
|
||||
parent::tear_down();
|
||||
}
|
||||
@@ -22,12 +22,12 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
* all variables, which means that following tests would fail. To solve this issue we set `$this->Encoding`
|
||||
* back to 8bit in `MockPHPMailer::preSend`.
|
||||
*/
|
||||
function test_wp_mail_break_it() {
|
||||
public function test_wp_mail_break_it() {
|
||||
$content = str_repeat( 'A', 1000 );
|
||||
$this->assertTrue( wp_mail( WP_TESTS_EMAIL, 'Looong line testing', $content ) );
|
||||
}
|
||||
|
||||
function test_wp_mail_custom_boundaries() {
|
||||
public function test_wp_mail_custom_boundaries() {
|
||||
$to = 'user@example.com';
|
||||
$subject = 'Test email with custom boundaries';
|
||||
$headers = '' . "\n";
|
||||
@@ -88,7 +88,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 17305
|
||||
*/
|
||||
function test_wp_mail_rfc2822_addresses() {
|
||||
public function test_wp_mail_rfc2822_addresses() {
|
||||
$to = 'Name <address@tld.com>';
|
||||
$from = 'Another Name <another_address@different-tld.com>';
|
||||
$cc = 'The Carbon Guy <cc@cc.com>';
|
||||
@@ -118,7 +118,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 17305
|
||||
*/
|
||||
function test_wp_mail_multiple_rfc2822_to_addresses() {
|
||||
public function test_wp_mail_multiple_rfc2822_to_addresses() {
|
||||
$to = 'Name <address@tld.com>, Another Name <another_address@different-tld.com>';
|
||||
$subject = 'RFC2822 Testing';
|
||||
$message = 'My RFC822 Test Message';
|
||||
@@ -135,7 +135,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
$this->assertSameIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
|
||||
}
|
||||
|
||||
function test_wp_mail_multiple_to_addresses() {
|
||||
public function test_wp_mail_multiple_to_addresses() {
|
||||
$to = 'address@tld.com, another_address@different-tld.com';
|
||||
$subject = 'RFC2822 Testing';
|
||||
$message = 'My RFC822 Test Message';
|
||||
@@ -151,7 +151,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 18463
|
||||
*/
|
||||
function test_wp_mail_to_address_no_name() {
|
||||
public function test_wp_mail_to_address_no_name() {
|
||||
$to = '<address@tld.com>';
|
||||
$subject = 'RFC2822 Testing';
|
||||
$message = 'My RFC822 Test Message';
|
||||
@@ -166,7 +166,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 23642
|
||||
*/
|
||||
function test_wp_mail_return_value() {
|
||||
public function test_wp_mail_return_value() {
|
||||
// No errors.
|
||||
$this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body' ) );
|
||||
|
||||
@@ -289,11 +289,11 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
$this->assertSame( 1, substr_count( $mailer->get_sent()->header, $expected ) );
|
||||
}
|
||||
|
||||
function wp_mail_quoted_printable( $mailer ) {
|
||||
public function wp_mail_quoted_printable( $mailer ) {
|
||||
$mailer->Encoding = 'quoted-printable';
|
||||
}
|
||||
|
||||
function wp_mail_set_text_message( $mailer ) {
|
||||
public function wp_mail_set_text_message( $mailer ) {
|
||||
$mailer->AltBody = 'Wörld';
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
*
|
||||
* @ticket 28039
|
||||
*/
|
||||
function test_wp_mail_content_transfer_encoding_in_quoted_printable_multipart() {
|
||||
public function test_wp_mail_content_transfer_encoding_in_quoted_printable_multipart() {
|
||||
add_action( 'phpmailer_init', array( $this, 'wp_mail_quoted_printable' ) );
|
||||
add_action( 'phpmailer_init', array( $this, 'wp_mail_set_text_message' ) );
|
||||
|
||||
@@ -411,7 +411,7 @@ class Tests_Mail extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 50720
|
||||
*/
|
||||
function test_phpmailer_validator() {
|
||||
public function test_phpmailer_validator() {
|
||||
$phpmailer = $GLOBALS['phpmailer'];
|
||||
$this->assertTrue( $phpmailer->validateAddress( 'foo@192.168.1.1' ), 'Assert PHPMailer accepts IP address email addresses' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user