summaryrefslogtreecommitdiff
path: root/ext/ldap/tests
diff options
context:
space:
mode:
authorCôme Chilliet <mcmic@php.net>2019-06-13 22:12:34 +0200
committerCôme Chilliet <mcmic@php.net>2019-06-13 22:12:34 +0200
commit5d2fe48785b6d24102ff53e78631cba7f2aefbef (patch)
tree40049f00d9700d7099cc9d509e3a31c646978f84 /ext/ldap/tests
parentc219d8d5c2d11d0184576c966bb939bc3ec72c24 (diff)
downloadphp-git-5d2fe48785b6d24102ff53e78631cba7f2aefbef.tar.gz
Some more string conversion handling, fixing bug #77958
Diffstat (limited to 'ext/ldap/tests')
-rw-r--r--ext/ldap/tests/bug77958.phpt55
1 files changed, 55 insertions, 0 deletions
diff --git a/ext/ldap/tests/bug77958.phpt b/ext/ldap/tests/bug77958.phpt
new file mode 100644
index 0000000000..7cac768b1a
--- /dev/null
+++ b/ext/ldap/tests/bug77958.phpt
@@ -0,0 +1,55 @@
+--TEST--
+ldap_modify_batch() - bug 77958 - values in ldap_modify_batch must be "string"
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+$mods = array(
+ array(
+ "attrib" => "telephoneNumber",
+ "modtype" => LDAP_MODIFY_BATCH_ADD,
+ "values" => array(
+ 123456
+ )
+ ),
+ array(
+ "attrib" => "description",
+ "modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL
+ )
+);
+
+var_dump(
+ ldap_modify_batch($link, "cn=userA,$base", $mods),
+ $entry = ldap_first_entry($link, ldap_read($link, "cn=userA,$base", "(telephoneNumber=*)")),
+ ldap_get_values($link, $entry, "telephoneNumber")
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+bool(true)
+resource(%d) of type (ldap result entry)
+array(3) {
+ [0]=>
+ string(14) "xx-xx-xx-xx-xx"
+ [1]=>
+ string(6) "123456"
+ ["count"]=>
+ int(2)
+}
+===DONE===