php-src/ext/ldap/tests/ldap_error_basic.phpt
Côme Bernigaud 8836404faf Fixed LDAP tests so that base can exists
Now you can set the base in the env var LDAP_TEST_BASE.
The base has to exists. (before tests were attempting to create/delete
the base itself)
2015-06-17 13:50:14 +02:00

31 lines
607 B
PHP

--TEST--
ldap_error() - Basic ldap_error() 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, "badDN $base", array(
"objectClass" => array(
"top",
"dcObject",
"organization"),
"dc" => "my-domain",
"o" => "my-domain",
));
var_dump(
ldap_error($link)
);
?>
===DONE===
--EXPECT--
string(17) "Invalid DN syntax"
===DONE===