summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2012-11-24 17:31:18 +0100
committerRemi Collet <remi@php.net>2012-11-24 17:31:18 +0100
commit88d2b8c5fd0ec4e85e84e6b76fe8660823a65273 (patch)
tree2d8ec4c451d256f9f655c3432b578cf43bed9bbd
parent7cd2f4b6a6a522c813fc93df00993b77cc43c3a2 (diff)
parent92147243bf082b9d05c1b2949c35637c8fbd0dd9 (diff)
downloadphp-git-88d2b8c5fd0ec4e85e84e6b76fe8660823a65273.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: add unit test for bug 63126 NEWS
-rw-r--r--ext/imap/tests/bug63126.phpt52
1 files changed, 52 insertions, 0 deletions
diff --git a/ext/imap/tests/bug63126.phpt b/ext/imap/tests/bug63126.phpt
new file mode 100644
index 0000000000..70fba3843e
--- /dev/null
+++ b/ext/imap/tests/bug63126.phpt
@@ -0,0 +1,52 @@
+--TEST--
+imap_open() DISABLE_AUTHENTICATOR ignores array param
+--SKIPIF--
+<?php
+extension_loaded('imap') or die('skip imap extension not available in this build');
+
+require_once(dirname(__FILE__).'/imap_include.inc');
+
+$in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1);
+if (!$in) {
+ die("skip could not connect to mailbox $default_mailbox");
+}
+$kerberos = false;
+if (is_array($errors = imap_errors())) {
+ foreach ($errors as $err) {
+ if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
+ $kerberos = true;
+ }
+ }
+}
+if (!$kerberos) {
+ die("skip need a GSSAPI/Kerberos aware server");
+}
+?>
+--FILE--
+<?php
+$tests = array(
+ 'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
+ 'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
+);
+require_once(dirname(__FILE__).'/imap_include.inc');
+foreach ($tests as $name => $testparams) {
+ echo "Test for $name\n";
+ $in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1, $testparams);
+ if ($in) {
+ if (is_array($errors = imap_errors())) {
+ foreach ($errors as $err) {
+ if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
+ echo "$err\n";
+ }
+ }
+ }
+ } else {
+ echo "Can't connect\n";
+ }
+}
+echo "Done\n";
+?>
+--EXPECTF--
+Test for Array
+Test for String
+Done