From 30bb15b24a266eae1577b68cd980241b1a5adf40 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Fri, 18 Sep 2020 15:34:37 +0200 Subject: [PATCH] Fix IMAP tests Drop various ZPP checks and make them PASS Add CONFLICT file as the tests all hit the same mailbox --- ext/imap/tests/CONFLICTS | 1 + ext/imap/tests/imap_body.phpt | 18 +-------------- .../tests/imap_fetch_overview_variation3.phpt | 2 +- ext/imap/tests/imap_fetchbody_variation6.phpt | 16 ++++--------- .../tests/imap_fetchheader_variation5.phpt | 23 ++++--------------- ext/imap/tests/imap_fetchstructure_basic.phpt | 19 +-------------- ext/imap/tests/imap_gc_error.phpt | 15 ------------ ext/imap/tests/imap_getsubscribed_basic.phpt | 20 ---------------- ext/imap/tests/imap_list_basic.phpt | 20 ---------------- ext/imap/tests/imap_lsub_basic.phpt | 20 ---------------- ext/imap/tests/imap_open_error.phpt | 17 -------------- ext/imap/tests/imap_renamemailbox_basic.phpt | 22 ------------------ ext/imap/tests/imap_savebody_basic.phpt | 20 +--------------- ext/imap/tests/imap_timeout_basic.phpt | 12 ---------- 14 files changed, 13 insertions(+), 212 deletions(-) create mode 100644 ext/imap/tests/CONFLICTS diff --git a/ext/imap/tests/CONFLICTS b/ext/imap/tests/CONFLICTS new file mode 100644 index 0000000000..c301c0ffac --- /dev/null +++ b/ext/imap/tests/CONFLICTS @@ -0,0 +1 @@ +imap diff --git a/ext/imap/tests/imap_body.phpt b/ext/imap/tests/imap_body.phpt index a4e8069d04..4d4133c343 100644 --- a/ext/imap/tests/imap_body.phpt +++ b/ext/imap/tests/imap_body.phpt @@ -9,16 +9,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - Warning: imap_body(): Bad message number in %s on line %d Warning: imap_body(): Invalid value for the options parameter in %s on line %d diff --git a/ext/imap/tests/imap_fetch_overview_variation3.phpt b/ext/imap/tests/imap_fetch_overview_variation3.phpt index 13b5591dc5..419de4c951 100644 --- a/ext/imap/tests/imap_fetch_overview_variation3.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation3.phpt @@ -58,7 +58,7 @@ imap_fetch_overview() returns an object Testing with option value:bool(true) imap_fetch_overview() returns an object -Testing with option value:float(1) +Testing with option value:float(1.000000000000001) imap_fetch_overview() returns an object Testing with option value:float(1) diff --git a/ext/imap/tests/imap_fetchbody_variation6.phpt b/ext/imap/tests/imap_fetchbody_variation6.phpt index 20ac49edc8..75516f8381 100644 --- a/ext/imap/tests/imap_fetchbody_variation6.phpt +++ b/ext/imap/tests/imap_fetchbody_variation6.phpt @@ -19,9 +19,7 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 3); // set up temp mailbox with simple msgs $section = 1; -$sequences = array (0, 4, // out of range - '1,3', '1:3', // message sequences instead of numbers - ); +$sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; @@ -52,12 +50,6 @@ Warning: imap_fetchbody(): Bad message number in %s on line %d bool(false) --- $msg_no is 1,3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "1: this is a test message, please ignore%a" - --- $msg_no is 1:3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "1: this is a test message, please ignore%a" +-- $msg_no is 1 -- +string(42) "1: this is a test message, please ignore +" diff --git a/ext/imap/tests/imap_fetchheader_variation5.phpt b/ext/imap/tests/imap_fetchheader_variation5.phpt index 7ff8ca697e..2283861df8 100644 --- a/ext/imap/tests/imap_fetchheader_variation5.phpt +++ b/ext/imap/tests/imap_fetchheader_variation5.phpt @@ -17,9 +17,7 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs -$sequences = array (0, 4, // out of range - '1,3', '1:3', // message sequences instead of numbers - ); +$sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; @@ -53,24 +51,11 @@ Warning: imap_fetchheader(): Bad message number in %s on line %d bool(false) --- $msg_no is 1,3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "From: foo@anywhere.com -Subject: Test msg 1 -To: %s -MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" - -" - --- $msg_no is 1:3 -- - -Notice: A non well formed numeric value encountered in %s on line %d +-- $msg_no is 1 -- string(%d) "From: foo@anywhere.com Subject: Test msg 1 -To: %s +To: webmaster@something.com MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" +Content-Type: MULTIPART/mixed; BOUNDARY="%s=:%d" " diff --git a/ext/imap/tests/imap_fetchstructure_basic.phpt b/ext/imap/tests/imap_fetchstructure_basic.phpt index 0ff266a390..572556e6e1 100644 --- a/ext/imap/tests/imap_fetchstructure_basic.phpt +++ b/ext/imap/tests/imap_fetchstructure_basic.phpt @@ -8,17 +8,10 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_fetchstructure() expects at least 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d +.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created bool(true) bool(true) bool(true) diff --git a/ext/imap/tests/imap_gc_error.phpt b/ext/imap/tests/imap_gc_error.phpt index 2d825ce1fd..072af10393 100644 --- a/ext/imap/tests/imap_gc_error.phpt +++ b/ext/imap/tests/imap_gc_error.phpt @@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_gc() Expects exactly 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_gc(): Argument #1 must be of type resource, string given in %s on line %d - -Warning: imap_gc(): Argument #1 must be of type resource, bool given in %s on line %d - Warning: imap_gc(): Invalid value for the flags parameter in %s on line %d diff --git a/ext/imap/tests/imap_getsubscribed_basic.phpt b/ext/imap/tests/imap_getsubscribed_basic.phpt index 8995eadd05..bba82271c7 100644 --- a/ext/imap/tests/imap_getsubscribed_basic.phpt +++ b/ext/imap/tests/imap_getsubscribed_basic.phpt @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d bool(false) Checking OK bool(true) diff --git a/ext/imap/tests/imap_list_basic.phpt b/ext/imap/tests/imap_list_basic.phpt index 77df74af2b..addcf70e77 100644 --- a/ext/imap/tests/imap_list_basic.phpt +++ b/ext/imap/tests/imap_list_basic.phpt @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_list() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 2 given in %s on line %d bool(true) string(%s) "{%s}%s" diff --git a/ext/imap/tests/imap_lsub_basic.phpt b/ext/imap/tests/imap_lsub_basic.phpt index 591a023ed8..98875266d7 100644 --- a/ext/imap/tests/imap_lsub_basic.phpt +++ b/ext/imap/tests/imap_lsub_basic.phpt @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_lsub() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 2 given in %s on line %d bool(false) Checking OK bool(true) diff --git a/ext/imap/tests/imap_open_error.phpt b/ext/imap/tests/imap_open_error.phpt index b94c11d797..f9410519f2 100644 --- a/ext/imap/tests/imap_open_error.phpt +++ b/ext/imap/tests/imap_open_error.phpt @@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_open() expects at least 3 parameters, 0 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d Checking with incorrect parameters Warning: imap_open(): Couldn't open stream in %s on line %d diff --git a/ext/imap/tests/imap_renamemailbox_basic.phpt b/ext/imap/tests/imap_renamemailbox_basic.phpt index ee5ccb2be7..c6b1812d16 100644 --- a/ext/imap/tests/imap_renamemailbox_basic.phpt +++ b/ext/imap/tests/imap_renamemailbox_basic.phpt @@ -8,13 +8,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_renamemailbox() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs .. mailbox '{%s}%s' created - -Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d - -Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d Checking OK bool(true) bool(true) diff --git a/ext/imap/tests/imap_savebody_basic.phpt b/ext/imap/tests/imap_savebody_basic.phpt index 2be987a361..ccbaa1ba66 100644 --- a/ext/imap/tests/imap_savebody_basic.phpt +++ b/ext/imap/tests/imap_savebody_basic.phpt @@ -8,18 +8,10 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_savebody() expects at least 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d +.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created bool(true) Size: %d bool(true) diff --git a/ext/imap/tests/imap_timeout_basic.phpt b/ext/imap/tests/imap_timeout_basic.phpt index e1b958b3c7..f9618c3e3a 100644 --- a/ext/imap/tests/imap_timeout_basic.phpt +++ b/ext/imap/tests/imap_timeout_basic.phpt @@ -8,12 +8,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_timeout() expects at least 1 argument, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_timeout(): Argument #1 must be of type int, %s given in %s on line %d GET values: int(%d) int(%d) -- 2.40.0