X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2Fdb_dependent%2FAuth_with_ldap.t;h=446982c23bac5f87d8cc41e833fc6613f34b43e7;hb=b74d04543593bc4ead9da839c6692bf2d1841712;hp=c925c70e3d8a25e8e9132577e4d3eaeba1d4b777;hpb=fdda5d7d7cf8c724e57e5bb8b1e55533cb0e7b8b;p=srvgit diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t index c925c70e3d..446982c23b 100755 --- a/t/db_dependent/Auth_with_ldap.t +++ b/t/db_dependent/Auth_with_ldap.t @@ -25,11 +25,10 @@ use Test::Warn; use C4::Context; -my $dbh = C4::Context->dbh; +use Koha::Patrons; -# Start transaction -$dbh->{AutoCommit} = 0; -$dbh->{RaiseError} = 1; +my $schema = Koha::Database->new->schema; +$schema->storage->txn_begin; my $builder = t::lib::TestBuilder->new(); @@ -116,6 +115,7 @@ subtest 'checkpw_ldap tests' => sub { plan tests => 4; + my $dbh = C4::Context->dbh; ## Connection fail tests $desired_connection_result = 'error'; warning_is { @@ -179,7 +179,7 @@ subtest 'checkpw_ldap tests' => sub { $update = 0; $desired_count_result = 0; # user auth problem - C4::Members::DelMember( $borrower->{borrowernumber} ); + Koha::Patrons->find( $borrower->{borrowernumber} )->delete; reload_ldap_module(); is( C4::Auth_with_ldap::checkpw_ldap( $dbh, 'hola', password => 'hey' ), @@ -506,6 +506,6 @@ sub reload_ldap_module { return; } -$dbh->rollback; +$schema->storage->txn_rollback; 1;