Test::Net::LDAP::Util - Testing utilities for Test::Net::LDAP
The following subroutines are exported on demand.
use Test::Net::LDAP::Util qw( ldap_result_ok ldap_result_is ldap_mockify ldap_dn_is );
All the subroutines are exported if :all is specified.
:all
use Test::Net::LDAP::Util ':all';
ldap_result_ok($mesg, $name);
Tests the result of an LDAP operation to see if the code is LDAP_SUCCESS.
LDAP_SUCCESS
$mesg is either a Net::LDAP::Message object returned by LDAP operation methods or a result code.
$mesg
$name is the optional test name.
$name
ldap_result_is($mesg, $expect, $name);
Tests the result of an LDAP operation to see if the code is equal to $expect.
$expect
The values of $mesg and $expect are either a Net::LDAP::Message object returned by LDAP operation methods or a result code.
ldap_mockify { # CODE };
Inside the code block (recursively), all the occurrences of Net::LDAP::new are replaced by Test::Net::LDAP::Mock::new.
Net::LDAP::new
Test::Net::LDAP::Mock::new
Subclasses of Net::LDAP are also mockified. Test::Net::LDAP::Mock is inserted into @ISA of each subclass, only within the context of ldap_mockify.
Net::LDAP
Test::Net::LDAP::Mock
@ISA
ldap_mockify
See Test::Net::LDAP::Mock for more details.
ldap_dn_is($actual_dn, $expect_dn, $name);
Tests equality of two DNs that are not necessarily canonicalized.
The comparison is case-insensitive.
To install Test::Net::LDAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Net::LDAP
CPAN shell
perl -MCPAN -e shell install Test::Net::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.