summaryrefslogtreecommitdiff
path: root/ext/ldap/tests/ldap_modify_batch_basic.phpt
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
commit8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch)
treeed51eb30a2cbc92b102557498fb3e4113da1bb07 /ext/ldap/tests/ldap_modify_batch_basic.phpt
parent9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff)
parentbaddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff)
downloadphp-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits) Extra comma Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators Simplification zend_get_property_info_quick() cleanup and optimization initialize lineno before calling compile file file in phar Use ADDREF instead of DUP, it must be enough. Removed old irrelevant comment fixed compilation error Fix bug #68262: Broken reference across cloned objects export functions needed for phpdbg Fixed compilation Optimized property access handlers. Removed EG(std_property_info). Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Don't make difference between undefined and unaccessible properies when call __get() and family Don't make useless CSE array_pop/array_shift optimization check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this News entry for new curl constants News entry for new curl constants ...
Diffstat (limited to 'ext/ldap/tests/ldap_modify_batch_basic.phpt')
-rw-r--r--ext/ldap/tests/ldap_modify_batch_basic.phpt109
1 files changed, 109 insertions, 0 deletions
diff --git a/ext/ldap/tests/ldap_modify_batch_basic.phpt b/ext/ldap/tests/ldap_modify_batch_basic.phpt
new file mode 100644
index 0000000000..4f6705c7e8
--- /dev/null
+++ b/ext/ldap/tests/ldap_modify_batch_basic.phpt
@@ -0,0 +1,109 @@
+--TEST--
+ldap_modify_batch() - Basic batch modify operation
+--CREDITS--
+Patrick Allaert <patrickallaert@php.net>
+Ondřej Hošek <ondra.hosek@gmail.com>
+--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);
+
+$mods = array(
+ array(
+ "attrib" => "telephoneNumber",
+ "modtype" => LDAP_MODIFY_BATCH_ADD,
+ "values" => array(
+ "+1 555 5551717"
+ )
+ ),
+ array(
+ "attrib" => "sn",
+ "modtype" => LDAP_MODIFY_BATCH_REPLACE,
+ "values" => array("Brown-Smith")
+ ),
+ array(
+ "attrib" => "description",
+ "modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL
+ )
+);
+
+var_dump(
+ ldap_modify_batch($link, "cn=userA,dc=my-domain,dc=com", $mods),
+ ldap_get_entries($link, ldap_search($link, "dc=my-domain,dc=com", "(sn=Brown-Smith)"))
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+remove_dummy_data($link);
+?>
+--EXPECT--
+bool(true)
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(12) {
+ ["objectclass"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(6) "person"
+ }
+ [0]=>
+ string(11) "objectclass"
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userA"
+ }
+ [1]=>
+ string(2) "cn"
+ ["userpassword"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(4) "oops"
+ }
+ [2]=>
+ string(12) "userpassword"
+ ["telephonenumber"]=>
+ array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ string(14) "xx-xx-xx-xx-xx"
+ [1]=>
+ string(14) "+1 555 5551717"
+ }
+ [3]=>
+ string(15) "telephonenumber"
+ ["sn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(11) "Brown-Smith"
+ }
+ [4]=>
+ string(2) "sn"
+ ["count"]=>
+ int(5)
+ ["dn"]=>
+ string(28) "cn=userA,dc=my-domain,dc=com"
+ }
+}
+===DONE===