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--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// DN not found
17var_dump(ldap_mod_del($link, "dc=my-domain,$base", ["dc" => "my-domain"]));
18
19// Invalid DN
20var_dump(ldap_mod_del($link, "weirdAttribute=val", ["dc" => "my-domain"]));
21
22?>
23--CLEAN--
24<?php
25require "connect.inc";
26
27$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
28
29@ldap_delete($link, "dc=my-domain,$base");
30?>
31--EXPECTF--
32Warning: ldap_mod_del(): Modify: No such object in %s on line %d
33bool(false)
34
35Warning: ldap_mod_del(): Modify: Invalid DN syntax in %s on line %d
36bool(false)
37