summaryrefslogtreecommitdiff
path: root/ext/ldap/tests/bug77958.phpt
blob: 7cac768b1aab2757fbcaae13bc367b40928a540c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--TEST--
ldap_modify_batch() - bug 77958 - values in ldap_modify_batch must be "string"
--CREDITS--
Côme Chilliet <mcmic@php.net>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifbindfailure.inc'); ?>
--FILE--
<?php
require "connect.inc";

$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);

$mods = array(
	array(
		"attrib"	=> "telephoneNumber",
		"modtype"	=> LDAP_MODIFY_BATCH_ADD,
		"values"	=> array(
			123456
		)
	),
	array(
		"attrib"	=> "description",
		"modtype"	=> LDAP_MODIFY_BATCH_REMOVE_ALL
	)
);

var_dump(
	ldap_modify_batch($link, "cn=userA,$base", $mods),
	$entry = ldap_first_entry($link, ldap_read($link, "cn=userA,$base", "(telephoneNumber=*)")),
	ldap_get_values($link, $entry, "telephoneNumber")
);
?>
===DONE===
--CLEAN--
<?php
require "connect.inc";

$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);

remove_dummy_data($link, $base);
?>
--EXPECTF--
bool(true)
resource(%d) of type (ldap result entry)
array(3) {
  [0]=>
  string(14) "xx-xx-xx-xx-xx"
  [1]=>
  string(6) "123456"
  ["count"]=>
  int(2)
}
===DONE===