Bug 14334: Remove AutoCommit from tests
[koha.git] / t / db_dependent / Serials / Numberpattern.t
index c964ee9..f703cd4 100644 (file)
@@ -1,12 +1,14 @@
 #!/usr/bin/perl
 
-use C4::Context;
-use Test::More tests => 95;
 use Modern::Perl;
+use Test::More tests => 95;
 
+use C4::Context;
+use Koha::Database;
+
+my $schema = Koha::Database->new->schema;
+$schema->storage->txn_begin;
 my $dbh = C4::Context->dbh;
-$dbh->{RaiseError} = 1;
-$dbh->{AutoCommit} = 0;
 
 use C4::Serials::Numberpattern;
 
@@ -99,5 +101,3 @@ is(scalar @numberpatterns, 1, "There is one numberpattern");
 DelSubscriptionNumberpattern($id2);
 @numberpatterns = GetSubscriptionNumberpatterns();
 is(scalar @numberpatterns, 0, "There is no numberpattern");
-
-$dbh->rollback;