1--TEST--
2ldap_mod_replace() - ldap_mod_replace() 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_replace($link, "dc=my-domain,$base", array()));
17
18// Invalid DN
19var_dump(ldap_mod_replace($link, "weirdAttribute=val", array()));
20
21// Invalid attributes
22var_dump(ldap_mod_replace($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?>
30--EXPECTF--
31Warning: ldap_mod_replace(): Modify: No such object in %s on line %d
32bool(false)
33
34Warning: ldap_mod_replace(): Modify: Invalid DN syntax in %s on line %d
35bool(false)
36
37Warning: ldap_mod_replace(): Unknown attribute in the data in %s on line %d
38bool(false)
39