1--TEST--
2ldap_delete() - Delete operation 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// Invalid DN
16var_dump(
17    ldap_delete($link, "weirdAttribute=val"),
18    ldap_error($link),
19    ldap_errno($link)
20);
21
22// Deleting unexisting data
23var_dump(
24    ldap_delete($link, "dc=my-domain,$base"),
25    ldap_error($link),
26    ldap_errno($link)
27);
28?>
29--CLEAN--
30<?php
31require "connect.inc";
32
33$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
34?>
35--EXPECTF--
36Warning: ldap_delete(): Delete: Invalid DN syntax in %s on line %d
37bool(false)
38string(17) "Invalid DN syntax"
39int(34)
40
41Warning: ldap_delete(): Delete: No such object in %s on line %d
42bool(false)
43string(14) "No such object"
44int(32)
45