From c1aab1a6c6bae2d6550c9933ed55ecd51498daa7 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 4 Jun 2015 16:44:25 -0400 Subject: [PATCH] Bug 14334: t/db_dependent/Auth_with_cas.t AutoCommit fix There is no easy way to trigger an obvious problem. TEST PLAN --------- 1) apply patch 2) git diff origin/master -- Are the additions/subtractions similar to http://paste.lisp.org/display/149194? 3) run koha qa test tools --- t/db_dependent/Auth_with_cas.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t index b67ba1e..db06e9e 100755 --- a/t/db_dependent/Auth_with_cas.t +++ b/t/db_dependent/Auth_with_cas.t @@ -21,6 +21,7 @@ use Test::More tests => 4; use CGI; use C4::Context; +use Koha::Database; BEGIN { use_ok('C4::Auth_with_cas'); @@ -35,7 +36,9 @@ BEGIN { my $dbh = C4::Context->dbh; # Start transaction -$dbh->{ AutoCommit } = 0; +my $database = Koha::Database->new(); +my $schema = $database->schema(); +$schema->storage->txn_begin(); $dbh->{ RaiseError } = 1; C4::Context->set_preference('OPACBaseURL','http://localhost'); @@ -63,6 +66,6 @@ is(C4::Auth_with_cas::_url_with_get_params($cgi, 'intranet'), -$dbh->rollback; +$schema->storage->txn_rollback(); 1; -- 2.1.4