From e6bb7a38ef67c3494de408d4e6add087ae0006ed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 30 Aug 2013 09:47:24 +0200 Subject: [PATCH] [SIGNED-OFF] Bug 10363: UT: execute tests into a transaction Signed-off-by: Bernardo Gonzalez Kriegel --- t/db_dependent/AuthorisedValues.t | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t index 2b5cc96..6c6b15b 100644 --- a/t/db_dependent/AuthorisedValues.t +++ b/t/db_dependent/AuthorisedValues.t @@ -1,12 +1,17 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 31; +use Test::More tests => 32; +use C4::Context; use Koha::AuthorisedValue; use Koha::AuthorisedValues; -use Data::Dumper; # FIXME REMOVEME +my $dbh = C4::Context->dbh; +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + +$dbh->do("DELETE FROM authorised_values"); # Tests for Koha::AuthorisedValue @@ -146,9 +151,6 @@ $selected = shift @$selected; is( $selected->{selected}, 1, 'av is selected' ); is( $selected->{authorised_value}, 'value 5', 'av selected is "value 5"'); +is( $av1->delete, 1, "Delete 1 AV" ); -$av1->delete; -$av2->delete; -$av3->delete; -$av4->delete; -$av5->delete; +$dbh->rollback; -- 1.7.9.5