diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /ext/imap | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'ext/imap')
38 files changed, 287 insertions, 287 deletions
diff --git a/ext/imap/tests/bug35669.phpt b/ext/imap/tests/bug35669.phpt index 1f8ca5d7c3..fc7a135bce 100644 --- a/ext/imap/tests/bug35669.phpt +++ b/ext/imap/tests/bug35669.phpt @@ -8,7 +8,7 @@ Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email) ?> --FILE-- <?php - $envelope["from"] = 'Santa <somewhere@northpole.gov>'; + $envelope["from"] = 'Santa <somewhere@northpole.gov>'; $envelope["to"] = 'The bad smurf <bad@smurf.com>'; $envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500'; diff --git a/ext/imap/tests/bug44098.phpt b/ext/imap/tests/bug44098.phpt index c424f05f54..2a0f5cef44 100644 --- a/ext/imap/tests/bug44098.phpt +++ b/ext/imap/tests/bug44098.phpt @@ -11,9 +11,9 @@ Bug #44098 (imap_utf8() returns only capital letters) $exp = 'Luzon®14 dot CoM'; $res = imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM'); if ($res != $exp) { - echo "failed: got <$res>, expected <exp>\n"; + echo "failed: got <$res>, expected <exp>\n"; } else { - echo "ok"; + echo "ok"; } ?> --EXPECT-- diff --git a/ext/imap/tests/bug75774.phpt b/ext/imap/tests/bug75774.phpt index 686ffe75b8..42f5a842c3 100644 --- a/ext/imap/tests/bug75774.phpt +++ b/ext/imap/tests/bug75774.phpt @@ -11,9 +11,9 @@ $fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774"; $var1=fopen($fn, "w"); try { - imap_append($var1, "", "", "", ""); + imap_append($var1, "", "", "", ""); } catch (Throwable $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo "\nException: " . $e->getMessage() . "\n"; } fclose($var1); diff --git a/ext/imap/tests/clean.inc b/ext/imap/tests/clean.inc index 4f381bf893..8bc566ba32 100644 --- a/ext/imap/tests/clean.inc +++ b/ext/imap/tests/clean.inc @@ -6,19 +6,19 @@ $imap_stream = imap_open($default_mailbox, $username, $password); // delete all msgs in default mailbox, i.e INBOX $check = imap_check($imap_stream); for ($i = 1; $i <= $check->Nmsgs; $i++) { - imap_delete($imap_stream, $i); + imap_delete($imap_stream, $i); } $mailboxes = imap_getmailboxes($imap_stream, $server, '*'); foreach($mailboxes as $value) { - // Only delete mailboxes with our prefix - if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) { - if (strlen($match[1]) >= strlen($mailbox_prefix) - && substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) { - imap_deletemailbox($imap_stream, $value->name); - } - } + // Only delete mailboxes with our prefix + if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) { + if (strlen($match[1]) >= strlen($mailbox_prefix) + && substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) { + imap_deletemailbox($imap_stream, $value->name); + } + } } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/imap/tests/imap_append_basic.phpt b/ext/imap/tests/imap_append_basic.phpt index 499a05cc4d..807c30c869 100644 --- a/ext/imap/tests/imap_append_basic.phpt +++ b/ext/imap/tests/imap_append_basic.phpt @@ -18,7 +18,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test\n"; $imap_stream = setup_test_mailbox("", 0); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $mb_details = imap_mailboxmsginfo($imap_stream); diff --git a/ext/imap/tests/imap_base64_basic.phpt b/ext/imap/tests/imap_base64_basic.phpt index a01545ceba..e5063f2c1c 100644 --- a/ext/imap/tests/imap_base64_basic.phpt +++ b/ext/imap/tests/imap_base64_basic.phpt @@ -16,25 +16,25 @@ echo "*** Testing imap_base64() : basic functionality ***\n"; $str = 'This is an example string to be base 64 encoded'; $base64 = base64_encode($str); if (imap_base64($base64) == $str) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED"; + echo "TEST FAILED"; } $str = '!£$%^&*()_+-={][];;@~#?/>.<,'; $base64 = base64_encode($str); if (imap_base64($base64) == $str) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED"; + echo "TEST FAILED"; } $hex = 'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF'; $base64 = base64_encode($hex); if (imap_base64($base64) == $hex) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED"; + echo "TEST FAILED"; } ?> diff --git a/ext/imap/tests/imap_body.phpt b/ext/imap/tests/imap_body.phpt index de5f7f286c..a4e8069d04 100644 --- a/ext/imap/tests/imap_body.phpt +++ b/ext/imap/tests/imap_body.phpt @@ -17,7 +17,7 @@ imap_body(''); imap_body(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_body($stream_id); imap_body($stream_id,-1); imap_body($stream_id,1,-1); diff --git a/ext/imap/tests/imap_body_basic.phpt b/ext/imap/tests/imap_body_basic.phpt index b3dcfa105e..ecc1da3ec6 100644 --- a/ext/imap/tests/imap_body_basic.phpt +++ b/ext/imap/tests/imap_body_basic.phpt @@ -18,7 +18,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test\n"; $imap_stream = setup_test_mailbox("", 1); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $check = imap_check($imap_stream); diff --git a/ext/imap/tests/imap_bodystruct_basic.phpt b/ext/imap/tests/imap_bodystruct_basic.phpt index c278c4c2af..9504f9acab 100644 --- a/ext/imap/tests/imap_bodystruct_basic.phpt +++ b/ext/imap/tests/imap_bodystruct_basic.phpt @@ -17,7 +17,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test and add a multipart msgs\n"; $imap_stream = setup_test_mailbox("", 1, $mailbox, "multipart"); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } echo "\nGet and validate structure of body part 1\n"; diff --git a/ext/imap/tests/imap_clearflag_full_basic.phpt b/ext/imap/tests/imap_clearflag_full_basic.phpt index 08416281ec..3afc105d5a 100644 --- a/ext/imap/tests/imap_clearflag_full_basic.phpt +++ b/ext/imap/tests/imap_clearflag_full_basic.phpt @@ -18,7 +18,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test\n"; $imap_stream = setup_test_mailbox("", 10); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $check = imap_check($imap_stream); diff --git a/ext/imap/tests/imap_close_basic.phpt b/ext/imap/tests/imap_close_basic.phpt index 0eb6d74f06..9e275aa4d0 100644 --- a/ext/imap/tests/imap_close_basic.phpt +++ b/ext/imap/tests/imap_close_basic.phpt @@ -22,7 +22,7 @@ $options = CL_EXPUNGE; // mark messages in inbox for deletion for ($i = 1; $i < 4; $i++) { - imap_delete($stream_id, $i); + imap_delete($stream_id, $i); } // Calling imap_close() with all possible arguments diff --git a/ext/imap/tests/imap_close_variation4.phpt b/ext/imap/tests/imap_close_variation4.phpt index f45d34845c..28a37ebb11 100644 --- a/ext/imap/tests/imap_close_variation4.phpt +++ b/ext/imap/tests/imap_close_variation4.phpt @@ -28,33 +28,33 @@ $stream_id = setup_test_mailbox('', 3, $mailbox); // set up temp mailbox with 3 $iterator = 1; foreach($inputs as $input) { - // mark added messages for deletion - for ($i = 1; $i < 4; $i++) { - imap_delete($stream_id, $i); - } - echo "\n-- Iteration $iterator --\n"; - var_dump( $check = imap_close($stream_id, $input) ); - - // check that imap_close was successful, if not call imap_close and explicitly set CL_EXPUNGE - if(false === $check) { - imap_close($stream_id, CL_EXPUNGE); - } else { - // if imap_close was successful test whether CL_EXPUNGE was set by doing a message count - $imap_stream = imap_open($mailbox, $username, $password); - $num_msg = imap_num_msg($imap_stream); - if ($num_msg != 0) { - echo "CL_EXPUNGE was not set, $num_msg msgs in mailbox\n"; - } else { - echo "CL_EXPUNGE was set\n"; - } - // call imap_close with CL_EXPUNGE explicitly set in case mailbox not empty - imap_close($imap_stream, CL_EXPUNGE); - } - $iterator++; - - // get $stream_id for next iteration - $stream_id = imap_open($mailbox, $username, $password); - populate_mailbox($stream_id, $mailbox, 3); + // mark added messages for deletion + for ($i = 1; $i < 4; $i++) { + imap_delete($stream_id, $i); + } + echo "\n-- Iteration $iterator --\n"; + var_dump( $check = imap_close($stream_id, $input) ); + + // check that imap_close was successful, if not call imap_close and explicitly set CL_EXPUNGE + if(false === $check) { + imap_close($stream_id, CL_EXPUNGE); + } else { + // if imap_close was successful test whether CL_EXPUNGE was set by doing a message count + $imap_stream = imap_open($mailbox, $username, $password); + $num_msg = imap_num_msg($imap_stream); + if ($num_msg != 0) { + echo "CL_EXPUNGE was not set, $num_msg msgs in mailbox\n"; + } else { + echo "CL_EXPUNGE was set\n"; + } + // call imap_close with CL_EXPUNGE explicitly set in case mailbox not empty + imap_close($imap_stream, CL_EXPUNGE); + } + $iterator++; + + // get $stream_id for next iteration + $stream_id = imap_open($mailbox, $username, $password); + populate_mailbox($stream_id, $mailbox, 3); }; ?> diff --git a/ext/imap/tests/imap_createmailbox_basic.phpt b/ext/imap/tests/imap_createmailbox_basic.phpt index 89e262ed84..b522e80dfb 100644 --- a/ext/imap/tests/imap_createmailbox_basic.phpt +++ b/ext/imap/tests/imap_createmailbox_basic.phpt @@ -16,7 +16,7 @@ echo "*** Testing imap_createmailbox() : basic functionality ***\n"; require_once(__DIR__.'/imap_include.inc'); $imap_stream = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); $newname = "phpnewbox"; @@ -25,8 +25,8 @@ echo "Newname will be '$newname'\n"; $newbox = imap_utf7_encode($server.$newname); if (imap_createmailbox($imap_stream, $newbox)) { - echo "Add a couple of msgs to '$newname' mailbox\n"; - populate_mailbox($imap_stream, $newbox, 2); + echo "Add a couple of msgs to '$newname' mailbox\n"; + populate_mailbox($imap_stream, $newbox, 2); $status = imap_status($imap_stream, $newbox, SA_ALL); if ($status) { diff --git a/ext/imap/tests/imap_fetch_overview_variation3.phpt b/ext/imap/tests/imap_fetch_overview_variation3.phpt index 3bfb627d40..9e99dc2a0f 100644 --- a/ext/imap/tests/imap_fetch_overview_variation3.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation3.phpt @@ -38,13 +38,13 @@ $options = array ('1', $iterator = 1; imap_check($stream_id); foreach($options as $option) { - echo "\nTesting with option value:"; - var_dump($option); - $overview = imap_fetch_overview($stream_id, $msg_uid, $option); - if ($overview) { + echo "\nTesting with option value:"; + var_dump($option); + $overview = imap_fetch_overview($stream_id, $msg_uid, $option); + if ($overview) { echo "imap_fetch_overview() returns an object\n"; } - $iterator++; + $iterator++; } ?> diff --git a/ext/imap/tests/imap_fetch_overview_variation5.phpt b/ext/imap/tests/imap_fetch_overview_variation5.phpt index eecb6f0b77..e06d3f5ef2 100644 --- a/ext/imap/tests/imap_fetch_overview_variation5.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation5.phpt @@ -27,15 +27,15 @@ $sequences = array (0, 4, '4', // out of range '1:3'); // pass uid without setting FT_UID option foreach($sequences as $msg_no) { - echo "\n-- \$msg_no is $msg_no --\n"; + echo "\n-- \$msg_no is $msg_no --\n"; $overview = imap_fetch_overview($stream_id, $msg_no); - if (!$overview) { - echo imap_last_error() . "\n"; + if (!$overview) { + echo imap_last_error() . "\n"; } else { - foreach($overview as $ov) { - echo "\n"; - displayOverviewFields($ov); - } + foreach($overview as $ov) { + echo "\n"; + displayOverviewFields($ov); + } } } diff --git a/ext/imap/tests/imap_fetch_overview_variation6.phpt b/ext/imap/tests/imap_fetch_overview_variation6.phpt index 1ca9fd51da..90bff01cea 100644 --- a/ext/imap/tests/imap_fetch_overview_variation6.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation6.phpt @@ -40,48 +40,48 @@ displayOverviewFields($a[0]); * @param string $mailbox */ function create_multipart_message($imap_stream, $mailbox) { - global $users, $domain; - $envelope["from"]= "foo@anywhere.com"; - $envelope["to"] = "$users[0]@$domain"; - $envelope["subject"] = "Test msg 1"; - - $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"; - - $file_handle = fopen(__FILE__, 'r+'); - $file_size = 1; - - $part4["type"] = TYPEAPPLICATION; - $part4["encoding"] = ENCBASE64; - $part4["subtype"] = "octet-stream"; - $part4["description"] = 'Test'; - $part4['disposition.type'] = 'attachment'; - $part4['disposition'] = array ('filename' => 'Test'); - $part4['type.parameters'] = array('name' => 'Test'); - $part4["contents.data"] = base64_encode(fread($file_handle, 1)); - - $body[1] = $part1; - $body[2] = $part2; - $body[3] = $part3; - $body[4] = $part4; - - $msg = imap_mail_compose($envelope, $body); - - if (imap_append($imap_stream, $mailbox, $msg) === false) { - echo imap_last_error() . "\n"; - echo "TEST FAILED : could not append new message to mailbox '$mailbox'\n"; - exit; - } + global $users, $domain; + $envelope["from"]= "foo@anywhere.com"; + $envelope["to"] = "$users[0]@$domain"; + $envelope["subject"] = "Test msg 1"; + + $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"; + + $file_handle = fopen(__FILE__, 'r+'); + $file_size = 1; + + $part4["type"] = TYPEAPPLICATION; + $part4["encoding"] = ENCBASE64; + $part4["subtype"] = "octet-stream"; + $part4["description"] = 'Test'; + $part4['disposition.type'] = 'attachment'; + $part4['disposition'] = array ('filename' => 'Test'); + $part4['type.parameters'] = array('name' => 'Test'); + $part4["contents.data"] = base64_encode(fread($file_handle, 1)); + + $body[1] = $part1; + $body[2] = $part2; + $body[3] = $part3; + $body[4] = $part4; + + $msg = imap_mail_compose($envelope, $body); + + if (imap_append($imap_stream, $mailbox, $msg) === false) { + echo imap_last_error() . "\n"; + echo "TEST FAILED : could not append new message to mailbox '$mailbox'\n"; + exit; + } } ?> diff --git a/ext/imap/tests/imap_fetchbody_basic.phpt b/ext/imap/tests/imap_fetchbody_basic.phpt index 797ec08bf5..597b3b71b6 100644 --- a/ext/imap/tests/imap_fetchbody_basic.phpt +++ b/ext/imap/tests/imap_fetchbody_basic.phpt @@ -27,26 +27,26 @@ $options = array ('FT_UID' => FT_UID, 'FT_PEEK' => FT_PEEK, 'FT_INTERNAL' => FT_ // Calling imap_fetchbody() with all possible arguments echo "\n-- All possible arguments --\n"; foreach ($options as $key => $option) { - echo "-- Option is $key --\n"; - switch ($key) { + echo "-- Option is $key --\n"; + switch ($key) { - case 'FT_UID'; - $msg_uid = imap_uid($stream_id, $msg_no); - var_dump( imap_fetchbody($stream_id, $msg_uid, $section, $option) ); - break; + case 'FT_UID'; + $msg_uid = imap_uid($stream_id, $msg_no); + var_dump( imap_fetchbody($stream_id, $msg_uid, $section, $option) ); + break; - case 'FT_PEEK'; - var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); - $overview = imap_fetch_overview($stream_id, 1); - echo "Seen Flag: "; - var_dump( $overview[0]->seen ); - break; + case 'FT_PEEK'; + var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); + $overview = imap_fetch_overview($stream_id, 1); + echo "Seen Flag: "; + var_dump( $overview[0]->seen ); + break; - case 'FT_INTERNAL'; - var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); - break; + case 'FT_INTERNAL'; + var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) ); + break; - } + } } // Calling imap_fetchbody() with mandatory arguments diff --git a/ext/imap/tests/imap_fetchbody_variation4.phpt b/ext/imap/tests/imap_fetchbody_variation4.phpt index 8648115896..b4b8afa92d 100644 --- a/ext/imap/tests/imap_fetchbody_variation4.phpt +++ b/ext/imap/tests/imap_fetchbody_variation4.phpt @@ -35,13 +35,13 @@ $options = array ('1', true, $iterator = 1; imap_check($stream_id); foreach($options as $option) { - echo "\n-- Iteration $iterator --\n"; - if(is_string(imap_fetchbody($stream_id, $msg_uid, $section, $option))) { - echo "FT_UID valid\n"; - } else { + echo "\n-- Iteration $iterator --\n"; + if(is_string(imap_fetchbody($stream_id, $msg_uid, $section, $option))) { + echo "FT_UID valid\n"; + } else { echo "FT_UID not valid\n"; } - $iterator++; + $iterator++; } ?> diff --git a/ext/imap/tests/imap_fetchbody_variation6.phpt b/ext/imap/tests/imap_fetchbody_variation6.phpt index 1f179633ef..2090bf3792 100644 --- a/ext/imap/tests/imap_fetchbody_variation6.phpt +++ b/ext/imap/tests/imap_fetchbody_variation6.phpt @@ -29,11 +29,11 @@ $sequences = array (0, 4, // out of range ); foreach($sequences as $msg_no) { - echo "\n-- \$msg_no is $msg_no --\n"; - var_dump($overview = imap_fetchbody($stream_id, $msg_no, $section)); - if (!$overview) { - echo imap_last_error() . "\n"; - } + echo "\n-- \$msg_no is $msg_no --\n"; + var_dump($overview = imap_fetchbody($stream_id, $msg_no, $section)); + if (!$overview) { + echo imap_last_error() . "\n"; + } } ?> --CLEAN-- diff --git a/ext/imap/tests/imap_fetchheader_basic.phpt b/ext/imap/tests/imap_fetchheader_basic.phpt index fd43ceec94..7da2a1b78c 100644 --- a/ext/imap/tests/imap_fetchheader_basic.phpt +++ b/ext/imap/tests/imap_fetchheader_basic.phpt @@ -23,13 +23,13 @@ $options = array('FT_UID' => FT_UID, 'FT_INTERNAL' => FT_INTERNAL, // Calling imap_fetchheader() with all possible arguments echo "\n-- All possible arguments --\n"; foreach ($options as $key => $option) { - echo "-- Option is $key --\n"; - if ($key == 'FT_UID') { - $msg_uid = imap_uid($stream_id, $msg_no); - var_dump(imap_fetchheader($stream_id, $msg_uid, $option)); - } else { - var_dump(imap_fetchheader($stream_id, $msg_no, $option)); - } + echo "-- Option is $key --\n"; + if ($key == 'FT_UID') { + $msg_uid = imap_uid($stream_id, $msg_no); + var_dump(imap_fetchheader($stream_id, $msg_uid, $option)); + } else { + var_dump(imap_fetchheader($stream_id, $msg_no, $option)); + } } // Calling imap_fetchheader() with mandatory arguments diff --git a/ext/imap/tests/imap_fetchheader_variation3.phpt b/ext/imap/tests/imap_fetchheader_variation3.phpt index 073e9e7eca..3430409fcb 100644 --- a/ext/imap/tests/imap_fetchheader_variation3.phpt +++ b/ext/imap/tests/imap_fetchheader_variation3.phpt @@ -34,13 +34,13 @@ $options = array ('1', true, $iterator = 1; imap_check($stream_id); foreach($options as $option) { - echo "\n-- Iteration $iterator --\n"; - if(is_string(imap_fetchheader($stream_id, $msg_uid, $option))) { - echo "FT_UID valid\n"; - } else { + echo "\n-- Iteration $iterator --\n"; + if(is_string(imap_fetchheader($stream_id, $msg_uid, $option))) { + echo "FT_UID valid\n"; + } else { echo "FT_UID not valid\n"; } - $iterator++; + $iterator++; } ?> --CLEAN-- diff --git a/ext/imap/tests/imap_fetchheader_variation5.phpt b/ext/imap/tests/imap_fetchheader_variation5.phpt index 77e334b6a1..548aac8935 100644 --- a/ext/imap/tests/imap_fetchheader_variation5.phpt +++ b/ext/imap/tests/imap_fetchheader_variation5.phpt @@ -27,11 +27,11 @@ $sequences = array (0, 4, // out of range ); foreach($sequences as $msg_no) { - echo "\n-- \$msg_no is $msg_no --\n"; - var_dump($overview = imap_fetchheader($stream_id, $msg_no)); - if (!$overview) { - echo imap_last_error() . "\n"; - } + echo "\n-- \$msg_no is $msg_no --\n"; + var_dump($overview = imap_fetchheader($stream_id, $msg_no)); + if (!$overview) { + echo imap_last_error() . "\n"; + } } // clear error stack diff --git a/ext/imap/tests/imap_fetchstructure_basic.phpt b/ext/imap/tests/imap_fetchstructure_basic.phpt index 5d83a27427..0ff266a390 100644 --- a/ext/imap/tests/imap_fetchstructure_basic.phpt +++ b/ext/imap/tests/imap_fetchstructure_basic.phpt @@ -28,7 +28,7 @@ $fields = array('type','encoding','ifsubtype','subtype', 'ifdescription','lines','bytes','parameters'); foreach ($fields as $key) { - var_dump(isset($z->$key)); + var_dump(isset($z->$key)); } var_dump($z->type); var_dump($z->encoding); diff --git a/ext/imap/tests/imap_gc_error.phpt b/ext/imap/tests/imap_gc_error.phpt index ee13f45ce7..9606c1ae2d 100644 --- a/ext/imap/tests/imap_gc_error.phpt +++ b/ext/imap/tests/imap_gc_error.phpt @@ -18,7 +18,7 @@ imap_gc(false, false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_gc($stream_id, -1); ?> diff --git a/ext/imap/tests/imap_getsubscribed_basic.phpt b/ext/imap/tests/imap_getsubscribed_basic.phpt index 666203a8c2..8995eadd05 100644 --- a/ext/imap/tests/imap_getsubscribed_basic.phpt +++ b/ext/imap/tests/imap_getsubscribed_basic.phpt @@ -17,7 +17,7 @@ imap_getsubscribed(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_getsubscribed($stream_id); imap_getsubscribed($stream_id,$default_mailbox); diff --git a/ext/imap/tests/imap_headerinfo_basic.phpt b/ext/imap/tests/imap_headerinfo_basic.phpt index c13e62f8bf..056a46523c 100644 --- a/ext/imap/tests/imap_headerinfo_basic.phpt +++ b/ext/imap/tests/imap_headerinfo_basic.phpt @@ -16,14 +16,14 @@ $z = imap_headerinfo($stream_id, 1); $fields = array ('toaddress','to','fromaddress','from', 'reply_toaddress','reply_to', - 'senderaddress', 'sender', + 'senderaddress', 'sender', 'subject','Subject', - 'Recent','Unseen','Flagged','Answered','Deleted','Draft', - 'Msgno','MailDate','Size','udate'); + 'Recent','Unseen','Flagged','Answered','Deleted','Draft', + 'Msgno','MailDate','Size','udate'); echo "Check general fields\n"; foreach ($fields as $key) { - var_dump(isset($z->$key)); + var_dump(isset($z->$key)); } echo "Check type\n"; @@ -35,44 +35,44 @@ var_dump($z->subject); var_dump($z->Subject); if ($z->Recent == 'R' || $z->Recent == 'N' || $z->Recent == ' ') { - echo "Recent: OK"; + echo "Recent: OK"; } else { - echo "Recent: error: ".$z->Recent; + echo "Recent: error: ".$z->Recent; } echo "\n"; if ($z->Unseen == 'U' || $z->Unseen == ' ') { - echo "Unseen: OK"; + echo "Unseen: OK"; } else { - echo "Unseen: error: ".$z->Unseen; + echo "Unseen: error: ".$z->Unseen; } echo "\n"; if ($z->Flagged == 'F' || $z->Flagged == ' ') { - echo "Flagged: OK"; + echo "Flagged: OK"; } else { - echo "Flagged: error: ".$z->Flagged; + echo "Flagged: error: ".$z->Flagged; } echo "\n"; if ($z->Answered == 'A' || $z->Answered == ' ') { - echo "Answered: OK"; + echo "Answered: OK"; } else { - echo "Answered: error"; + echo "Answered: error"; } echo "\n"; if ($z->Deleted == 'D' || $z->Deleted == ' ') { - echo "Deleted: OK"; + echo "Deleted: OK"; } else { - echo "Deleted: error"; + echo "Deleted: error"; } echo "\n"; if ($z->Draft == 'X' || $z->Draft == ' ') { - echo "Draft: OK"; + echo "Draft: OK"; } else { - echo "Draft: error"; + echo "Draft: error"; } echo "\n"; diff --git a/ext/imap/tests/imap_headerinfo_error.phpt b/ext/imap/tests/imap_headerinfo_error.phpt index 8d67b70130..3f3c593d06 100644 --- a/ext/imap/tests/imap_headerinfo_error.phpt +++ b/ext/imap/tests/imap_headerinfo_error.phpt @@ -17,7 +17,7 @@ imap_headerinfo(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_headerinfo($stream_id); diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index 47ac081c9f..7de634075a 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -64,32 +64,32 @@ function displayOverviewFields($resp, $fields=null) { * @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; + global $server, $default_mailbox, $username, $password; - // open a stream to default mailbox - $imap_stream = imap_open($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; - } + 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 "Can't create a temporary mailbox: " . 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 "Can't create a temporary mailbox: " . imap_last_error(). "\n"; + return false; + } - echo ".. mailbox '$new_mailbox' created\n"; + echo ".. mailbox '$new_mailbox' created\n"; - // reopen stream to new mailbox - if (imap_reopen($imap_stream, $new_mailbox) === false) { - echo "can't re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n"; - return false; - } + // reopen stream to new mailbox + if (imap_reopen($imap_stream, $new_mailbox) === false) { + echo "can't re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n"; + return false; + } - return $imap_stream; + return $imap_stream; } /** @@ -99,30 +99,30 @@ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = nul * @param string $mailbox */ 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) { - if ($value->name == $mailbox) { - 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; + 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) { + if ($value->name == $mailbox) { + 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; } /** @@ -133,48 +133,48 @@ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type */ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "simple"){ - global $users, $domain; - - for($i = 1; $i <= $message_count; $i++) { - if ($msg_type == "simple") { - $msg = "From: foo@anywhere.com\r\n" - . "To: $users[0]@$domain\r\n" - . "Subject: test$i\r\n" - . "\r\n" - . "$i: this is a test message, please ignore\r\n"; - } else { - $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); - } + global $users, $domain; + + for($i = 1; $i <= $message_count; $i++) { + if ($msg_type == "simple") { + $msg = "From: foo@anywhere.com\r\n" + . "To: $users[0]@$domain\r\n" + . "Subject: test$i\r\n" + . "\r\n" + . "$i: this is a test message, please ignore\r\n"; + } else { + $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); + } } /** @@ -185,12 +185,12 @@ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "s */ function get_mailbox_name($mailbox){ - if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) { - echo "Unrecpognized mailbox name\n"; - return false; - } + if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) { + echo "Unrecpognized mailbox name\n"; + return false; + } - return $match[1]; + return $match[1]; } ?> diff --git a/ext/imap/tests/imap_list_basic.phpt b/ext/imap/tests/imap_list_basic.phpt index 21f8a63894..77df74af2b 100644 --- a/ext/imap/tests/imap_list_basic.phpt +++ b/ext/imap/tests/imap_list_basic.phpt @@ -17,7 +17,7 @@ imap_list(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_list($stream_id); imap_list($stream_id,$default_mailbox); diff --git a/ext/imap/tests/imap_lsub_basic.phpt b/ext/imap/tests/imap_lsub_basic.phpt index 638479ca80..591a023ed8 100644 --- a/ext/imap/tests/imap_lsub_basic.phpt +++ b/ext/imap/tests/imap_lsub_basic.phpt @@ -17,7 +17,7 @@ imap_lsub(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_lsub($stream_id); imap_lsub($stream_id,$default_mailbox); diff --git a/ext/imap/tests/imap_mail_copy.phpt b/ext/imap/tests/imap_mail_copy.phpt index 9202556169..c82a003a59 100644 --- a/ext/imap/tests/imap_mail_copy.phpt +++ b/ext/imap/tests/imap_mail_copy.phpt @@ -23,7 +23,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Test with IMAP server\n"; $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); var_dump(imap_mail_copy($stream_id)); var_dump(imap_mail_copy($stream_id,-1)); diff --git a/ext/imap/tests/imap_mail_copy_basic.phpt b/ext/imap/tests/imap_mail_copy_basic.phpt index 7b8c69f104..335b4218e6 100644 --- a/ext/imap/tests/imap_mail_copy_basic.phpt +++ b/ext/imap/tests/imap_mail_copy_basic.phpt @@ -21,7 +21,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test\n"; $imap_stream = setup_test_mailbox("", 1); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $check = imap_check($imap_stream); diff --git a/ext/imap/tests/imap_mail_move.phpt b/ext/imap/tests/imap_mail_move.phpt index 3406288b27..d6d874b80d 100644 --- a/ext/imap/tests/imap_mail_move.phpt +++ b/ext/imap/tests/imap_mail_move.phpt @@ -23,7 +23,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Test with IMAP server\n"; $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); var_dump(imap_mail_move($stream_id)); var_dump(imap_mail_move($stream_id,-1)); diff --git a/ext/imap/tests/imap_mail_move_basic.phpt b/ext/imap/tests/imap_mail_move_basic.phpt index 390ec710c5..555d6e7a18 100644 --- a/ext/imap/tests/imap_mail_move_basic.phpt +++ b/ext/imap/tests/imap_mail_move_basic.phpt @@ -21,7 +21,7 @@ require_once(__DIR__.'/imap_include.inc'); echo "Create a new mailbox for test\n"; $imap_stream = setup_test_mailbox("", 1); if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $check = imap_check($imap_stream); diff --git a/ext/imap/tests/imap_renamemailbox_basic.phpt b/ext/imap/tests/imap_renamemailbox_basic.phpt index 91f99d13e3..ee5ccb2be7 100644 --- a/ext/imap/tests/imap_renamemailbox_basic.phpt +++ b/ext/imap/tests/imap_renamemailbox_basic.phpt @@ -21,7 +21,7 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 1); if (!is_resource($stream_id)) { - exit("TEST FAILED: Unable to create test mailbox\n"); + exit("TEST FAILED: Unable to create test mailbox\n"); } $newbox = $default_mailbox . "." . $mailbox_prefix; diff --git a/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt b/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt index 36fcc7f077..87dc4aaf05 100644 --- a/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt +++ b/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt @@ -16,14 +16,14 @@ $z = imap_headerinfo($stream_id, 1); $fields = array ('toaddress','to','fromaddress','from', 'reply_toaddress','reply_to', - 'senderaddress', 'sender', + 'senderaddress', 'sender', 'subject','Subject', - 'MailDate','Size','udate'); + 'MailDate','Size','udate'); echo "Check general fields\n"; foreach ($fields as $key) { - var_dump(isset($z->$key)); + var_dump(isset($z->$key)); } echo "Check type\n"; @@ -35,44 +35,44 @@ var_dump($z->subject); var_dump($z->Subject); if ($z->Recent == 'R' || $z->Recent == 'N' || $z->Recent == ' ') { - echo "Recent: OK"; + echo "Recent: OK"; } else { - echo "Recent: error"; + echo "Recent: error"; } echo "\n"; if ($z->Unseen == 'U' || $z->Unseen == ' ') { - echo "Unseen: OK"; + echo "Unseen: OK"; } else { - echo "Unseen: error"; + echo "Unseen: error"; } echo "\n"; if ($z->Flagged == 'F' || $z->Flagged == ' ') { - echo "Flagged: OK"; + echo "Flagged: OK"; } else { - echo "Flagged: error"; + echo "Flagged: error"; } echo "\n"; if ($z->Answered == 'A' || $z->Answered == ' ') { - echo "Answered: OK"; + echo "Answered: OK"; } else { - echo "Answered: error"; + echo "Answered: error"; } echo "\n"; if ($z->Deleted == 'D' || $z->Deleted == ' ') { - echo "Deleted: OK"; + echo "Deleted: OK"; } else { - echo "Deleted: error"; + echo "Deleted: error"; } echo "\n"; if ($z->Draft == 'X' || $z->Draft == ' ') { - echo "Draft: OK"; + echo "Draft: OK"; } else { - echo "Draft: error"; + echo "Draft: error"; } echo "\n"; diff --git a/ext/imap/tests/imap_undelete_error.phpt b/ext/imap/tests/imap_undelete_error.phpt index 0eae8033eb..972c8140c6 100644 --- a/ext/imap/tests/imap_undelete_error.phpt +++ b/ext/imap/tests/imap_undelete_error.phpt @@ -17,7 +17,7 @@ imap_undelete(false); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); imap_undelete($stream_id); diff --git a/ext/imap/tests/skipif.inc b/ext/imap/tests/skipif.inc index 12b1408634..2820bff5c6 100644 --- a/ext/imap/tests/skipif.inc +++ b/ext/imap/tests/skipif.inc @@ -10,7 +10,7 @@ $retries = 0; // don't retry connect on failure $mbox = @imap_open($mailbox, $username, $password, $options, $retries); if (!$mbox) { - die("skip could not connect to mailbox $mailbox"); + die("skip could not connect to mailbox $mailbox"); } imap_close($mbox); ?> |