From 55170e3f44aee074dbfc5797645ba1e30bc4e08d Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@koha-community.org>
Date: Thu, 9 Jul 2015 09:35:12 +0100
Subject: [PATCH] Bug 14197: TestBuilder - Remove the error on starting the
 transaction

DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1560.
DBIx::Class::Storage::DBI::txn_rollback(): Storage transaction_depth 0 does not match false AutoCommit of DBI::db=HASH(0xa429648), attempting ROLLBACK anyway at t/lib/TestBuilder.pm line 363
---
 t/lib/TestBuilder.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm
index 72b087d..7d6d971 100644
--- a/t/lib/TestBuilder.pm
+++ b/t/lib/TestBuilder.pm
@@ -72,7 +72,9 @@ sub new {
     bless( $self, $class );
 
     $self->schema( Koha::Database->new()->schema );
-    $self->schema->txn_begin();
+    eval {
+        $self->schema->txn_begin();
+    };
     $self->schema->storage->sql_maker->quote_char('`');
     return $self;
 }
-- 
2.1.0