php-src/ext/imap/tests
Christoph M. Becker 71c22efae7
Fix GH-9309: Segfault when connection is used after imap_close()
We actually need to check whether `php_imap_object.imap_stream` is
`NULL` to detect that the connection has already been closed.

Closes GH-9313.
2022-08-12 16:24:30 +02:00
..
setup Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
bug31142_1.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug31142_2.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug32589.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug35669.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug40854.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug44098.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug45705_1.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug45705_2.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug46918.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug53377.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug63126.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug64076.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
bug75774.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug77020.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug77153.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
bug80213.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80215.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80216.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80220.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80223.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80226.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
bug80242.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80438.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
bug80710_1.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80710_2.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug80800.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
gh9309.phpt Fix GH-9309: Segfault when connection is used after imap_close() 2022-08-12 16:24:30 +02:00
imap_8bit_basic.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
imap_append_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_base64_basic.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
imap_binary_basic.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
imap_body_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_body_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_body_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_bodystruct_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_clearflag_full_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_clearflag_full_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_close_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_close_variation4.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_constructor.phpt Migrate more SKIPIF -> EXTENSIONS (#7139) 2021-06-11 12:58:44 +02:00
imap_createmailbox_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_delete_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_errors_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetch_overview_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetch_overview_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetch_overview_variation5.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetch_overview_variation6.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchbody_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchbody_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchbody_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchbody_variation6.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchheader_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchheader_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchheader_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchheader_variation5.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchmime_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchmime_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchstructure_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchstructure_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_fetchstructure_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_final.phpt Improve class inheritance error messages (#7307) 2021-07-27 09:42:37 +02:00
imap_gc_error.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_getsubscribed_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_headerinfo_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_list_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_lsub_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_mail_copy_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_mail_move_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_mutf7_to_utf8.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
imap_open_error.phpt Deprecate imap NIL constant 2021-07-08 16:48:16 +02:00
imap_open_with_cl_expunge.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_renamemailbox_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_reopen_with_cl_expunge.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_rfc822_parse_headers_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_rfc822_write_address_basic.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
imap_savebody_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_savebody_errors.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_savebody_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_search_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_setflag_full_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_setflag_full_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_sort_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_timeout_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_undelete_basic.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_undelete_uid.phpt Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
imap_utf8_to_mutf7_basic.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
imap_utf8.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
nil_constant.phpt Deprecate imap NIL constant 2021-07-08 16:48:16 +02:00
README.md Backport IMAP test modernization to PHP-8.0 branch 2020-12-01 16:38:08 +00:00

The imap extension tests

Many of the tests in this directory require a mail server to be running, if there is no mail server the test will skip and warn, see skipif.inc for details.

To make the tests run parameters in the skipif.inc and imap_include.inc files will need to be changed to match the local mailserver configuration.

The tests have been checked using dovecot (on Linux 32 and 64 bit systems) and 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 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/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/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.