1--TEST--
2ldap_mod_del() - ldap_mod_del() operations that should fail
3--CREDITS--
4Patrick 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
11require "connect.inc";
12
13$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
14
15// DN not found
16var_dump(ldap_mod_del($link, "dc=my-domain,$base", array()));
17
18// Invalid DN
19var_dump(ldap_mod_del($link, "weirdAttribute=val", array()));
20
21// Invalid attributes
22var_dump(ldap_mod_del($link, "$base", array('dc')));
23?>
24--CLEAN--
25<?php
26require "connect.inc";
27
28$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
29
30ldap_delete($link, "dc=my-domain,$base");
31?>
32--EXPECTF--
33Warning: ldap_mod_del(): Modify: No such object in %s on line %d
34bool(false)
35
36Warning: ldap_mod_del(): Modify: Invalid DN syntax in %s on line %d
37bool(false)
38
39Warning: ldap_mod_del(): Unknown attribute in the data in %s on line %d
40bool(false)
41