rename tests
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 23 Feb 2010 01:05:04 +0000 (01:05 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 23 Feb 2010 01:05:04 +0000 (01:05 +0000)
t/ldap-koha.pl [deleted file]
t/ldap-koha.t [new file with mode: 0755]
t/ldap-rewrite.pl [deleted file]
t/ldap-rewrite.t [new file with mode: 0755]

diff --git a/t/ldap-koha.pl b/t/ldap-koha.pl
deleted file mode 100755 (executable)
index 7814ade..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-use Test::More tests => 37;
-use Data::Dump qw(dump);
-
-BEGIN {
-       use_ok 'Net::LDAP';
-}
-
-sub ldap_check_error {
-       my $o = shift;
-       ok( ! $o->code, 'no errror' );
-       diag $o->error if $o->code;
-}
-
-ok( my $ldap = Net::LDAP->new( 'localhost:2389' ), 'new Net::LDAP' );
-
-ok( my $bind = $ldap->bind, 'bind' );
-ldap_check_error $bind;
-
-my @test_searches = ( qw/
-uid=dpavlin@ffzg.hr
-pager=E00401001F77E218
-/ );
-
-sub check_search_attributes {
-       my $search = shift;
-
-       foreach my $entry ( $search->entries ) {
-               diag dump $entry;
-               map { ok( $_, "attribute $_" ) } grep { /^\Q$_\E$/i } $entry->attributes;
-       }
-}
-
-foreach my $search ( @test_searches ) {
-
-       ok( my $search = $ldap->search( filter => $search ), "search $search" );
-       ldap_check_error $search;
-       ok( $search->entries, 'have results' );
-       check_search_attributes $search => 'uid', 'mail', 'pager', 'memberOf';
-
-}
-
-
-ok( $ldap->unbind, 'unbind' );
diff --git a/t/ldap-koha.t b/t/ldap-koha.t
new file mode 100755 (executable)
index 0000000..7814ade
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 37;
+use Data::Dump qw(dump);
+
+BEGIN {
+       use_ok 'Net::LDAP';
+}
+
+sub ldap_check_error {
+       my $o = shift;
+       ok( ! $o->code, 'no errror' );
+       diag $o->error if $o->code;
+}
+
+ok( my $ldap = Net::LDAP->new( 'localhost:2389' ), 'new Net::LDAP' );
+
+ok( my $bind = $ldap->bind, 'bind' );
+ldap_check_error $bind;
+
+my @test_searches = ( qw/
+uid=dpavlin@ffzg.hr
+pager=E00401001F77E218
+/ );
+
+sub check_search_attributes {
+       my $search = shift;
+
+       foreach my $entry ( $search->entries ) {
+               diag dump $entry;
+               map { ok( $_, "attribute $_" ) } grep { /^\Q$_\E$/i } $entry->attributes;
+       }
+}
+
+foreach my $search ( @test_searches ) {
+
+       ok( my $search = $ldap->search( filter => $search ), "search $search" );
+       ldap_check_error $search;
+       ok( $search->entries, 'have results' );
+       check_search_attributes $search => 'uid', 'mail', 'pager', 'memberOf';
+
+}
+
+
+ok( $ldap->unbind, 'unbind' );
diff --git a/t/ldap-rewrite.pl b/t/ldap-rewrite.pl
deleted file mode 100755 (executable)
index 5e88dbf..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-use Test::More tests => 9;
-use Data::Dump qw(dump);
-
-BEGIN {
-       use_ok 'Net::LDAP';
-}
-
-our $config;
-ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' );
-
-sub ldap_check_error {
-       my $o = shift;
-       ok( ! $o->code, 'no errror' );
-       diag $o->error if $o->code;
-}
-
-ok( my $ldap = Net::LDAP->new( $config->{server} ), 'new Net::LDAP ' . dump( $config->{server} ) );
-
-ok( my $bind = $ldap->bind( $config->{bind_as}, password => $config->{password} ), 'bind ' . $config->{bind_as} );
-ldap_check_error $bind;
-
-ok( my $search = $ldap->search( %{ $config->{search} } ), 'search ' . dump( $config->{search} ) );
-ldap_check_error $search;
-
-foreach my $entry ( $search->entries ) {
-
-       diag dump $entry;
-
-       my $missing = 0;
-       my @required = @{ $config->{attributes_required} };
-       foreach my $attr ( @required ) {
-               next if grep { /^\Q$attr\E$/i } $entry->attributes;
-               $missing++;
-               diag "$missing missing $attr\n";
-       }
-
-       ok( ! $missing, "attributes " . dump( @required ) );
-}
-
-ok( $ldap->unbind, 'unbind' );
diff --git a/t/ldap-rewrite.t b/t/ldap-rewrite.t
new file mode 100755 (executable)
index 0000000..5e88dbf
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 9;
+use Data::Dump qw(dump);
+
+BEGIN {
+       use_ok 'Net::LDAP';
+}
+
+our $config;
+ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' );
+
+sub ldap_check_error {
+       my $o = shift;
+       ok( ! $o->code, 'no errror' );
+       diag $o->error if $o->code;
+}
+
+ok( my $ldap = Net::LDAP->new( $config->{server} ), 'new Net::LDAP ' . dump( $config->{server} ) );
+
+ok( my $bind = $ldap->bind( $config->{bind_as}, password => $config->{password} ), 'bind ' . $config->{bind_as} );
+ldap_check_error $bind;
+
+ok( my $search = $ldap->search( %{ $config->{search} } ), 'search ' . dump( $config->{search} ) );
+ldap_check_error $search;
+
+foreach my $entry ( $search->entries ) {
+
+       diag dump $entry;
+
+       my $missing = 0;
+       my @required = @{ $config->{attributes_required} };
+       foreach my $attr ( @required ) {
+               next if grep { /^\Q$attr\E$/i } $entry->attributes;
+               $missing++;
+               diag "$missing missing $attr\n";
+       }
+
+       ok( ! $missing, "attributes " . dump( @required ) );
+}
+
+ok( $ldap->unbind, 'unbind' );