bug63126.phpt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. imap_open() DISABLE_AUTHENTICATOR ignores array param
  3. --EXTENSIONS--
  4. imap
  5. --SKIPIF--
  6. <?php
  7. require_once(__DIR__. '/setup/imap_include.inc');
  8. $in = @imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1);
  9. if (!$in) {
  10. die("skip could not connect to mailbox " . IMAP_SERVER_DEBUG);
  11. }
  12. $kerberos = false;
  13. if (is_array($errors = imap_errors())) {
  14. foreach ($errors as $err) {
  15. if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
  16. $kerberos = true;
  17. }
  18. }
  19. }
  20. if (!$kerberos) {
  21. die("skip need a GSSAPI/Kerberos aware server");
  22. }
  23. ?>
  24. --CONFLICTS--
  25. defaultmailbox
  26. --FILE--
  27. <?php
  28. // TODO Test Kerberos on CI
  29. $tests = array(
  30. 'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
  31. 'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
  32. );
  33. require_once(__DIR__. '/setup/imap_include.inc');
  34. foreach ($tests as $name => $testparams) {
  35. echo "Test for $name\n";
  36. $in = imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1, $testparams);
  37. if ($in) {
  38. if (is_array($errors = imap_errors())) {
  39. foreach ($errors as $err) {
  40. if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
  41. echo "$err\n";
  42. }
  43. }
  44. }
  45. } else {
  46. echo "Can't connect\n";
  47. }
  48. }
  49. echo "Done\n";
  50. ?>
  51. --EXPECT--
  52. Test for Array
  53. Test for String
  54. Done