Bug 14836: (QA followup) Add missing transaction
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 5 Nov 2015 14:05:29 +0000 (11:05 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 5 Nov 2015 14:05:31 +0000 (11:05 -0300)
Bug 15081 removed transaction handling from t::lib::TestBuilder so this
patchset had to be ammended to handle it on its own.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Koha/Patron/Categories.t

index d468175..974b982 100644 (file)
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
+
 use Test::More tests => 5;
+
+use Koha::Database;
 use Koha::Patron::Category;
 use Koha::Patron::Categories;
 use t::lib::TestBuilder;
 
+my $schema = Koha::Database->new->schema;
+$schema->storage->txn_begin;
+
 my $builder = t::lib::TestBuilder->new;
 my $branch = $builder->build({ source => 'Branch', });
 my $nb_of_categories = Koha::Patron::Categories->search->count;
@@ -45,3 +51,7 @@ is_deeply( $retrieved_category_1->default_messaging, [], 'By default there is no
 
 $retrieved_category_1->delete;
 is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' );
+
+$schema->storage->txn_rollback;
+
+1;