bug63126.phpt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. imap_open() DISABLE_AUTHENTICATOR ignores array param
  3. --SKIPIF--
  4. <?php
  5. extension_loaded('imap') or die('skip imap extension not available in this build');
  6. require_once(dirname(__FILE__).'/imap_include.inc');
  7. $in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1);
  8. if (!$in) {
  9. die("skip could not connect to mailbox $default_mailbox");
  10. }
  11. $kerberos = false;
  12. if (is_array($errors = imap_errors())) {
  13. foreach ($errors as $err) {
  14. if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
  15. $kerberos = true;
  16. }
  17. }
  18. }
  19. if (!$kerberos) {
  20. die("skip need a GSSAPI/Kerberos aware server");
  21. }
  22. ?>
  23. --FILE--
  24. <?php
  25. $tests = array(
  26. 'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
  27. 'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
  28. );
  29. require_once(dirname(__FILE__).'/imap_include.inc');
  30. foreach ($tests as $name => $testparams) {
  31. echo "Test for $name\n";
  32. $in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1, $testparams);
  33. if ($in) {
  34. if (is_array($errors = imap_errors())) {
  35. foreach ($errors as $err) {
  36. if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
  37. echo "$err\n";
  38. }
  39. }
  40. }
  41. } else {
  42. echo "Can't connect\n";
  43. }
  44. }
  45. echo "Done\n";
  46. ?>
  47. --EXPECTF--
  48. Test for Array
  49. Test for String
  50. Done