php-src/ext/ldap/tests/ldap_delete_basic.phpt
2015-06-23 16:11:12 +02:00

41 lines
850 B
PHP

--TEST--
ldap_delete() - Basic delete operation
--CREDITS--
Patrick Allaert <patrickallaert@php.net>
# Belgian PHP Testfest 2009
--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);
ldap_add($link, "dc=my-domain,$base", array(
"objectClass" => array(
"top",
"dcObject",
"organization"),
"dc" => "my-domain",
"o" => "my-domain",
));
var_dump(
ldap_delete($link, "dc=my-domain,$base"),
@ldap_search($link, "dc=my-domain,$base", "(o=my-domain)")
);
?>
===DONE===
--CLEAN--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECT--
bool(true)
bool(false)
===DONE===