From 79cfa55caeef1c89564dc0481bbbfe45f3e0d8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 7 Sep 2017 09:33:01 +0200 Subject: [PATCH] Added a test for assertion control --- ext/ldap/tests/ldap_controls.phpt | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 ext/ldap/tests/ldap_controls.phpt diff --git a/ext/ldap/tests/ldap_controls.phpt b/ext/ldap/tests/ldap_controls.phpt new file mode 100644 index 00000000000..3838da4ac85 --- /dev/null +++ b/ext/ldap/tests/ldap_controls.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test the use of controls +--CREDITS-- +Côme Chilliet +--SKIPIF-- + +--FILE-- + LDAP_CONTROL_ASSERT, 'value' => ['filter' => '(objectClass=organization)']]]), + ldap_get_entries($link, $result), + $result = ldap_search($link, "o=test,$base", "objectClass=*", array('o'), 0, 0, 0, LDAP_DEREF_NEVER, + [['oid' => LDAP_CONTROL_ASSERT, 'value' => ['filter' => '(objectClass=organizationalUnit)']]]) +); +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +Warning: ldap_search(): Search: Assertion Failed in %s on line %d +resource(%d) of type (ldap result) +array(2) { + ["count"]=> + int(1) + [0]=> + array(4) { + ["o"]=> + array(2) { + ["count"]=> + int(1) + [0]=> + string(4) "test" + } + [0]=> + string(1) "o" + ["count"]=> + int(1) + ["dn"]=> + string(%d) "o=test,%s" + } +} +bool(false) +===DONE===