1--TEST--
2ldap_delete() - Delete operation that should fail
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--EXTENSIONS--
7ldap
8--SKIPIF--
9<?php require_once('skipifbindfailure.inc'); ?>
10--FILE--
11<?php
12require "connect.inc";
13
14$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
15
16// Invalid DN
17var_dump(
18    ldap_delete($link, "weirdAttribute=val"),
19    ldap_error($link),
20    ldap_errno($link)
21);
22
23// Deleting unexisting data
24var_dump(
25    ldap_delete($link, "dc=my-domain,$base"),
26    ldap_error($link),
27    ldap_errno($link)
28);
29?>
30--CLEAN--
31<?php
32require "connect.inc";
33
34$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
35?>
36--EXPECTF--
37Warning: ldap_delete(): Delete: Invalid DN syntax in %s on line %d
38bool(false)
39string(17) "Invalid DN syntax"
40int(34)
41
42Warning: ldap_delete(): Delete: No such object in %s on line %d
43bool(false)
44string(14) "No such object"
45int(32)
46