From 383287ce50fc93d480dd9837be67c87826b693d7 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 1 Dec 2020 15:18:54 +0000 Subject: [PATCH 1/2] Backport IMAP test modernization to PHP-8.0 branch --- ext/imap/tests/CONFLICTS | 1 - ext/imap/tests/README.md | 6 +- ext/imap/tests/bug31142_2.phpt | 4 +- ext/imap/tests/bug32589.phpt | 4 +- ext/imap/tests/bug35669.phpt | 56 ++++--- ext/imap/tests/bug44098.phpt | 13 +- ext/imap/tests/bug45705_1.phpt | 4 +- ext/imap/tests/bug45705_2.phpt | 4 +- ext/imap/tests/bug53377.phpt | 4 +- ext/imap/tests/bug63126.phpt | 13 +- ext/imap/tests/bug64076.phpt | 11 +- ext/imap/tests/bug77020.phpt | 6 +- ext/imap/tests/bug77153.phpt | 10 +- ext/imap/tests/bug80213.phpt | 7 +- ext/imap/tests/bug80226.phpt | 21 ++- ext/imap/tests/bug80438.phpt | 4 +- ext/imap/tests/clean.inc | 25 --- ext/imap/tests/imap_append_basic.phpt | 18 +-- ext/imap/tests/imap_body.phpt | 23 ++- ext/imap/tests/imap_body_basic.phpt | 18 +-- ext/imap/tests/imap_bodystruct_basic.phpt | 69 ++++---- ext/imap/tests/imap_clearflag_full_basic.phpt | 16 +- ext/imap/tests/imap_close_basic.phpt | 15 +- ext/imap/tests/imap_close_variation4.phpt | 17 +- ext/imap/tests/imap_createmailbox_basic.phpt | 16 +- ext/imap/tests/imap_errors_basic.phpt | 6 +- ext/imap/tests/imap_fetch_overview_basic.phpt | 11 +- .../tests/imap_fetch_overview_variation3.phpt | 26 +-- .../tests/imap_fetch_overview_variation5.phpt | 31 ++-- .../tests/imap_fetch_overview_variation6.phpt | 13 +- ext/imap/tests/imap_fetchbody_basic.phpt | 11 +- ext/imap/tests/imap_fetchbody_variation4.phpt | 13 +- ext/imap/tests/imap_fetchbody_variation6.phpt | 15 +- ext/imap/tests/imap_fetchheader_basic.phpt | 11 +- .../tests/imap_fetchheader_variation3.phpt | 13 +- .../tests/imap_fetchheader_variation5.phpt | 11 +- ext/imap/tests/imap_fetchstructure_basic.phpt | 11 +- ext/imap/tests/imap_gc_error.phpt | 16 +- ext/imap/tests/imap_getsubscribed_basic.phpt | 19 ++- ext/imap/tests/imap_headerinfo_basic.phpt | 11 +- ext/imap/tests/imap_list_basic.phpt | 14 +- ext/imap/tests/imap_lsub_basic.phpt | 21 ++- ext/imap/tests/imap_mail_copy_basic.phpt | 19 +-- ext/imap/tests/imap_mail_move_basic.phpt | 19 +-- ext/imap/tests/imap_mutf7_to_utf8.phpt | 1 - ext/imap/tests/imap_open_error.phpt | 6 +- ext/imap/tests/imap_renamemailbox_basic.phpt | 24 ++- .../imap_rfc822_parse_headers_basic.phpt | 11 +- ext/imap/tests/imap_savebody_basic.phpt | 11 +- ext/imap/tests/imap_timeout_basic.phpt | 2 +- ext/imap/tests/imap_undelete_basic.phpt | 13 +- ext/imap/tests/imap_utf8.phpt | 4 +- ext/imap/tests/imap_utf8_to_mutf7_basic.phpt | 1 - ext/imap/tests/setup.sh | 6 - ext/imap/tests/setup/clean.inc | 32 ++++ ext/imap/tests/{ => setup}/dovecot.conf | 0 ext/imap/tests/{ => setup}/dovecotpass | 0 ext/imap/tests/{ => setup}/imap_include.inc | 152 +++++++++--------- ext/imap/tests/setup/skipif.inc | 13 ++ ext/imap/tests/skipif.inc | 16 -- 60 files changed, 489 insertions(+), 479 deletions(-) delete mode 100644 ext/imap/tests/CONFLICTS delete mode 100644 ext/imap/tests/clean.inc delete mode 100644 ext/imap/tests/setup.sh create mode 100644 ext/imap/tests/setup/clean.inc rename ext/imap/tests/{ => setup}/dovecot.conf (100%) rename ext/imap/tests/{ => setup}/dovecotpass (100%) rename ext/imap/tests/{ => setup}/imap_include.inc (50%) create mode 100644 ext/imap/tests/setup/skipif.inc delete mode 100644 ext/imap/tests/skipif.inc diff --git a/ext/imap/tests/CONFLICTS b/ext/imap/tests/CONFLICTS deleted file mode 100644 index c301c0ffaca1d..0000000000000 --- a/ext/imap/tests/CONFLICTS +++ /dev/null @@ -1 +0,0 @@ -imap diff --git a/ext/imap/tests/README.md b/ext/imap/tests/README.md index 6324ab7f9e60b..1dee1d2663cb0 100644 --- a/ext/imap/tests/README.md +++ b/ext/imap/tests/README.md @@ -11,14 +11,14 @@ hMailServer on Windows. The tests are intended to be mailserver agnostic. ## Set-up tests on Ubuntu (checked on Ubuntu 18.04 (Bionic)) The necessary packages can be installed using the following command; -`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd` +`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd sendmail` The build of PHP will need to be compiled with the following flags: ``` --with-imap --with-kerberos --with-imap-ssl ``` -Then run the set-up script `ext/imap/tests/setup.sh` which will add the `vmail` +Then run the set-up script `ext/imap/tests/setup/setup.sh` which will add the `vmail` group and user which is used by Dovecot for the mailbox. It will also copy the -`ext/imap/tests/dovecot.conf` and `ext/imap/tests/dovecotpass` to the correct +`ext/imap/tests/setup/dovecot.conf` and `ext/imap/tests/setup/dovecotpass` to the correct location for Dovecot and restarts it for the new configuration to be enabled. diff --git a/ext/imap/tests/bug31142_2.phpt b/ext/imap/tests/bug31142_2.phpt index 004c054963d28..dbb4c9a6ad269 100644 --- a/ext/imap/tests/bug31142_2.phpt +++ b/ext/imap/tests/bug31142_2.phpt @@ -2,9 +2,7 @@ Bug #31142 test #2 (imap_mail_compose() generates incorrect output) --SKIPIF-- --FILE-- --FILE-- --FILE-- '; - $envelope["to"] = 'The bad smurf '; - $envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500'; +$envelope["from"] = 'Santa '; +$envelope["to"] = 'The bad smurf '; +$envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500'; - $multipart["type"] = TYPEMULTIPART; - $multipart["subtype"] = "MIXED"; - $body[] = $multipart; //add multipart stuff +$multipart["type"] = TYPEMULTIPART; +$multipart["subtype"] = "MIXED"; +$body[] = $multipart; //add multipart stuff - $textpart["type"] = TYPEMULTIPART; - $textpart["subtype"] = "ALTERNATIVE"; - $body[] = $textpart; //add body part +$textpart["type"] = TYPEMULTIPART; +$textpart["subtype"] = "ALTERNATIVE"; +$body[] = $textpart; //add body part - $plain["type"] = TYPETEXT; - $plain["subtype"] = "PLAIN"; - $plain["charset"] = "iso-8859-1"; - $plain["encoding"] = ENCQUOTEDPRINTABLE; - $plain["description"] = "Plaintype part of message"; - $plain['disposition'] = "inline"; - $plain["contents.data"] = 'See mom, it will crash'; +$plain["type"] = TYPETEXT; +$plain["subtype"] = "PLAIN"; +$plain["charset"] = "iso-8859-1"; +$plain["encoding"] = ENCQUOTEDPRINTABLE; +$plain["description"] = "Plaintype part of message"; +$plain['disposition'] = "inline"; +$plain["contents.data"] = 'See mom, it will crash'; - $body[] = $plain; //next add plain text part +$body[] = $plain; //next add plain text part - $html["type"] = TYPETEXT; - $html["subtype"] = "HTML"; - $html["charset"] = "iso-8859-1"; - $html["encoding"] = ENCQUOTEDPRINTABLE; - $html["description"] = "HTML part of message"; - $html['disposition'] = "inline"; - $html["contents.data"] = 'See mom, it will crash'; +$html["type"] = TYPETEXT; +$html["subtype"] = "HTML"; +$html["charset"] = "iso-8859-1"; +$html["encoding"] = ENCQUOTEDPRINTABLE; +$html["description"] = "HTML part of message"; +$html['disposition'] = "inline"; +$html["contents.data"] = 'See mom, it will crash'; - $body[] = $html; +$body[] = $html; - echo imap_mail_compose($envelope, $body); +echo imap_mail_compose($envelope, $body); ?> --EXPECTF-- Date: Wed, 04 Jan 2006 19:24:43 -0500 diff --git a/ext/imap/tests/bug44098.phpt b/ext/imap/tests/bug44098.phpt index 2a0f5cef44ab8..2e0f025d6a494 100644 --- a/ext/imap/tests/bug44098.phpt +++ b/ext/imap/tests/bug44098.phpt @@ -2,19 +2,14 @@ Bug #44098 (imap_utf8() returns only capital letters) --SKIPIF-- --FILE-- , expected \n"; -} else { - echo "ok"; -} +var_dump($res); + ?> --EXPECT-- -ok +string(17) "Luzon®14 dot CoM" diff --git a/ext/imap/tests/bug45705_1.phpt b/ext/imap/tests/bug45705_1.phpt index 05d3a0a2f6b9d..b8d33e675839e 100644 --- a/ext/imap/tests/bug45705_1.phpt +++ b/ext/imap/tests/bug45705_1.phpt @@ -2,9 +2,7 @@ Bug #45705 test #1 (imap rfc822_parse_adrlist() modifies passed address parameter) --SKIPIF-- --FILE-- --FILE-- --FILE-- +--CONFLICTS-- +defaultmailbox --FILE-- array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')), 'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'), ); -require_once(__DIR__.'/imap_include.inc'); +require_once(__DIR__. '/setup/imap_include.inc'); foreach ($tests as $name => $testparams) { echo "Test for $name\n"; - $in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1, $testparams); + $in = imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1, $testparams); if ($in) { if (is_array($errors = imap_errors())) { foreach ($errors as $err) { diff --git a/ext/imap/tests/bug64076.phpt b/ext/imap/tests/bug64076.phpt index ccafcfe2513b7..7e9ee6fd04da2 100644 --- a/ext/imap/tests/bug64076.phpt +++ b/ext/imap/tests/bug64076.phpt @@ -2,22 +2,23 @@ Bug #64076 (imap_sort() does not return FALSE on failure) --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- Create a temporary mailbox and add 2 msgs -.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created +New mailbox created bool(false) bool(true) diff --git a/ext/imap/tests/bug77020.phpt b/ext/imap/tests/bug77020.phpt index 43c8133700b73..d8286549830cb 100644 --- a/ext/imap/tests/bug77020.phpt +++ b/ext/imap/tests/bug77020.phpt @@ -6,8 +6,8 @@ if (!extension_loaded('imap')) die('skip imap extension not available'); ?> --FILE-- --EXPECTF-- -Warning: imap_mail(): No message string in mail command in %s on line %d -%S +%Adone diff --git a/ext/imap/tests/bug77153.phpt b/ext/imap/tests/bug77153.phpt index 7b759621fe16f..d767ce5472667 100644 --- a/ext/imap/tests/bug77153.phpt +++ b/ext/imap/tests/bug77153.phpt @@ -1,11 +1,11 @@ ---TEST-- +--TEST-- Bug #77153 (imap_open allows to run arbitrary shell commands via mailbox parameter) --SKIPIF-- +--CONFLICTS-- +defaultmailbox --FILE-- " . __DIR__ . '/__bug'; @@ -21,4 +21,4 @@ bool(false) --CLEAN-- \ No newline at end of file +?> diff --git a/ext/imap/tests/bug80213.phpt b/ext/imap/tests/bug80213.phpt index 9a7961df776d7..5bad48f306d39 100644 --- a/ext/imap/tests/bug80213.phpt +++ b/ext/imap/tests/bug80213.phpt @@ -14,8 +14,13 @@ $body = [[ 'type.parameters' => ['param'], 'disposition' => ['disp'], ]]; -imap_mail_compose($envelope, $body); +var_dump(imap_mail_compose($envelope, $body)); echo "done\n"; ?> --EXPECT-- +string(67) "MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; CHARSET=US-ASCII + + +" done diff --git a/ext/imap/tests/bug80226.phpt b/ext/imap/tests/bug80226.phpt index 95ec23517851a..6cf4cc8a58d9f 100644 --- a/ext/imap/tests/bug80226.phpt +++ b/ext/imap/tests/bug80226.phpt @@ -2,12 +2,25 @@ Bug #80226 (imap_sort() leaks sortpgm memory) --SKIPIF-- --FILE-- +--CLEAN-- + --EXPECT-- +Create a new mailbox for test +Create a temporary mailbox and add 0 msgs +New mailbox created +array(0) { +} diff --git a/ext/imap/tests/bug80438.phpt b/ext/imap/tests/bug80438.phpt index 12a1416a7e077..4514e932ef154 100644 --- a/ext/imap/tests/bug80438.phpt +++ b/ext/imap/tests/bug80438.phpt @@ -2,11 +2,10 @@ Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0 --SKIPIF-- --FILE-- --EXPECT-- -*** Testing imap_fetch_overview() : basic functionality *** Create a temporary mailbox and add 10 msgs New mailbox created array(6) { diff --git a/ext/imap/tests/clean.inc b/ext/imap/tests/clean.inc deleted file mode 100644 index 8bc566ba3233a..0000000000000 --- a/ext/imap/tests/clean.inc +++ /dev/null @@ -1,25 +0,0 @@ -Nmsgs; $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); - } - } -} - -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 e75b452596e74..ab2e46886e8fe 100644 --- a/ext/imap/tests/imap_append_basic.phpt +++ b/ext/imap/tests/imap_append_basic.phpt @@ -2,22 +2,19 @@ Test imap_append() function : basic functionality --SKIPIF-- --FILE-- Mailbox . "\n"; +echo "Add a couple of msgs to the new mailbox\n"; var_dump(imap_append($imap_stream, $mb_details->Mailbox , "From: webmaster@something.com\r\n" . "To: info@something.com\r\n" @@ -44,14 +41,15 @@ imap_close($imap_stream); ?> --CLEAN-- --EXPECTF-- *** Testing imap_append() : basic functionality *** Create a new mailbox for test Create a temporary mailbox and add 0 msgs -.. mailbox '%s' created -Add a couple of msgs to new mailbox {%s}INBOX.%s +New mailbox created +Add a couple of msgs to the new mailbox bool(true) bool(true) Msg Count after append : 2 diff --git a/ext/imap/tests/imap_body.phpt b/ext/imap/tests/imap_body.phpt index 6c2f6293984ca..59678ad53980f 100644 --- a/ext/imap/tests/imap_body.phpt +++ b/ext/imap/tests/imap_body.phpt @@ -5,33 +5,40 @@ Paul Sohier #phptestfest utrecht --SKIPIF-- --FILE-- getMessage() . \PHP_EOL; } try { - imap_body($stream_id,1,-1); + imap_body($imap_stream,1,-1); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } //Access not existing -var_dump(imap_body($stream_id, 255, FT_UID)); +var_dump(imap_body($imap_stream, 255, FT_UID)); -imap_close($stream_id); +imap_close($imap_stream); +?> +--CLEAN-- + --EXPECTF-- +Create a temporary mailbox and add 0 msgs +New mailbox created imap_body(): Argument #2 ($message_num) must be greater than 0 imap_body(): Argument #3 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL diff --git a/ext/imap/tests/imap_body_basic.phpt b/ext/imap/tests/imap_body_basic.phpt index 3034785a90f13..b5cb0fcd33072 100644 --- a/ext/imap/tests/imap_body_basic.phpt +++ b/ext/imap/tests/imap_body_basic.phpt @@ -2,19 +2,16 @@ Test imap_body() function : basic functionality --SKIPIF-- --FILE-- Nmsgs . "\n"; @@ -29,15 +26,16 @@ imap_close($imap_stream); ?> --CLEAN-- --EXPECTF-- *** Testing imap_body() : basic functionality *** Create a new mailbox for test Create a temporary mailbox and add 1 msgs -.. mailbox '%s' created +New mailbox created Msg Count in new mailbox: 1 string(%d) "1: this is a test message, please ignore -" +newline%r\R?%r" string(%d) "1: this is a test message, please ignore -" +newline%r\R?%r" diff --git a/ext/imap/tests/imap_bodystruct_basic.phpt b/ext/imap/tests/imap_bodystruct_basic.phpt index 56c88399c35f9..f969e86764aa6 100644 --- a/ext/imap/tests/imap_bodystruct_basic.phpt +++ b/ext/imap/tests/imap_bodystruct_basic.phpt @@ -2,47 +2,43 @@ Test imap_bodystruct() function : basic functionality --SKIPIF-- --FILE-- $mf)) - { - echo "$mf is 0 or 1\n"; - } - else - { - echo "$mf FAIL\n"; - } +foreach($mandatoryFields as $mf) { + if (isValid($m->$mf)) { + echo "$mf is 0 or 1\n"; + } else { + echo "$mf FAIL\n"; + } } -if(is_array($m->parameters)) -{ - echo "parameters is an array\n"; +if(is_array($m->parameters)) { + echo "parameters is an array\n"; } echo "\nTry to get part 4!\n"; @@ -50,28 +46,17 @@ var_dump(imap_bodystruct($imap_stream, 1, "4")); imap_close($imap_stream); -function isValid($param) -{ - if(($param == 0) || ($param == 1)) - { - $result=true; - } - else - { - $result=false; - } -return $result; -} ?> --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing string imap_bodystruct : basic functionality *** Create a new mailbox for test and add a multipart msgs Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created Get and validate structure of body part 1 ifsubtype is 0 or 1 diff --git a/ext/imap/tests/imap_clearflag_full_basic.phpt b/ext/imap/tests/imap_clearflag_full_basic.phpt index cc949385fc1d2..ee65d202ceb5e 100644 --- a/ext/imap/tests/imap_clearflag_full_basic.phpt +++ b/ext/imap/tests/imap_clearflag_full_basic.phpt @@ -2,19 +2,16 @@ Test imap_clearflag_full() function : basic functionality --SKIPIF-- --FILE-- Nmsgs . "\n"; @@ -44,13 +41,14 @@ imap_close($imap_stream); ?> --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_clearflag_full() : basic functionality *** Create a new mailbox for test Create a temporary mailbox and add 10 msgs -.. mailbox '{%s}%s' created +New mailbox created Initial msg count in new_mailbox : 10 Set some flags bool(true) diff --git a/ext/imap/tests/imap_close_basic.phpt b/ext/imap/tests/imap_close_basic.phpt index 57b2e7eab19a0..c962b62f7f8e0 100644 --- a/ext/imap/tests/imap_close_basic.phpt +++ b/ext/imap/tests/imap_close_basic.phpt @@ -2,17 +2,17 @@ Test imap_close() function : basic functionality --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_close() : basic functionality *** Create a temporary mailbox and add 3 msgs -.. mailbox '%sINBOX.phpttest' created +New mailbox created -- Call to imap_close() with all possible arguments -- bool(true) -There are now 0 msgs in mailbox '%sINBOX.phpttest' +There are now 0 msgs in mailbox '%sINBOX.phpttestimapclosebasic' -- Call to imap_close() with mandatory arguments -- bool(true) diff --git a/ext/imap/tests/imap_close_variation4.phpt b/ext/imap/tests/imap_close_variation4.phpt index b57f607f88ede..ff78ac985c54f 100644 --- a/ext/imap/tests/imap_close_variation4.phpt +++ b/ext/imap/tests/imap_close_variation4.phpt @@ -2,7 +2,7 @@ Test imap_close() function : usage variations - different ints as $flags arg --SKIPIF-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_close() : usage variations *** Create a temporary mailbox and add 3 msgs -.. mailbox '{%s}%s' created +New mailbox created -- Iteration 1 -- bool(true) diff --git a/ext/imap/tests/imap_createmailbox_basic.phpt b/ext/imap/tests/imap_createmailbox_basic.phpt index 84db5cbd31a49..83dc3d0f6e90e 100644 --- a/ext/imap/tests/imap_createmailbox_basic.phpt +++ b/ext/imap/tests/imap_createmailbox_basic.phpt @@ -2,22 +2,21 @@ Test imap_createmailbox() function : basic functionality --SKIPIF-- --FILE-- +--CLEAN-- + --EXPECTF-- *** Testing imap_createmailbox() : basic functionality *** +Create a temporary mailbox and add 0 msgs +New mailbox created Newname will be 'phpnewbox' Add a couple of msgs to 'phpnewbox' mailbox Your new mailbox 'phpnewbox' has the following status: diff --git a/ext/imap/tests/imap_errors_basic.phpt b/ext/imap/tests/imap_errors_basic.phpt index c89719376658d..f691a5c70521b 100644 --- a/ext/imap/tests/imap_errors_basic.phpt +++ b/ext/imap/tests/imap_errors_basic.phpt @@ -2,16 +2,16 @@ Test imap_errors() function : invalid password --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_fetch_overview() : basic functionality *** Create a temporary mailbox and add 2 msgs -.. mailbox '{%s}%s' created +New mailbox created -- All possible arguments -- diff --git a/ext/imap/tests/imap_fetch_overview_variation3.phpt b/ext/imap/tests/imap_fetch_overview_variation3.phpt index f4168873887c2..1ed528a17327f 100644 --- a/ext/imap/tests/imap_fetch_overview_variation3.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation3.phpt @@ -2,7 +2,7 @@ Test imap_fetch_overview() function : usage variations - FT_UID option --SKIPIF-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_fetch_overview() : usage variations *** Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created Testing with option value:string(1) "1" imap_fetch_overview() returns an object diff --git a/ext/imap/tests/imap_fetch_overview_variation5.phpt b/ext/imap/tests/imap_fetch_overview_variation5.phpt index 9774e682c1afc..6a8b6abd51879 100644 --- a/ext/imap/tests/imap_fetch_overview_variation5.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation5.phpt @@ -2,7 +2,7 @@ Test imap_fetch_overview() function : usage variations - $msg_no argument --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_fetch_overview() : usage variations *** Create a temporary mailbox and add 3 msgs -.. mailbox '{%s}%s' created +New mailbox created -- $msg_no is 0 -- Sequence out of range diff --git a/ext/imap/tests/imap_fetch_overview_variation6.phpt b/ext/imap/tests/imap_fetch_overview_variation6.phpt index 256f6310820b9..0535b3d5ac355 100644 --- a/ext/imap/tests/imap_fetch_overview_variation6.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation6.phpt @@ -2,7 +2,7 @@ Test imap_fetch_overview() function : usage variations - multipart message --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_fetch_overview() : usage variations *** Create a temporary mailbox and add 0 msgs -.. mailbox '{%s}%s' created +New mailbox created --> Object #1 size is %d diff --git a/ext/imap/tests/imap_fetchbody_basic.phpt b/ext/imap/tests/imap_fetchbody_basic.phpt index 3c16f939c8fb3..d0324383ea283 100644 --- a/ext/imap/tests/imap_fetchbody_basic.phpt +++ b/ext/imap/tests/imap_fetchbody_basic.phpt @@ -2,7 +2,7 @@ Test imap_fetchbody() function : basic functionality --SKIPIF-- --FILE-- seen ); ?> --CLEAN-- --EXPECTF-- *** Testing imap_fetchbody() : basic functionality *** Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created -- All possible arguments -- -- Option is FT_UID -- diff --git a/ext/imap/tests/imap_fetchbody_variation4.phpt b/ext/imap/tests/imap_fetchbody_variation4.phpt index df5d8956706ea..5e25dd1126b4f 100644 --- a/ext/imap/tests/imap_fetchbody_variation4.phpt +++ b/ext/imap/tests/imap_fetchbody_variation4.phpt @@ -2,7 +2,7 @@ Test imap_fetchbody() function : usage variations - FT_UID option --SKIPIF-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_fetchbody() : usage variations *** Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created -- Iteration 1 -- FT_UID valid diff --git a/ext/imap/tests/imap_fetchbody_variation6.phpt b/ext/imap/tests/imap_fetchbody_variation6.phpt index 8b3d73540a2c4..7889c40193342 100644 --- a/ext/imap/tests/imap_fetchbody_variation6.phpt +++ b/ext/imap/tests/imap_fetchbody_variation6.phpt @@ -2,7 +2,7 @@ Test imap_fetchbody() function : usage variations - $message_num arg --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_fetchbody() : usage variations *** Create a temporary mailbox and add 3 msgs -.. mailbox '{%s}%s' created +New mailbox created -- $message_num is 0 -- imap_fetchbody(): Argument #2 ($message_num) must be greater than 0 @@ -48,5 +49,5 @@ Warning: imap_fetchbody(): Bad message number in %s on line %d bool(false) -- $message_num is 1 -- -string(%s) "1: this is a test message, please ignore -%A" +string(%d) "1: this is a test message, please ignore +newline%r\R?%r" diff --git a/ext/imap/tests/imap_fetchheader_basic.phpt b/ext/imap/tests/imap_fetchheader_basic.phpt index 44f7de5a393a6..dc934e00cf274 100644 --- a/ext/imap/tests/imap_fetchheader_basic.phpt +++ b/ext/imap/tests/imap_fetchheader_basic.phpt @@ -2,15 +2,15 @@ Test imap_fetchheader() function : basic function --SKIPIF-- --FILE-- FT_UID, 'FT_INTERNAL' => FT_INTERNAL, 'FT_PREFETCHTEXT' => FT_PREFETCHTEXT); @@ -33,12 +33,13 @@ var_dump( imap_fetchheader($stream_id, $msg_no) ); ?> --CLEAN-- --EXPECTF-- *** Testing imap_fetchheader() : basic functionality *** Create a temporary mailbox and add 1 msgs -.. mailbox '%s.phpttest' created +New mailbox created -- All possible arguments -- -- Option is FT_UID -- diff --git a/ext/imap/tests/imap_fetchheader_variation3.phpt b/ext/imap/tests/imap_fetchheader_variation3.phpt index a457db0491cdb..1289087b7d4a6 100644 --- a/ext/imap/tests/imap_fetchheader_variation3.phpt +++ b/ext/imap/tests/imap_fetchheader_variation3.phpt @@ -2,7 +2,7 @@ Test imap_fetchheader() function : usage variations - FT_UID option --SKIPIF-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_fetchheader() : usage variations *** Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created -- Iteration 1 -- FT_UID valid diff --git a/ext/imap/tests/imap_fetchheader_variation5.phpt b/ext/imap/tests/imap_fetchheader_variation5.phpt index cb00986a06ff3..eb6493017b721 100644 --- a/ext/imap/tests/imap_fetchheader_variation5.phpt +++ b/ext/imap/tests/imap_fetchheader_variation5.phpt @@ -2,7 +2,7 @@ Test imap_fetchheader() function : usage variations - $message_num argument --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- *** Testing imap_fetchheader() : usage variations *** Create a temporary mailbox and add 3 msgs -.. mailbox '{%s}%s' created +New mailbox created -- $message_num is 0 -- imap_fetchheader(): Argument #2 ($message_num) must be greater than 0 diff --git a/ext/imap/tests/imap_fetchstructure_basic.phpt b/ext/imap/tests/imap_fetchstructure_basic.phpt index 24cd2307dd5af..2eb730c8902da 100644 --- a/ext/imap/tests/imap_fetchstructure_basic.phpt +++ b/ext/imap/tests/imap_fetchstructure_basic.phpt @@ -4,13 +4,13 @@ imap_fetchstructure() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- Create a temporary mailbox and add 1 msgs -.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created +New mailbox created imap_fetchstructure(): Argument #2 ($message_num) must be greater than 0 bool(true) bool(true) diff --git a/ext/imap/tests/imap_gc_error.phpt b/ext/imap/tests/imap_gc_error.phpt index 5b5b65d271422..7c6fa3da847f4 100644 --- a/ext/imap/tests/imap_gc_error.phpt +++ b/ext/imap/tests/imap_gc_error.phpt @@ -1,18 +1,17 @@ --TEST-- -imap_gc() incorrect parameter count +imap_gc() ValueError --CREDITS-- Paul Sohier #phptestfest utrecht --SKIPIF-- --FILE-- getMessage() . \PHP_EOL; } +?> +--CLEAN-- + --EXPECT-- +Create a temporary mailbox and add 1 msgs +New mailbox created imap_gc(): Argument #2 ($flags) must be a bitmask of IMAP_GC_TEXTS, IMAP_GC_ELT, and IMAP_GC_ENV diff --git a/ext/imap/tests/imap_getsubscribed_basic.phpt b/ext/imap/tests/imap_getsubscribed_basic.phpt index 8e5d85383daef..a1519042f134d 100644 --- a/ext/imap/tests/imap_getsubscribed_basic.phpt +++ b/ext/imap/tests/imap_getsubscribed_basic.phpt @@ -4,27 +4,29 @@ imap_getsubscribed() function : basic functionality Olivier Doucet --SKIPIF-- +--CONFLICTS-- +defaultmailbox --FILE-- --CLEAN-- --EXPECTF-- bool(false) diff --git a/ext/imap/tests/imap_headerinfo_basic.phpt b/ext/imap/tests/imap_headerinfo_basic.phpt index 056a46523c95a..0d84aee44bd25 100644 --- a/ext/imap/tests/imap_headerinfo_basic.phpt +++ b/ext/imap/tests/imap_headerinfo_basic.phpt @@ -4,13 +4,13 @@ imap_headerinfo() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created Check general fields bool(true) bool(true) diff --git a/ext/imap/tests/imap_list_basic.phpt b/ext/imap/tests/imap_list_basic.phpt index addcf70e775ba..e11c6c1bd09f5 100644 --- a/ext/imap/tests/imap_list_basic.phpt +++ b/ext/imap/tests/imap_list_basic.phpt @@ -4,20 +4,22 @@ imap_list() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- +--CONFLICTS-- +defaultmailbox --FILE-- --CLEAN-- --EXPECTF-- bool(false) diff --git a/ext/imap/tests/imap_mail_copy_basic.phpt b/ext/imap/tests/imap_mail_copy_basic.phpt index 25725478a63a1..312c8198a6125 100644 --- a/ext/imap/tests/imap_mail_copy_basic.phpt +++ b/ext/imap/tests/imap_mail_copy_basic.phpt @@ -4,36 +4,33 @@ Test imap_mail_copy() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- Nmsgs . "\n"; -var_dump(imap_mail_copy($imap_stream, '1', 'INBOX.'.$mailbox_prefix)); +var_dump(imap_mail_copy($imap_stream, '1', 'INBOX.' . IMAP_MAILBOX_PHPT_PREFIX . 'copybasic')); imap_close($imap_stream); ?> --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_mail_copy() : basic functionality *** Create a new mailbox for test Create a temporary mailbox and add 1 msgs -.. mailbox '%s' created +New mailbox created Msg Count in new mailbox: 1 bool(true) diff --git a/ext/imap/tests/imap_mail_move_basic.phpt b/ext/imap/tests/imap_mail_move_basic.phpt index 3988951f12ee6..3cd347b627d52 100644 --- a/ext/imap/tests/imap_mail_move_basic.phpt +++ b/ext/imap/tests/imap_mail_move_basic.phpt @@ -4,36 +4,33 @@ Test imap_mail_move() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- Nmsgs . "\n"; -var_dump(imap_mail_move($imap_stream, '1', 'INBOX.'.$mailbox_prefix)); +var_dump(imap_mail_move($imap_stream, '1', 'INBOX.' . IMAP_MAILBOX_PHPT_PREFIX . 'movebasic')); imap_close($imap_stream); ?> --CLEAN-- ---EXPECTF-- +--EXPECT-- *** Testing imap_mail_move() : basic functionality *** Create a new mailbox for test Create a temporary mailbox and add 1 msgs -.. mailbox '%s' created +New mailbox created Msg Count in new mailbox: 1 bool(true) diff --git a/ext/imap/tests/imap_mutf7_to_utf8.phpt b/ext/imap/tests/imap_mutf7_to_utf8.phpt index f45361f4a90b2..835a25428f0a4 100644 --- a/ext/imap/tests/imap_mutf7_to_utf8.phpt +++ b/ext/imap/tests/imap_mutf7_to_utf8.phpt @@ -2,7 +2,6 @@ imap_mutf7_to_utf8 --SKIPIF-- - --FILE-- --FILE-- @@ -20,10 +20,8 @@ try { echo $e->getMessage() . \PHP_EOL; } -require_once(__DIR__.'/imap_include.inc'); - try { - imap_open($default_mailbox, $username, $password, NIL, -1); + imap_open('', '', '', NIL, -1); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } diff --git a/ext/imap/tests/imap_renamemailbox_basic.phpt b/ext/imap/tests/imap_renamemailbox_basic.phpt index c6b1812d165b5..05f1e4a309924 100644 --- a/ext/imap/tests/imap_renamemailbox_basic.phpt +++ b/ext/imap/tests/imap_renamemailbox_basic.phpt @@ -4,20 +4,16 @@ imap_renamemailbox() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created Checking OK bool(true) -bool(true) diff --git a/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt b/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt index 87dc4aaf05b75..fd2dfb939dc61 100644 --- a/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt +++ b/ext/imap/tests/imap_rfc822_parse_headers_basic.phpt @@ -4,13 +4,13 @@ imap_rfc822_parse_headers() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created Check general fields bool(true) bool(true) diff --git a/ext/imap/tests/imap_savebody_basic.phpt b/ext/imap/tests/imap_savebody_basic.phpt index ccbaa1ba66cc4..38be6ab4a054c 100644 --- a/ext/imap/tests/imap_savebody_basic.phpt +++ b/ext/imap/tests/imap_savebody_basic.phpt @@ -4,13 +4,13 @@ imap_savebody() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --EXPECTF-- Create a temporary mailbox and add 1 msgs -.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created +New mailbox 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 f9618c3e3a33d..e449c3fdecf00 100644 --- a/ext/imap/tests/imap_timeout_basic.phpt +++ b/ext/imap/tests/imap_timeout_basic.phpt @@ -4,7 +4,7 @@ imap_timeout() function : basic functionality Olivier Doucet --SKIPIF-- --FILE-- --FILE-- --CLEAN-- ---EXPECTF-- +--EXPECT-- Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created +New mailbox created bool(true) diff --git a/ext/imap/tests/imap_utf8.phpt b/ext/imap/tests/imap_utf8.phpt index a82c3721c350a..522d4d6f5608a 100644 --- a/ext/imap/tests/imap_utf8.phpt +++ b/ext/imap/tests/imap_utf8.phpt @@ -11,8 +11,8 @@ var_dump(imap_utf8("test")); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(0) "" string(1) "1" -string(4) "%s" +string(4) "test" Done diff --git a/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt b/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt index 8037ae9491f0e..c0f3b06dc9a34 100644 --- a/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt +++ b/ext/imap/tests/imap_utf8_to_mutf7_basic.phpt @@ -2,7 +2,6 @@ imap_utf8_to_mutf7 --SKIPIF-- - --FILE-- Nmsgs; $i++) { + imap_delete($imap_stream, $i); +} + + +$mailboxes = imap_getmailboxes($imap_stream, IMAP_SERVER, '*'); + +if (!is_array($mailbox_suffix)) { + $mailbox_suffixes = [$mailbox_suffix]; +} else { + $mailbox_suffixes = $mailbox_suffix; +} + +foreach ($mailbox_suffixes as $mailbox_suffix) { + foreach($mailboxes as $value) { + // Only delete mailbox with our prefix (+ optional test suffix) + if (preg_match('/\{.*?\}INBOX\.' . IMAP_MAILBOX_PHPT_PREFIX . $mailbox_suffix .'$/', $value->name, $match) == 1) { + imap_deletemailbox($imap_stream, $value->name); + } + } +} + +imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/imap/tests/dovecot.conf b/ext/imap/tests/setup/dovecot.conf similarity index 100% rename from ext/imap/tests/dovecot.conf rename to ext/imap/tests/setup/dovecot.conf diff --git a/ext/imap/tests/dovecotpass b/ext/imap/tests/setup/dovecotpass similarity index 100% rename from ext/imap/tests/dovecotpass rename to ext/imap/tests/setup/dovecotpass diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/setup/imap_include.inc similarity index 50% rename from ext/imap/tests/imap_include.inc rename to ext/imap/tests/setup/imap_include.inc index e57d6516979f2..33e4e5ca16f7f 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/setup/imap_include.inc @@ -1,31 +1,34 @@ $mf; - if ($mf == 'udate') { - if (($z >= $start_time) && ($z <= time())) { - echo "$mf is OK\n"; - } else { - echo "$mf is BAD ($z)\n"; - } - } else { - echo "$mf is $z\n"; +function displayOverviewFields($resp, array $fields = MANDATORY_OVERVIEW_FIELDS) { + global $start_time; + foreach ($fields as $mf) { + $z = $resp->$mf; + if ($mf == 'udate') { + if (($z >= $start_time) && ($z <= time())) { + echo "$mf is OK\n"; + } else { + echo "$mf is BAD ($z)\n"; + } + } else { + echo "$mf is $z\n"; + } } - } } @@ -60,33 +61,27 @@ function displayOverviewFields($resp, $fields=null) { * * @param string mailbox_suffix Suffix used to uniquely identify mailboxes * @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 + * @param null $new_mailbox + * @param bool $simpleMessages + * @return resource IMAP stream to new mailbox + * @throws Exception */ -function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ - global $server, $default_mailbox, $username, $password; - +function setup_test_mailbox(string $mailbox_suffix, int $message_count, &$new_mailbox = null, bool $simpleMessages = true){ // open a stream to default mailbox - $imap_stream = imap_open($default_mailbox, $username, $password); + $imap_stream = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + throw new Exception("Cannot connect to IMAP server " . IMAP_SERVER . ": " . imap_last_error()); } 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; - } + $new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $simpleMessages); - echo ".. mailbox '$new_mailbox' created\n"; + echo "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; + throw new Exception("Can't re-open '$new_mailbox' mailbox: " . imap_last_error()); } return $imap_stream; @@ -96,11 +91,14 @@ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = nul * Create mailbox and fill with generic emails * * @param resource $imap_stream - * @param string $mailbox + * @param string $mailbox_suffix + * @param int $message_count + * @param bool $simpleMessages + * @return string + * @throws Exception */ -function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type= "simple"){ - global $default_mailbox, $mailbox_prefix; - $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix; +function create_mailbox($imap_stream, string $mailbox_suffix, int $message_count, bool $simpleMessages = true): string { + $mailbox = IMAP_DEFAULT_MAILBOX . '.' . IMAP_MAILBOX_PHPT_PREFIX . $mailbox_suffix; $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*'); @@ -108,18 +106,18 @@ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type if ($mailboxes) { foreach($mailboxes as $value) { if ($value->name == $mailbox) { - exit ("TEST FAILED : Mailbox '$mailbox' already exists\n"); + throw new Exception("Mailbox '$mailbox' already exists"); } } } if (imap_createmailbox($imap_stream, $mailbox) === false) { - return false; + throw new Exception("Can't create a temporary mailbox: " . imap_last_error()); } // Add number of test msgs requested if ($message_count > 0) { - populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type); + populate_mailbox($imap_stream, $mailbox, $message_count, $simpleMessages); } return $mailbox; @@ -130,21 +128,20 @@ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type * * @param resource $imap_stream * @param string $mailbox + * @param int $message_count + * @param bool $simpleMessages */ -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") { +function populate_mailbox($imap_stream, string $mailbox, int $message_count, bool $simpleMessages = true): void { + for ($i = 1; $i <= $message_count; $i++) { + if ($simpleMessages) { $msg = "From: foo@anywhere.com\r\n" - . "To: $users[0]@$domain\r\n" + . "To: ". IMAP_USERS[0] . "@" . IMAP_MAIL_DOMAIN . "\r\n" . "Subject: test$i\r\n" . "\r\n" - . "$i: this is a test message, please ignore\r\n"; + . "$i: this is a test message, please ignore\r\nnewline"; } else { $envelope["from"]= "foo@anywhere.com"; - $envelope["to"] = "$users[0]@$domain"; + $envelope["to"] = IMAP_USERS[0] . "@" . IMAP_MAIL_DOMAIN; $envelope["subject"] = "Test msg $i"; $part1["type"] = TYPEMULTIPART; @@ -181,16 +178,13 @@ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "s * Get the mailbox name from a mailbox description, i.e strip off server details. * * @param string mailbox complete mailbox name - * @return mailbox name + * @return string mailbox name */ -function get_mailbox_name($mailbox){ +function get_mailbox_name(string $mailboxName): string { - if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) { - echo "Unrecpognized mailbox name\n"; - return false; + if (preg_match('/\{.*?\}(.*)/', $mailboxName, $match) != 1) { + throw new Exception("Unrecognized mailbox name '$mailboxName'"); } return $match[1]; } - -?> diff --git a/ext/imap/tests/setup/skipif.inc b/ext/imap/tests/setup/skipif.inc new file mode 100644 index 0000000000000..c7dc24efd7d83 --- /dev/null +++ b/ext/imap/tests/setup/skipif.inc @@ -0,0 +1,13 @@ + From bfa8a0da960d04768ad2a9832ac43841bfc553ed Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 1 Dec 2020 15:49:03 +0000 Subject: [PATCH 2/2] Fix CI setup --- azure/setup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure/setup.yml b/azure/setup.yml index e0b4dc79da991..489df881596fb 100644 --- a/azure/setup.yml +++ b/azure/setup.yml @@ -20,8 +20,8 @@ steps: set -e sudo groupadd -g 5000 vmail sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail - sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf - sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass + sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf + sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass sudo service dovecot restart displayName: 'Configure IMAP'