| Current File : /home/mmdealscpanel/yummmdeals.com/alt-php84-pecl-imap_1.0.3-1.el8.zip |
PK #�ZX��:� � tests/imap_close_basic.phptnu �[��� --TEST--
Test imap_close() function : basic functionality
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_close() : basic functionality ***\n";
// include file for required variables in imap_open()
require_once(__DIR__.'/setup/imap_include.inc');
// Initialize required variables
$stream_id = setup_test_mailbox('imapclosebasic', 3, $mailbox); // set up temp mailbox with 3 messages
$options = CL_EXPUNGE;
// mark messages in inbox for deletion
for ($i = 1; $i < 4; $i++) {
imap_delete($stream_id, $i);
}
// Calling imap_close() with all possible arguments
echo "\n-- Call to imap_close() with all possible arguments --\n";
var_dump( imap_close($stream_id, $options) );
// check that CL_EXPUNGE worked
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
// Calling imap_close() with mandatory arguments
echo "\n-- Call to imap_close() with mandatory arguments --\n";
var_dump( imap_close($stream_id) );
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapclosebasic';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_close() : basic functionality ***
Create a temporary mailbox and add 3 msgs
New mailbox created
-- Call to imap_close() with all possible arguments --
bool(true)
There are now 0 msgs in mailbox '%sINBOX.phpttestimapclosebasic'
-- Call to imap_close() with mandatory arguments --
bool(true)
PK #�Z/��a[ [ tests/gh9309.phptnu �[��� --TEST--
Bug GH-9309 (Segfault when connection is used after imap_close())
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$stream_id = setup_test_mailbox('gh9309', 0, $mailbox);
imap_close($stream_id);
try {
imap_headers($stream_id);
} catch (ValueError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--CLEAN--
<?php
$mailbox_suffix = 'gh9309';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 0 msgs
New mailbox created
IMAP\Connection is already closed
PK #�Z%�ˬ � tests/imap_savebody_uid.phptnu �[��� --TEST--
imap_savebody() passing a unique ID
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapsavebodyuid", $msg_no, $uid);
$section = '';
$stream_uid = fopen('php://memory', 'w+');
imap_savebody($imap_mail_box, $stream_uid, $uid, $section, FT_UID);
$stream_msg_no = fopen('php://memory', 'w+');
imap_savebody($imap_mail_box, $stream_msg_no, $msg_no, $section);
// Compare what was written.
rewind($stream_uid);
rewind($stream_msg_no);
var_dump(stream_get_contents($stream_uid) === stream_get_contents($stream_msg_no));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapsavebodyuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
bool(true)
PK #�ZV�W� � ) tests/imap_fetch_overview_variation5.phptnu �[��� --TEST--
Test imap_fetch_overview() function : usage variations - $msg_no argument
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
/*
* Pass different sequences/msg numbers as $msg_no argument to test behaviour
* of imap_fetch_overview()
*/
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once __DIR__.'/setup/imap_include.inc';
$stream_id = setup_test_mailbox('imapfetchoverviewvar5', 3, $mailbox, false); // set up temp mailbox with 3 msgs
$sequences = [
0,
4, // out of range
'4', // out of range
'2',
'1,3',
'1, 2',
'1:3', // pass uid without setting FT_UID option
];
foreach ($sequences as $msg_no) {
echo "\n-- \$msg_no is $msg_no --\n";
$overview = imap_fetch_overview($stream_id, $msg_no);
if (!$overview) {
echo imap_last_error() . "\n";
} else {
foreach($overview as $ov) {
echo "\n";
displayOverviewFields($ov);
}
}
}
// clear error stack
imap_errors();
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapfetchoverviewvar5';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_fetch_overview() : usage variations ***
Create a temporary mailbox and add 3 msgs
New mailbox created
-- $msg_no is 0 --
Sequence out of range
-- $msg_no is 4 --
Sequence out of range
-- $msg_no is 4 --
Sequence out of range
-- $msg_no is 2 --
size is %d
uid is %d
msgno is 2
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
-- $msg_no is 1,3 --
size is %d
uid is %d
msgno is 1
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
size is %d
uid is %d
msgno is 3
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
-- $msg_no is 1, 2 --
Syntax error in sequence
-- $msg_no is 1:3 --
size is %d
uid is %d
msgno is 1
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
size is %d
uid is %d
msgno is 2
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
size is %d
uid is %d
msgno is 3
recent is %d
flagged is 0
answered is 0
deleted is 0
seen is 0
draft is 0
udate is OK
PK $�Z�:�Ċ � tests/bug75774.phptnu �[��� --TEST--
Bug #75774 imap_append HeapCorruction
--EXTENSIONS--
imap
--FILE--
<?php
$fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774";
$var1 = fopen($fn, "w");
try {
imap_append($var1, "", "", "", "");
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
fclose($var1);
unlink($fn);
?>
--EXPECT--
imap_append(): Argument #1 ($imap) must be of type IMAP\Connection, resource given
PK $�ZKP7r r tests/imap_body_errors.phptnu �[��� --TEST--
imap_body() errors: ValueError and Warnings
--CREDITS--
Paul Sohier
#phptestfest utrecht
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox("imapbodyerror", 0);
try {
imap_body($imap_mail_box, -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
imap_body($imap_mail_box, 1, -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
// Access not existing
var_dump(imap_body($imap_mail_box, 255));
var_dump(imap_body($imap_mail_box, 255, FT_UID));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapbodyerror';
require_once(__DIR__ . '/setup/clean.inc');
?>
--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
Warning: imap_body(): Bad message number in %s on line %d
bool(false)
Warning: imap_body(): UID does not exist in %s on line %d
bool(false)
PK $�Z~�:}k k tests/imap_body_uid.phptnu �[��� --TEST--
imap_body() passing a unique ID
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapbodyuid", $msg_no, $uid);
var_dump(imap_body($imap_mail_box, $uid, FT_UID) === imap_body($imap_mail_box, $msg_no));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapbodyuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
bool(true)
PK $�Z��4% % "