ldap_connect_variation.phpt 780 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. ldap_connect() - Variation
  3. --CREDITS--
  4. Patrick Allaert <patrickallaert@php.net>
  5. # Belgian PHP Testfest 2009
  6. --SKIPIF--
  7. <?php require_once('skipif.inc'); ?>
  8. --FILE--
  9. <?php
  10. require "connect.inc";
  11. // no hostname, no port
  12. $link = ldap_connect();
  13. var_dump($link);
  14. // no port
  15. $link = ldap_connect($host);
  16. var_dump($link);
  17. // URI
  18. $link = ldap_connect("ldap://$host:$port");
  19. var_dump($link);
  20. // URI no port
  21. $link = ldap_connect("ldap://$host");
  22. var_dump($link);
  23. // bad hostname (connect should work, not bind)
  24. $link = ldap_connect("nonexistent" . $host);
  25. var_dump($link);
  26. ?>
  27. ===DONE===
  28. --EXPECTF--
  29. resource(%d) of type (ldap link)
  30. resource(%d) of type (ldap link)
  31. resource(%d) of type (ldap link)
  32. resource(%d) of type (ldap link)
  33. resource(%d) of type (ldap link)
  34. ===DONE===