imap_close_basic.phpt [plain text]
--TEST--
Test imap_close() function : basic functionality
--SKIPIF--
<?php
require_once(dirname(__FILE__).'/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_close() : basic functionality ***\n";
require_once(dirname(__FILE__).'/imap_include.inc');
$stream_id = setup_test_mailbox('', 3, $mailbox); $options = CL_EXPUNGE;
for ($i = 1; $i < 4; $i++) {
imap_delete($stream_id, $i);
}
echo "\n-- Call to imap_close() with all possible arguments --\n";
var_dump( imap_close($stream_id, $options) );
$stream_id = imap_open($mailbox, $username, $password);
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
echo "\n-- Call to imap_close() with mandatory arguments --\n";
var_dump( imap_close($stream_id) );
?>
===DONE===
--CLEAN--
<?php
require_once(dirname(__FILE__).'/clean.inc');
?>
--EXPECTF--
*** Testing imap_close() : basic functionality ***
Create a temporary mailbox and add 3 msgs
.. mailbox '%sINBOX.phpttest' created
-- Call to imap_close() with all possible arguments --
bool(true)
There are now 0 msgs in mailbox '%sINBOX.phpttest'
-- Call to imap_close() with mandatory arguments --
bool(true)
===DONE===