ldap_connect_variation.phpt 895 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // Legacy host:port syntax
  27. $link = ldap_connect("$host:$port");
  28. var_dump($link);
  29. ?>
  30. ===DONE===
  31. --EXPECTF--
  32. resource(%d) of type (ldap link)
  33. resource(%d) of type (ldap link)
  34. resource(%d) of type (ldap link)
  35. resource(%d) of type (ldap link)
  36. resource(%d) of type (ldap link)
  37. resource(%d) of type (ldap link)
  38. ===DONE===