Mahiro Ando > Test-Net-LDAP-0.02 > Test::Net::LDAP::Util

Download:
Test-Net-LDAP-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Test-Net-LDAP-0.04

NAME ^

Test::Net::LDAP::Util - Testing utilities for Test::Net::LDAP

EXPORT ^

The following subroutines are exported on demand.

    use Test::Net::LDAP::Util qw(
        ldap_result_ok
        ldap_result_is
        ldap_mockify
    );

All the subroutines are exported if :all is specified.

    use Test::Net::LDAP::Util ':all';

SUBROUTINES ^

ldap_result_ok

    ldap_result_ok($mesg, $name);

Tests the result of an LDAP operation to see if the code is LDAP_SUCCESS.

$mesg is either a Net::LDAP::Message object returned by LDAP operation methods or a result code.

$name is the optional test name.

ldap_result_is

    ldap_result_is($mesg, $expect, $name);

Tests the result of an LDAP operation to see if the code is equal to $expect.

The values of $mesg and $expect are either a Net::LDAP::Message object returned by LDAP operation methods or a result code.

$name is the optional test name.

ldap_mockify

    ldap_mockify {
        # CODE
    };

Inside the code block, all the occurrences of Net::LDAP::new are replaced by Test::Net::LDAP::Mock::new. See Test::Net::LDAP::Mock for more details.

syntax highlighting: