pajoye Sat May 2 11:43:29 2009 UTC Modified files: /php-src/ext/imap/tests clean.inc imap_8bit_basic.phpt imap_append_basic.phpt imap_base64_basic.phpt imap_body_basic.phpt imap_clearflag_full_basic.phpt imap_close_basic.phpt imap_close_error.phpt imap_close_variation1.phpt imap_close_variation3.phpt imap_createmailbox_basic.phpt imap_errors_basic.phpt imap_fetch_overview_error.phpt imap_fetchbody_error.phpt imap_fetchbody_variation1.phpt imap_fetchheader_variation4.phpt skipif.inc Log: - NL cleanup (mixed or windows)
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/clean.inc?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/clean.inc diff -u php-src/ext/imap/tests/clean.inc:1.1 php-src/ext/imap/tests/clean.inc:1.2 --- php-src/ext/imap/tests/clean.inc:1.1 Fri Nov 28 17:39:13 2008 +++ php-src/ext/imap/tests/clean.inc Sat May 2 11:43:28 2009 @@ -1,25 +1,25 @@ -<?php -include_once(dirname(__FILE__) . '/imap_include.inc'); - -$imap_stream = imap_open($default_mailbox, $username, $password); - -// delete all msgs in default mailbox, i.e INBOX -$check = imap_check($imap_stream); -for ($i = 1; $i <= $check->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); +<?php +include_once(dirname(__FILE__) . '/imap_include.inc'); + +$imap_stream = imap_open($default_mailbox, $username, $password); + +// delete all msgs in default mailbox, i.e INBOX +$check = imap_check($imap_stream); +for ($i = 1; $i <= $check->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); ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_8bit_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_8bit_basic.phpt diff -u php-src/ext/imap/tests/imap_8bit_basic.phpt:1.1 php-src/ext/imap/tests/imap_8bit_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_8bit_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_8bit_basic.phpt Sat May 2 11:43:28 2009 @@ -1,33 +1,33 @@ ---TEST-- -Test imap_8bit() function : basic functionality ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : string imap_8bit ( string $string ) - * Description: Convert an 8bit string to a quoted-printable string. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_8bit() : basic functionality ***\n"; - -var_dump(imap_8bit("String with CRLF at end \r\n")); -//NB this appears to be a bug in cclient; a space at end of string should be encoded as =20 -var_dump(imap_8bit("String with space at end ")); -var_dump(imap_8bit("String with tabs \t\t in middle")); -var_dump(imap_8bit("String with tab at end \t")); -var_dump(imap_8bit("\x00\x01\x02\x03\x04\xfe\xff\x0a\x0d")); - -?> -===Done=== ---EXPECT-- -*** Testing imap_8bit() : basic functionality *** -string(28) "String with CRLF at end=20 -" -string(25) "String with space at end " -string(33) "String with tabs =09=09 in middle" -string(26) "String with tab at end =09" -string(27) "=00=01=02=03=04=FE=FF=0A=0D" -===Done=== +--TEST-- +Test imap_8bit() function : basic functionality +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); +?> +--FILE-- +<?php +/* Prototype : string imap_8bit ( string $string ) + * Description: Convert an 8bit string to a quoted-printable string. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_8bit() : basic functionality ***\n"; + +var_dump(imap_8bit("String with CRLF at end \r\n")); +//NB this appears to be a bug in cclient; a space at end of string should be encoded as =20 +var_dump(imap_8bit("String with space at end ")); +var_dump(imap_8bit("String with tabs \t\t in middle")); +var_dump(imap_8bit("String with tab at end \t")); +var_dump(imap_8bit("\x00\x01\x02\x03\x04\xfe\xff\x0a\x0d")); + +?> +===Done=== +--EXPECT-- +*** Testing imap_8bit() : basic functionality *** +string(28) "String with CRLF at end=20 +" +string(25) "String with space at end " +string(33) "String with tabs =09=09 in middle" +string(26) "String with tab at end =09" +string(27) "=00=01=02=03=04=FE=FF=0A=0D" +===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_append_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_append_basic.phpt diff -u php-src/ext/imap/tests/imap_append_basic.phpt:1.1 php-src/ext/imap/tests/imap_append_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_append_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_append_basic.phpt Sat May 2 11:43:29 2009 @@ -1,72 +1,72 @@ ---TEST-- -Test imap_append() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -<?php -/* Prototype : bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options ] ) - * Description: Append a string message to a specified mailbox. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_append() : basic functionality ***\n"; - -require_once(dirname(__FILE__).'/imap_include.inc'); - -echo "Create a new mailbox for test\n"; -$imap_stream = setup_test_mailbox("", 0); -if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); -} - -$mb_details = imap_mailboxmsginfo($imap_stream); -echo "Add a couple of msgs to new mailbox " . $mb_details->Mailbox . "\n"; -var_dump(imap_append($imap_stream, $mb_details->Mailbox - , "From: webmas...@something.com\r\n" - . "To: i...@something.com\r\n" - . "Subject: Test message\r\n" - . "\r\n" - . "this is a test message, please ignore\r\n" - )); - -var_dump(imap_append($imap_stream, $mb_details->Mailbox - , "From: webmas...@something.com\r\n" - . "To: i...@something.com\r\n" - . "Subject: Another test\r\n" - . "\r\n" - . "this is another test message, please ignore it too!!\r\n" - )); - -$check = imap_check($imap_stream); -echo "Msg Count after append : ". $check->Nmsgs . "\n"; - -echo "List the msg headers\n"; -var_dump(imap_headers($imap_stream)); - -imap_close($imap_stream); -?> -===Done=== ---CLEAN-- -<?php -require_once('clean.inc'); -?> ---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 -bool(true) -bool(true) -Msg Count after append : 2 -List the msg headers -array(2) { - [0]=> - string(%d) "%w%s 1)%s webmas...@something. Test message (%d chars)" - [1]=> - string(%d) "%w%s 2)%s webmas...@something. Another test (%d chars)" -} -===Done=== - +--TEST-- +Test imap_append() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- +<?php +/* Prototype : bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options ] ) + * Description: Append a string message to a specified mailbox. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_append() : basic functionality ***\n"; + +require_once(dirname(__FILE__).'/imap_include.inc'); + +echo "Create a new mailbox for test\n"; +$imap_stream = setup_test_mailbox("", 0); +if (!is_resource($imap_stream)) { + exit("TEST FAILED: Unable to create test mailbox\n"); +} + +$mb_details = imap_mailboxmsginfo($imap_stream); +echo "Add a couple of msgs to new mailbox " . $mb_details->Mailbox . "\n"; +var_dump(imap_append($imap_stream, $mb_details->Mailbox + , "From: webmas...@something.com\r\n" + . "To: i...@something.com\r\n" + . "Subject: Test message\r\n" + . "\r\n" + . "this is a test message, please ignore\r\n" + )); + +var_dump(imap_append($imap_stream, $mb_details->Mailbox + , "From: webmas...@something.com\r\n" + . "To: i...@something.com\r\n" + . "Subject: Another test\r\n" + . "\r\n" + . "this is another test message, please ignore it too!!\r\n" + )); + +$check = imap_check($imap_stream); +echo "Msg Count after append : ". $check->Nmsgs . "\n"; + +echo "List the msg headers\n"; +var_dump(imap_headers($imap_stream)); + +imap_close($imap_stream); +?> +===Done=== +--CLEAN-- +<?php +require_once('clean.inc'); +?> +--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 +bool(true) +bool(true) +Msg Count after append : 2 +List the msg headers +array(2) { + [0]=> + string(%d) "%w%s 1)%s webmas...@something. Test message (%d chars)" + [1]=> + string(%d) "%w%s 2)%s webmas...@something. Another test (%d chars)" +} +===Done=== + http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_base64_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_base64_basic.phpt diff -u php-src/ext/imap/tests/imap_base64_basic.phpt:1.1 php-src/ext/imap/tests/imap_base64_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_base64_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_base64_basic.phpt Sat May 2 11:43:29 2009 @@ -1,47 +1,47 @@ ---TEST-- -Test imap_base64() function : basic functionality ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); -?> ---FILE-- -<?php -/* Prototype : string imap_base64 ( string $text ) - * Description: Decode BASE64 encoded text. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_base64() : basic functionality ***\n"; - -$str = b'This is an example string to be base 64 encoded'; -$base64 = base64_encode($str); -if (imap_base64($base64) == $str) { - echo "TEST PASSED\n"; -} else { - echo "TEST FAILED"; -} - +--TEST-- +Test imap_base64() function : basic functionality +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); +?> +--FILE-- +<?php +/* Prototype : string imap_base64 ( string $text ) + * Description: Decode BASE64 encoded text. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_base64() : basic functionality ***\n"; + +$str = b'This is an example string to be base 64 encoded'; +$base64 = base64_encode($str); +if (imap_base64($base64) == $str) { + echo "TEST PASSED\n"; +} else { + echo "TEST FAILED"; +} + $str = b'!£$%^&*()_+-={][];;@~#?/>.<,'; -$base64 = base64_encode($str); -if (imap_base64($base64) == $str) { - echo "TEST PASSED\n"; -} else { - echo "TEST FAILED"; -} - -$hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF'; -$base64 = base64_encode($hex); -if (imap_base64($base64) == $hex) { - echo "TEST PASSED\n"; -} else { - echo "TEST FAILED"; -} - -?> -===Done=== ---EXPECT-- -*** Testing imap_base64() : basic functionality *** -TEST PASSED -TEST PASSED -TEST PASSED +$base64 = base64_encode($str); +if (imap_base64($base64) == $str) { + echo "TEST PASSED\n"; +} else { + echo "TEST FAILED"; +} + +$hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF'; +$base64 = base64_encode($hex); +if (imap_base64($base64) == $hex) { + echo "TEST PASSED\n"; +} else { + echo "TEST FAILED"; +} + +?> +===Done=== +--EXPECT-- +*** Testing imap_base64() : basic functionality *** +TEST PASSED +TEST PASSED +TEST PASSED ===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_body_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_body_basic.phpt diff -u php-src/ext/imap/tests/imap_body_basic.phpt:1.1 php-src/ext/imap/tests/imap_body_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_body_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_body_basic.phpt Sat May 2 11:43:29 2009 @@ -1,44 +1,44 @@ ---TEST-- -Test imap_body() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -<?php -/* Prototype : string imap_body ( resource $imap_stream , int $msg_number [, int $options ] ) - * Description: Read the message body. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_body() : basic functionality ***\n"; - -require_once(dirname(__FILE__).'/imap_include.inc'); - -echo "Create a new mailbox for test\n"; -$imap_stream = setup_test_mailbox("", 1); -if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); -} - -$check = imap_check($imap_stream); -echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n"; - -// show body for msg 1 -var_dump(imap_body($imap_stream, 1)); - -imap_close($imap_stream); -?> -===Done=== ---CLEAN-- -<?php -require_once('clean.inc'); -?> ---EXPECTF-- -*** Testing imap_body() : basic functionality *** -Create a new mailbox for test -Create a temporary mailbox and add 1 msgs -.. mailbox '%s' created -Msg Count in new mailbox: 1 -string(%d) "1: this is a test message, please ignore%a" +--TEST-- +Test imap_body() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- +<?php +/* Prototype : string imap_body ( resource $imap_stream , int $msg_number [, int $options ] ) + * Description: Read the message body. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_body() : basic functionality ***\n"; + +require_once(dirname(__FILE__).'/imap_include.inc'); + +echo "Create a new mailbox for test\n"; +$imap_stream = setup_test_mailbox("", 1); +if (!is_resource($imap_stream)) { + exit("TEST FAILED: Unable to create test mailbox\n"); +} + +$check = imap_check($imap_stream); +echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n"; + +// show body for msg 1 +var_dump(imap_body($imap_stream, 1)); + +imap_close($imap_stream); +?> +===Done=== +--CLEAN-- +<?php +require_once('clean.inc'); +?> +--EXPECTF-- +*** Testing imap_body() : basic functionality *** +Create a new mailbox for test +Create a temporary mailbox and add 1 msgs +.. mailbox '%s' created +Msg Count in new mailbox: 1 +string(%d) "1: this is a test message, please ignore%a" ===Done=== \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_clearflag_full_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_clearflag_full_basic.phpt diff -u php-src/ext/imap/tests/imap_clearflag_full_basic.phpt:1.1 php-src/ext/imap/tests/imap_clearflag_full_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_clearflag_full_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_clearflag_full_basic.phpt Sat May 2 11:43:29 2009 @@ -1,127 +1,127 @@ ---TEST-- -Test imap_clearflag_full() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -<?php -/* Prototype : bool imap_clearflag_full ( resource $imap_stream , string $sequence , string $flag [, string $options ] ) - * Description: Clears flags on messages. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_clearflag_full() : basic functionality ***\n"; - -require_once(dirname(__FILE__).'/imap_include.inc'); - -echo "Create a new mailbox for test\n"; -$imap_stream = setup_test_mailbox("", 10); -if (!is_resource($imap_stream)) { - exit("TEST FAILED: Unable to create test mailbox\n"); -} - -$check = imap_check($imap_stream); -echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n"; - -echo "Set some flags\n"; -var_dump(imap_setflag_full($imap_stream, "1,3", "\\Seen \\Answered")); -var_dump(imap_setflag_full($imap_stream, "2,4", "\\Answered")); -var_dump(imap_setflag_full($imap_stream, "5,7", "\\Flagged \\Deleted")); -var_dump(imap_setflag_full($imap_stream, "6,8", "\\Deleted")); -var_dump(imap_setflag_full($imap_stream, "9,10", "\\Draft \\Flagged")); - -var_dump(imap_search($imap_stream, "SEEN")); -var_dump(imap_search($imap_stream, "ANSWERED")); -var_dump(imap_search($imap_stream, "FLAGGED")); -var_dump(imap_search($imap_stream, "DELETED")); - -var_dump(imap_clearflag_full($imap_stream, "1,4", "\\Answered")); -var_dump(imap_clearflag_full($imap_stream, "5,6,7,8", "\\Deleted")); -var_dump(imap_clearflag_full($imap_stream, "9", "\\Flagged")); - -var_dump(imap_search($imap_stream, "SEEN")); -var_dump(imap_search($imap_stream, "ANSWERED")); -var_dump(imap_search($imap_stream, "FLAGGED")); -var_dump(imap_search($imap_stream, "DELETED")); - -imap_close($imap_stream); -?> -===Done=== ---CLEAN-- -<?php -require_once('clean.inc'); -?> ---EXPECTF-- -*** Testing imap_clearflag_full() : basic functionality *** -Create a new mailbox for test -Create a temporary mailbox and add 10 msgs -.. mailbox '{localhost/norsh}INBOX.%s' created -Initial msg count in new_mailbox : 10 -Set some flags -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -array(2) { - [0]=> - int(1) - [1]=> - int(3) -} -array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) -} -array(4) { - [0]=> - int(5) - [1]=> - int(7) - [2]=> - int(9) - [3]=> - int(10) -} -array(4) { - [0]=> - int(5) - [1]=> - int(6) - [2]=> - int(7) - [3]=> - int(8) -} -bool(true) -bool(true) -bool(true) -array(2) { - [0]=> - int(1) - [1]=> - int(3) -} -array(2) { - [0]=> - int(2) - [1]=> - int(3) -} -array(3) { - [0]=> - int(5) - [1]=> - int(7) - [2]=> - int(10) -} -bool(false) -===Done=== +--TEST-- +Test imap_clearflag_full() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- +<?php +/* Prototype : bool imap_clearflag_full ( resource $imap_stream , string $sequence , string $flag [, string $options ] ) + * Description: Clears flags on messages. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_clearflag_full() : basic functionality ***\n"; + +require_once(dirname(__FILE__).'/imap_include.inc'); + +echo "Create a new mailbox for test\n"; +$imap_stream = setup_test_mailbox("", 10); +if (!is_resource($imap_stream)) { + exit("TEST FAILED: Unable to create test mailbox\n"); +} + +$check = imap_check($imap_stream); +echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n"; + +echo "Set some flags\n"; +var_dump(imap_setflag_full($imap_stream, "1,3", "\\Seen \\Answered")); +var_dump(imap_setflag_full($imap_stream, "2,4", "\\Answered")); +var_dump(imap_setflag_full($imap_stream, "5,7", "\\Flagged \\Deleted")); +var_dump(imap_setflag_full($imap_stream, "6,8", "\\Deleted")); +var_dump(imap_setflag_full($imap_stream, "9,10", "\\Draft \\Flagged")); + +var_dump(imap_search($imap_stream, "SEEN")); +var_dump(imap_search($imap_stream, "ANSWERED")); +var_dump(imap_search($imap_stream, "FLAGGED")); +var_dump(imap_search($imap_stream, "DELETED")); + +var_dump(imap_clearflag_full($imap_stream, "1,4", "\\Answered")); +var_dump(imap_clearflag_full($imap_stream, "5,6,7,8", "\\Deleted")); +var_dump(imap_clearflag_full($imap_stream, "9", "\\Flagged")); + +var_dump(imap_search($imap_stream, "SEEN")); +var_dump(imap_search($imap_stream, "ANSWERED")); +var_dump(imap_search($imap_stream, "FLAGGED")); +var_dump(imap_search($imap_stream, "DELETED")); + +imap_close($imap_stream); +?> +===Done=== +--CLEAN-- +<?php +require_once('clean.inc'); +?> +--EXPECTF-- +*** Testing imap_clearflag_full() : basic functionality *** +Create a new mailbox for test +Create a temporary mailbox and add 10 msgs +.. mailbox '{localhost/norsh}INBOX.%s' created +Initial msg count in new_mailbox : 10 +Set some flags +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + int(3) +} +array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) +} +array(4) { + [0]=> + int(5) + [1]=> + int(7) + [2]=> + int(9) + [3]=> + int(10) +} +array(4) { + [0]=> + int(5) + [1]=> + int(6) + [2]=> + int(7) + [3]=> + int(8) +} +bool(true) +bool(true) +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + int(3) +} +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} +array(3) { + [0]=> + int(5) + [1]=> + int(7) + [2]=> + int(10) +} +bool(false) +===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_close_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_close_basic.phpt diff -u php-src/ext/imap/tests/imap_close_basic.phpt:1.1 php-src/ext/imap/tests/imap_close_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_close_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_close_basic.phpt Sat May 2 11:43:29 2009 @@ -1,8 +1,8 @@ --TEST-- -Test imap_close() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); +Test imap_close() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- <?php @@ -13,44 +13,44 @@ echo "*** Testing imap_close() : basic functionality ***\n"; -// include file for required variables in imap_open() -require_once(dirname(__FILE__).'/imap_include.inc'); - +// include file for required variables in imap_open() +require_once(dirname(__FILE__).'/imap_include.inc'); + // Initialize required variables -$stream_id = setup_test_mailbox('', 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); -} +$stream_id = setup_test_mailbox('', 3, $mailbox); // set up temp mailbox with 3 messages +$options = CL_EXPUNGE; -// Calling imap_close() with all possible arguments +// 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, $username, $password); -echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n"; +var_dump( imap_close($stream_id, $options) ); + +// check that CL_EXPUNGE worked +$stream_id = imap_open($mailbox, $username, $password); +echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n"; -// Calling imap_close() with mandatory arguments +// Calling imap_close() with mandatory arguments 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=== +===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=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_close_error.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_close_error.phpt diff -u php-src/ext/imap/tests/imap_close_error.phpt:1.1 php-src/ext/imap/tests/imap_close_error.phpt:1.2 --- php-src/ext/imap/tests/imap_close_error.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_close_error.phpt Sat May 2 11:43:29 2009 @@ -1,8 +1,8 @@ --TEST-- -Test imap_close() function : error conditions - incorrect number of args ---SKIPIF-- -<?php -require_once (dirname(__FILE__).'/skipif.inc'); +Test imap_close() function : error conditions - incorrect number of args +--SKIPIF-- +<?php +require_once (dirname(__FILE__).'/skipif.inc'); ?> --FILE-- <?php @@ -16,7 +16,7 @@ */ echo "*** Testing imap_close() : error conditions ***\n"; -require_once(dirname(__FILE__).'/imap_include.inc'); +require_once(dirname(__FILE__).'/imap_include.inc'); // Zero arguments echo "\n-- Testing imap_close() function with Zero arguments --\n"; @@ -28,18 +28,18 @@ $options = CL_EXPUNGE; $extra_arg = 10; var_dump( imap_close($stream_id, $options, $extra_arg) ); -?> +?> ===DONE=== --EXPECTF-- -*** Testing imap_close() : error conditions *** - --- Testing imap_close() function with Zero arguments -- - -Warning: imap_close() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing imap_close() function with more than expected no. of arguments -- - -Warning: imap_close() expects at most 2 parameters, 3 given in %s on line %d -NULL +*** Testing imap_close() : error conditions *** + +-- Testing imap_close() function with Zero arguments -- + +Warning: imap_close() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing imap_close() function with more than expected no. of arguments -- + +Warning: imap_close() expects at most 2 parameters, 3 given in %s on line %d +NULL ===DONE=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_close_variation1.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_close_variation1.phpt diff -u php-src/ext/imap/tests/imap_close_variation1.phpt:1.1 php-src/ext/imap/tests/imap_close_variation1.phpt:1.2 --- php-src/ext/imap/tests/imap_close_variation1.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_close_variation1.phpt Sat May 2 11:43:29 2009 @@ -1,8 +1,8 @@ --TEST-- -Test imap_close() function : usage variations - different data types as $stream_id arg ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); +Test imap_close() function : usage variations - different data types as $stream_id arg +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); ?> --FILE-- <?php @@ -17,77 +17,77 @@ echo "*** Testing imap_close() : usage variations ***\n"; -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<<EOT -hello world -EOT; - -// unexpected values to be passed to $stream_id argument -$inputs = array( - - // int data -/*1*/ 0, - 1, - 12345, - -2345, - - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - - // null data -/*10*/ NULL, - null, - - // boolean data -/*12*/ true, - false, - TRUE, - FALSE, - - // empty data -/*16*/ "", - '', - array(), - - // string data -/*19*/ "string", - 'string', - $heredoc, - - // object data -/*22*/ new classA(), - - // undefined data -/*23*/ @$undefined_var, - - // unset data -/*24*/ @$unset_var, -); - -// loop through each element of $inputs to check the behavior of imap_close() -$iterator = 1; -foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( imap_close($input) ); - $iterator++; +//get an unset variable +$unset_var = 10; +unset ($unset_var); + +// get a class +class classA +{ + public function __toString() { + return "Class A object"; + } +} + +// heredoc string +$heredoc = <<<EOT +hello world +EOT; + +// unexpected values to be passed to $stream_id argument +$inputs = array( + + // int data +/*1*/ 0, + 1, + 12345, + -2345, + + // float data +/*5*/ 10.5, + -10.5, + 12.3456789000e10, + 12.3456789000E-10, + .5, + + // null data +/*10*/ NULL, + null, + + // boolean data +/*12*/ true, + false, + TRUE, + FALSE, + + // empty data +/*16*/ "", + '', + array(), + + // string data +/*19*/ "string", + 'string', + $heredoc, + + // object data +/*22*/ new classA(), + + // undefined data +/*23*/ @$undefined_var, + + // unset data +/*24*/ @$unset_var, +); + +// loop through each element of $inputs to check the behavior of imap_close() +$iterator = 1; +foreach($inputs as $input) { + echo "\n-- Iteration $iterator --\n"; + var_dump( imap_close($input) ); + $iterator++; }; -?> +?> ===DONE=== --EXPECTF-- *** Testing imap_close() : usage variations *** http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_close_variation3.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_close_variation3.phpt diff -u php-src/ext/imap/tests/imap_close_variation3.phpt:1.1 php-src/ext/imap/tests/imap_close_variation3.phpt:1.2 --- php-src/ext/imap/tests/imap_close_variation3.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_close_variation3.phpt Sat May 2 11:43:29 2009 @@ -1,8 +1,8 @@ --TEST-- -Test imap_close() function : usage variations - different streams ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); +Test imap_close() function : usage variations - different streams +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); ?> --FILE-- <?php @@ -16,32 +16,32 @@ */ echo "*** Testing imap_close() : usage variations ***\n"; - + echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_handle = fopen(__FILE__, 'r')); -var_dump(imap_close($file_handle)); -var_dump($file_handle); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(dirname(__FILE__))); -var_dump(imap_close($dir_handle)); +var_dump($file_handle = fopen(__FILE__, 'r')); +var_dump(imap_close($file_handle)); +var_dump($file_handle); + +echo "\n-- Directory Resource opened with opendir() --\n"; +var_dump($dir_handle = opendir(dirname(__FILE__))); +var_dump(imap_close($dir_handle)); var_dump($dir_handle); -?> +?> ===DONE=== --EXPECTF-- -*** Testing imap_close() : usage variations *** - --- File Resource opened with fopen() -- -resource(%d) of type (stream) - -Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -resource(%d) of type (stream) - --- Directory Resource opened with opendir() -- -resource(%d) of type (stream) - -Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d -bool(false) -resource(%d) of type (stream) +*** Testing imap_close() : usage variations *** + +-- File Resource opened with fopen() -- +resource(%d) of type (stream) + +Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d +bool(false) +resource(%d) of type (stream) + +-- Directory Resource opened with opendir() -- +resource(%d) of type (stream) + +Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d +bool(false) +resource(%d) of type (stream) ===DONE=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_createmailbox_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_createmailbox_basic.phpt diff -u php-src/ext/imap/tests/imap_createmailbox_basic.phpt:1.1 php-src/ext/imap/tests/imap_createmailbox_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_createmailbox_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_createmailbox_basic.phpt Sat May 2 11:43:29 2009 @@ -1,69 +1,69 @@ ---TEST-- -Test imap_createmailbox() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -<?php -/* Prototype : bool imap_createmailbox ( resource $imap_stream , string $mailbox ) - * Description: Creates a new mailbox specified by mailbox . - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_createmailbox() : basic functionality ***\n"; - -require_once(dirname(__FILE__).'/imap_include.inc'); - -$imap_stream = imap_open($default_mailbox, $username, $password) or - die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); - -$newname = "phpnewbox"; - -echo "Newname will be '$newname'\n"; - -$newbox = imap_utf7_encode($server.$newname); -if (imap_createmailbox($imap_stream, $newbox)) { - - echo "Add a couple of msgs to '$newname' mailbox\n"; - populate_mailbox($imap_stream, $newbox, 2); - - $status = imap_status($imap_stream, $newbox, SA_ALL); - if ($status) { - echo "Your new mailbox '$newname' has the following status:\n"; - echo "Messages: " . $status->messages . "\n"; - echo "Recent: " . $status->recent . "\n"; - echo "Unseen: " . $status->unseen . "\n"; - echo "UIDnext: " . $status->uidnext . "\n"; - echo "UIDvalidity: " . $status->uidvalidity . "\n"; - - } else { - echo "imap_status on new mailbox failed: " . imap_last_error() . "\n"; - } - - if (imap_deletemailbox($imap_stream, $newbox)) { - echo "Mailbox '$newname' removed to restore initial state\n"; - } else { - echo "imap_deletemailbox on new mailbox failed: " . implode("\n", imap_errors()) . "\n"; - } - -} else { - echo "could not create new mailbox: " . implode("\n", imap_errors()) . "\n"; -} - -imap_close($imap_stream); - -?> -===Done=== ---EXPECTF-- -*** Testing imap_createmailbox() : basic functionality *** -Newname will be 'phpnewbox' -Add a couple of msgs to 'phpnewbox' mailbox -Your new mailbox 'phpnewbox' has the following status: -Messages: 2 -Recent: 2 -Unseen: 2 -UIDnext: %d -UIDvalidity: %d -Mailbox 'phpnewbox' removed to restore initial state +--TEST-- +Test imap_createmailbox() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- +<?php +/* Prototype : bool imap_createmailbox ( resource $imap_stream , string $mailbox ) + * Description: Creates a new mailbox specified by mailbox . + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_createmailbox() : basic functionality ***\n"; + +require_once(dirname(__FILE__).'/imap_include.inc'); + +$imap_stream = imap_open($default_mailbox, $username, $password) or + die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); + +$newname = "phpnewbox"; + +echo "Newname will be '$newname'\n"; + +$newbox = imap_utf7_encode($server.$newname); +if (imap_createmailbox($imap_stream, $newbox)) { + + echo "Add a couple of msgs to '$newname' mailbox\n"; + populate_mailbox($imap_stream, $newbox, 2); + + $status = imap_status($imap_stream, $newbox, SA_ALL); + if ($status) { + echo "Your new mailbox '$newname' has the following status:\n"; + echo "Messages: " . $status->messages . "\n"; + echo "Recent: " . $status->recent . "\n"; + echo "Unseen: " . $status->unseen . "\n"; + echo "UIDnext: " . $status->uidnext . "\n"; + echo "UIDvalidity: " . $status->uidvalidity . "\n"; + + } else { + echo "imap_status on new mailbox failed: " . imap_last_error() . "\n"; + } + + if (imap_deletemailbox($imap_stream, $newbox)) { + echo "Mailbox '$newname' removed to restore initial state\n"; + } else { + echo "imap_deletemailbox on new mailbox failed: " . implode("\n", imap_errors()) . "\n"; + } + +} else { + echo "could not create new mailbox: " . implode("\n", imap_errors()) . "\n"; +} + +imap_close($imap_stream); + +?> +===Done=== +--EXPECTF-- +*** Testing imap_createmailbox() : basic functionality *** +Newname will be 'phpnewbox' +Add a couple of msgs to 'phpnewbox' mailbox +Your new mailbox 'phpnewbox' has the following status: +Messages: 2 +Recent: 2 +Unseen: 2 +UIDnext: %d +UIDvalidity: %d +Mailbox 'phpnewbox' removed to restore initial state ===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_errors_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_errors_basic.phpt diff -u php-src/ext/imap/tests/imap_errors_basic.phpt:1.1 php-src/ext/imap/tests/imap_errors_basic.phpt:1.2 --- php-src/ext/imap/tests/imap_errors_basic.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_errors_basic.phpt Sat May 2 11:43:29 2009 @@ -1,55 +1,55 @@ ---TEST-- -Test imap_errors() function : basic functionality ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -<?php -/* Prototype : array imap_errors ( void ) - * Description: Returns all of the IMAP errors that have occured. - * Source code: ext/imap/php_imap.c - */ - -echo "*** Testing imap_errors() : basic functionality ***\n"; -require_once(dirname(__FILE__).'/imap_include.inc'); -$password = "bogus"; // invalid password to use in this test - -echo "Issue open with invalid password with normal default number of retries, i.e 3\n"; -$mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 3); - -echo "List any errors\n"; -var_dump(imap_errors()); - -echo "\n\nIssue open with invalid password with retries == 1\n"; -$mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 1); - -echo "List any errors\n"; -var_dump(imap_errors()); -?> -===Done=== ---EXPECTF-- -*** Testing imap_errors() : basic functionality *** -Issue open with invalid password with normal default number of retries, i.e 3 - -Warning: imap_open(): Couldn't open stream %s in %s on line %d -List any errors -array(%d) { - [0]=> - string(%d) "%s" - [1]=> - string(%d) "%s" - [2]=> +--TEST-- +Test imap_errors() function : basic functionality +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- +<?php +/* Prototype : array imap_errors ( void ) + * Description: Returns all of the IMAP errors that have occured. + * Source code: ext/imap/php_imap.c + */ + +echo "*** Testing imap_errors() : basic functionality ***\n"; +require_once(dirname(__FILE__).'/imap_include.inc'); +$password = "bogus"; // invalid password to use in this test + +echo "Issue open with invalid password with normal default number of retries, i.e 3\n"; +$mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 3); + +echo "List any errors\n"; +var_dump(imap_errors()); + +echo "\n\nIssue open with invalid password with retries == 1\n"; +$mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 1); + +echo "List any errors\n"; +var_dump(imap_errors()); +?> +===Done=== +--EXPECTF-- +*** Testing imap_errors() : basic functionality *** +Issue open with invalid password with normal default number of retries, i.e 3 + +Warning: imap_open(): Couldn't open stream %s in %s on line %d +List any errors +array(%d) { + [0]=> + string(%d) "%s" + [1]=> + string(%d) "%s" + [2]=> string(%d) "%a -} - - -Issue open with invalid password with retries == 1 - -Warning: imap_open(): Couldn't open stream %s in %s on line %d -List any errors -array(%d) { - [0]=> +} + + +Issue open with invalid password with retries == 1 + +Warning: imap_open(): Couldn't open stream %s in %s on line %d +List any errors +array(%d) { + [0]=> string(%d) "%a -} -===Done=== +} +===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_fetch_overview_error.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_fetch_overview_error.phpt diff -u php-src/ext/imap/tests/imap_fetch_overview_error.phpt:1.1 php-src/ext/imap/tests/imap_fetch_overview_error.phpt:1.2 --- php-src/ext/imap/tests/imap_fetch_overview_error.phpt:1.1 Mon Dec 8 19:10:45 2008 +++ php-src/ext/imap/tests/imap_fetch_overview_error.phpt Sat May 2 11:43:29 2009 @@ -1,13 +1,13 @@ --TEST-- -Test imap_fetch_overview() function : error conditions - incorrect number of args ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); +Test imap_fetch_overview() function : error conditions - incorrect number of args +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- <?php /* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options]) - * Description: Read an overview of the information in the headers + * Description: Read an overview of the information in the headers * of the given message sequence * Source code: ext/imap/php_imap.c */ @@ -17,7 +17,7 @@ */ echo "*** Testing imap_fetch_overview() : error conditions ***\n"; - + require_once(dirname(__FILE__).'/imap_include.inc'); //Test imap_fetch_overview with one more than the expected number of arguments @@ -31,11 +31,11 @@ // Testing imap_fetch_overview with one less than the expected number of arguments echo "\n-- Testing imap_fetch_overview() function with less than expected no. of arguments --\n"; var_dump( imap_fetch_overview($stream_id) ); -?> -===DONE=== ---CLEAN-- -<?php -require_once(dirname(__FILE__).'/clean.inc'); +?> +===DONE=== +--CLEAN-- +<?php +require_once(dirname(__FILE__).'/clean.inc'); ?> --EXPECTF-- *** Testing imap_fetch_overview() : error conditions *** http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_fetchbody_error.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_fetchbody_error.phpt diff -u php-src/ext/imap/tests/imap_fetchbody_error.phpt:1.1 php-src/ext/imap/tests/imap_fetchbody_error.phpt:1.2 --- php-src/ext/imap/tests/imap_fetchbody_error.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_fetchbody_error.phpt Sat May 2 11:43:29 2009 @@ -1,12 +1,12 @@ --TEST-- -Test imap_fetchbody() function : error conditions - incorrect number of args ---SKIPIF-- -<?php -require_once(dirname(__FILE__).'/skipif.inc'); +Test imap_fetchbody() function : error conditions - incorrect number of args +--SKIPIF-- +<?php +require_once(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- <?php -/* Prototype :string imap_fetchbody(resource $stream_id, int $msg_no, string $section +/* Prototype :string imap_fetchbody(resource $stream_id, int $msg_no, string $section * [, int $options]) * Description: Get a specific body section * Source code: ext/imap/php_imap.c @@ -20,25 +20,25 @@ require_once(dirname(__FILE__).'/imap_include.inc'); //Test imap_fetchbody with one more than the expected number of arguments -echo "\n-- Testing imap_fetchbody() function with more than expected no. of arguments --\n"; +echo "\n-- Testing imap_fetchbody() function with more than expected no. of arguments --\n"; $stream_id = setup_test_mailbox('', 1); // set up temp mailbox with 1 simple msg $msg_no = 1; $section = '1'; $options = FT_PEEK; -$extra_arg = 10; +$extra_arg = 10; var_dump( imap_fetchbody($stream_id, $msg_no, $section, $options, $extra_arg) ); // Testing imap_fetchbody with one less than the expected number of arguments -echo "\n-- Testing imap_fetchbody() function with less than expected no. of arguments --\n"; +echo "\n-- Testing imap_fetchbody() function with less than expected no. of arguments --\n"; var_dump( imap_fetchbody($stream_id, $msg_no) ); -?> -===DONE=== ---CLEAN-- -<?php -require_once(dirname(__FILE__).'/clean.inc'); +?> +===DONE=== +--CLEAN-- +<?php +require_once(dirname(__FILE__).'/clean.inc'); ?> --EXPECTF-- *** Testing imap_fetchbody() : error conditions *** http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_fetchbody_variation1.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_fetchbody_variation1.phpt diff -u php-src/ext/imap/tests/imap_fetchbody_variation1.phpt:1.1 php-src/ext/imap/tests/imap_fetchbody_variation1.phpt:1.2 --- php-src/ext/imap/tests/imap_fetchbody_variation1.phpt:1.1 Wed Dec 17 15:05:38 2008 +++ php-src/ext/imap/tests/imap_fetchbody_variation1.phpt Sat May 2 11:43:29 2009 @@ -1,12 +1,12 @@ --TEST-- -Test imap_fetchbody() function : usage variation - diff data types as $stream_id arg ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); +Test imap_fetchbody() function : usage variation - diff data types as $stream_id arg +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); ?> --FILE-- <?php -/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section +/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section * [, int $options]) * Description: Get a specific body section * Source code: ext/imap/php_imap.c @@ -18,81 +18,81 @@ echo "*** Testing imap_fetchbody() : usage variations ***\n"; -// Initialise function arguments not being substituted -$msg_no = 1; -$section = '2'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<<EOT -hello world -EOT; - -// unexpected values to be passed to $stream_id argument -$inputs = array( - - // int data -/*1*/ 0, - 1, - 12345, - -2345, - - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - - // null data -/*10*/ NULL, - null, - - // boolean data -/*12*/ true, - false, - TRUE, - FALSE, - - // empty data -/*16*/ "", - '', - array(), - - // string data -/*19*/ "string", - 'string', - $heredoc, - - // object data -/*22*/ new classA(), - - // undefined data -/*23*/ @$undefined_var, - - // unset data -/*24*/ @$unset_var, -); - -// loop through each element of $inputs to check the behavior of imap_fetchbody() -$iterator = 1; -foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( imap_fetchbody($input, $msg_no, $section) ); - $iterator++; +// Initialise function arguments not being substituted +$msg_no = 1; +$section = '2'; + +//get an unset variable +$unset_var = 10; +unset ($unset_var); + +// get a class +class classA +{ + public function __toString() { + return "Class A object"; + } +} + +// heredoc string +$heredoc = <<<EOT +hello world +EOT; + +// unexpected values to be passed to $stream_id argument +$inputs = array( + + // int data +/*1*/ 0, + 1, + 12345, + -2345, + + // float data +/*5*/ 10.5, + -10.5, + 12.3456789000e10, + 12.3456789000E-10, + .5, + + // null data +/*10*/ NULL, + null, + + // boolean data +/*12*/ true, + false, + TRUE, + FALSE, + + // empty data +/*16*/ "", + '', + array(), + + // string data +/*19*/ "string", + 'string', + $heredoc, + + // object data +/*22*/ new classA(), + + // undefined data +/*23*/ @$undefined_var, + + // unset data +/*24*/ @$unset_var, +); + +// loop through each element of $inputs to check the behavior of imap_fetchbody() +$iterator = 1; +foreach($inputs as $input) { + echo "\n-- Iteration $iterator --\n"; + var_dump( imap_fetchbody($input, $msg_no, $section) ); + $iterator++; } -?> +?> ===DONE=== --EXPECTF-- *** Testing imap_fetchbody() : usage variations *** http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_fetchheader_variation4.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/imap/tests/imap_fetchheader_variation4.phpt diff -u php-src/ext/imap/tests/imap_fetchheader_variation4.phpt:1.1 php-src/ext/imap/tests/imap_fetchheader_variation4.phpt:1.2 --- php-src/ext/imap/tests/imap_fetchheader_variation4.phpt:1.1 Fri Jan 23 15:29:22 2009 +++ php-src/ext/imap/tests/imap_fetchheader_variation4.phpt Sat May 2 11:43:29 2009 @@ -1,8 +1,8 @@ --TEST-- -Test imap_fetchheader() function : usage variations - diff resource types as $stream_id ---SKIPIF-- -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); +Test imap_fetchheader() function : usage variations - diff resource types as $stream_id +--SKIPIF-- +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); ?> --FILE-- <?php @@ -17,29 +17,29 @@ echo "*** Testing imap_fetchheader() : usage variations ***\n"; -echo "\n-- File Resource opened with fopen() --\n"; -var_dump($file_pointer = fopen(__FILE__, 'r+')); -var_dump(imap_fetchheader($file_pointer, 1)); -fclose($file_pointer); - -echo "\n-- Directory Resource opened with opendir() --\n"; -var_dump($dir_handle = opendir(dirname(__FILE__))); -var_dump(imap_fetchheader($dir_handle, 1)); +echo "\n-- File Resource opened with fopen() --\n"; +var_dump($file_pointer = fopen(__FILE__, 'r+')); +var_dump(imap_fetchheader($file_pointer, 1)); +fclose($file_pointer); + +echo "\n-- Directory Resource opened with opendir() --\n"; +var_dump($dir_handle = opendir(dirname(__FILE__))); +var_dump(imap_fetchheader($dir_handle, 1)); closedir($dir_handle); -?> +?> ===DONE=== --EXPECTF-- -*** Testing imap_fetchheader() : usage variations *** - --- File Resource opened with fopen() -- -resource(%d) of type (stream) - -Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d -bool(false) - --- Directory Resource opened with opendir() -- -resource(%d) of type (stream) - -Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d -bool(false) +*** Testing imap_fetchheader() : usage variations *** + +-- File Resource opened with fopen() -- +resource(%d) of type (stream) + +Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d +bool(false) + +-- Directory Resource opened with opendir() -- +resource(%d) of type (stream) + +Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d +bool(false) ===DONE=== \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/skipif.inc?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/imap/tests/skipif.inc diff -u php-src/ext/imap/tests/skipif.inc:1.3 php-src/ext/imap/tests/skipif.inc:1.4 --- php-src/ext/imap/tests/skipif.inc:1.3 Sun Feb 15 16:00:48 2009 +++ php-src/ext/imap/tests/skipif.inc Sat May 2 11:43:29 2009 @@ -1,16 +1,16 @@ -<?php -extension_loaded('imap') or die('skip imap extension not available in this build'); - -// Change these to make tests run successfully -$mailbox = '{localhost/norsh}'; -$username = 'webmas...@something.com'; -$password = 'p4ssw0rd'; -$options = OP_HALFOPEN; // this should be enough to verify server present -$retries = 0; // dont retry connect on failure - -$mbox = @imap_open($mailbox, $username, $password, $options, $retries); -if (!$mbox) { - die("skip could not connect to mailbox $mailbox"); -} -imap_close($mbox); -?> +<?php +extension_loaded('imap') or die('skip imap extension not available in this build'); + +// Change these to make tests run successfully +$mailbox = '{localhost/norsh}'; +$username = 'webmas...@something.com'; +$password = 'p4ssw0rd'; +$options = OP_HALFOPEN; // this should be enough to verify server present +$retries = 0; // dont retry connect on failure + +$mbox = @imap_open($mailbox, $username, $password, $options, $retries); +if (!$mbox) { + die("skip could not connect to mailbox $mailbox"); +} +imap_close($mbox); +?>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php