bug77958.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. ldap_modify_batch() - bug 77958 - values in ldap_modify_batch must be "string"
  3. --CREDITS--
  4. Côme Chilliet <mcmic@php.net>
  5. --EXTENSIONS--
  6. ldap
  7. --SKIPIF--
  8. <?php require_once('skipifbindfailure.inc'); ?>
  9. --FILE--
  10. <?php
  11. require "connect.inc";
  12. $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
  13. insert_dummy_data($link, $base);
  14. $mods = array(
  15. array(
  16. "attrib" => "telephoneNumber",
  17. "modtype" => LDAP_MODIFY_BATCH_ADD,
  18. "values" => array(
  19. 123456
  20. )
  21. ),
  22. array(
  23. "attrib" => "description",
  24. "modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL
  25. )
  26. );
  27. var_dump(
  28. ldap_modify_batch($link, "cn=userA,$base", $mods),
  29. $entry = ldap_first_entry($link, ldap_read($link, "cn=userA,$base", "(telephoneNumber=*)")),
  30. ldap_get_values($link, $entry, "telephoneNumber")
  31. );
  32. ?>
  33. --CLEAN--
  34. <?php
  35. require "connect.inc";
  36. $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
  37. remove_dummy_data($link, $base);
  38. ?>
  39. --EXPECTF--
  40. bool(true)
  41. object(LDAP\ResultEntry)#%d (0) {
  42. }
  43. array(3) {
  44. [0]=>
  45. string(14) "xx-xx-xx-xx-xx"
  46. [1]=>
  47. string(6) "123456"
  48. ["count"]=>
  49. int(2)
  50. }