Annotation of embedaddon/php/ext/ldap/tests/ldap_compare_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_compare() - Testing ldap_compare() that should fail
! 3: --CREDITS--
! 4: Patrick Allaert <patrickallaert@php.net>
! 5: # Belgian PHP Testfest 2009
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: <?php require_once('skipifbindfailure.inc'); ?>
! 9: --FILE--
! 10: <?php
! 11: require "connect.inc";
! 12:
! 13: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 14: insert_dummy_data($link);
! 15:
! 16: // Too few parameters
! 17: var_dump(ldap_compare($link));
! 18: var_dump(ldap_compare($link, $link));
! 19: var_dump(ldap_compare($link, $link, $link));
! 20:
! 21: // Too many parameters
! 22: var_dump(ldap_compare($link, $link, $link, $link, "Additional data"));
! 23:
! 24: var_dump(
! 25: ldap_compare($link, "cn=userNotAvailable,dc=my-domain,dc=com", "sn", "testSN1"),
! 26: ldap_error($link),
! 27: ldap_errno($link)
! 28: );
! 29: ?>
! 30: ===DONE===
! 31: --CLEAN--
! 32: <?php
! 33: include "connect.inc";
! 34:
! 35: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 36: remove_dummy_data($link);
! 37: ?>
! 38: --EXPECTF--
! 39: Warning: ldap_compare() expects exactly 4 parameters, 1 given in %s on line %d
! 40: NULL
! 41:
! 42: Warning: ldap_compare() expects exactly 4 parameters, 2 given in %s on line %d
! 43: NULL
! 44:
! 45: Warning: ldap_compare() expects exactly 4 parameters, 3 given in %s on line %d
! 46: NULL
! 47:
! 48: Warning: ldap_compare() expects exactly 4 parameters, 5 given in %s on line %d
! 49: NULL
! 50:
! 51: Warning: ldap_compare(): Compare: No such object in %s on line %d
! 52: int(-1)
! 53: string(14) "No such object"
! 54: int(32)
! 55: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>