diff options
author | Gabriel Caruso <carusogabriel34@gmail.com> | 2018-02-09 22:49:21 -0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-10 19:20:23 +0100 |
commit | 21e3b0c70cb338a237cc11ccc27959eac9862ded (patch) | |
tree | 2c805882a8d0b48b40ea05ba3af1d9871f12fac8 /ext/standard/tests/mail | |
parent | 1422e2ffd19916a6c6a15577a36d1e21b5f630b8 (diff) | |
download | php-git-21e3b0c70cb338a237cc11ccc27959eac9862ded.tar.gz |
Remove trailing whitespace in inc files
Diffstat (limited to 'ext/standard/tests/mail')
-rw-r--r-- | ext/standard/tests/mail/mail_include.inc | 52 | ||||
-rw-r--r-- | ext/standard/tests/mail/mail_skipif.inc | 2 |
2 files changed, 27 insertions, 27 deletions
diff --git a/ext/standard/tests/mail/mail_include.inc b/ext/standard/tests/mail/mail_include.inc index 0785552e54..2197a1f8c1 100644 --- a/ext/standard/tests/mail/mail_include.inc +++ b/ext/standard/tests/mail/mail_include.inc @@ -3,46 +3,46 @@ $server = '{localhost}'; $default_mailbox = $server . "INBOX"; $domain = "example.com"; -$admin_user = "webmaster"; // a user with admin access +$admin_user = "webmaster"; // a user with admin access $username = "$admin_user@$domain"; $password = 'p4ssw0rd'; $users = array("webmaster", "info", "admin", "foo"); // tests require 4 valid userids $mailbox_prefix = "phpttest"; // name used for test mailbox /** - * Create a test mailbox and populate with msgs + * Create a test mailbox and populate with msgs * * @para, string mailbox_suffix Suffix used to uniquely identify mailboxes - * @param int message_count number of test msgs to be written to new mailbox - * + * @param int message_count number of test msgs to be written to new mailbox + * * @return IMAP stream to new mailbox on success; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ global $server, $default_mailbox, $username, $password; - + // open a stream to default mailbox $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; return false; - } - + } + echo "Create a temporary mailbox and add " . $message_count . " msgs\n"; $new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type); if ($new_mailbox === false) { echo "Cant create a temporary mailbox: " . imap_last_error(). "\n"; return false; } - + echo ".. mailbox '$new_mailbox' created\n"; - + // reopen stream to new mailbox if (imap_reopen($imap_stream, $new_mailbox) === false) { echo "cant re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n"; return false; } - + return $imap_stream; } @@ -55,9 +55,9 @@ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = nul function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type= "simple"){ global $default_mailbox, $mailbox_prefix; $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix; - + $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*'); - + // check mailbox does not already exist if ($mailboxes) { foreach($mailboxes as $value) { @@ -65,17 +65,17 @@ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type exit ("TEST FAILED : Mailbox '$mailbox' already exists\n"); } } - } + } if (imap_createmailbox($imap_stream, $mailbox) === false) { return false; } - + // Add number of test msgs requested if ($message_count > 0) { populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type); - } - + } + return $mailbox; } @@ -100,42 +100,42 @@ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "s $envelope["from"]= "foo@anywhere.com"; $envelope["to"] = "$users[0]@$domain"; $envelope["subject"] = "Test msg $i"; - + $part1["type"] = TYPEMULTIPART; $part1["subtype"] = "mixed"; - + $part2["type"] = TYPETEXT; $part2["subtype"] = "plain"; $part2["description"] = "imap_mail_compose() function"; $part2["contents.data"] = "message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx"; - + $part3["type"] = TYPETEXT; $part3["subtype"] = "plain"; $part3["description"] = "Example"; $part3["contents.data"] = "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"; - + $part4["type"] = TYPETEXT; $part4["subtype"] = "plain"; $part4["description"] = "Return Values"; $part4["contents.data"] = "message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz"; - + $body[1] = $part1; $body[2] = $part2; $body[3] = $part3; $body[4] = $part4; - + $msg = imap_mail_compose($envelope, $body); } - + imap_append($imap_stream, $mailbox, $msg); } } /** - * Get the mailbox name from a mailbox decription, i.e strip off server details. + * Get the mailbox name from a mailbox decription, i.e strip off server details. * - * @param string mailbox complete mailbox name - * @return mailbox name + * @param string mailbox complete mailbox name + * @return mailbox name */ function get_mailbox_name($mailbox){ diff --git a/ext/standard/tests/mail/mail_skipif.inc b/ext/standard/tests/mail/mail_skipif.inc index 006594021d..8da04b072a 100644 --- a/ext/standard/tests/mail/mail_skipif.inc +++ b/ext/standard/tests/mail/mail_skipif.inc @@ -10,7 +10,7 @@ if( substr(PHP_OS, 0, 3) == 'WIN' && extension_loaded('sockets')) { // imap uses tcp port 143 socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server"); } - + // Change these to make tests run successfully $mailbox = '{localhost}'; $username = 'webmaster@example.com'; |