From 146b71c862b7c6b00456761e4acc63742b923d59 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 31 Mar 2017 13:32:55 +0200 Subject: [PATCH] Bug 18182: [QA Follow-up] Fix a few typos, consistent rollback Content-Type: text/plain; charset=utf-8 Since we here only use one rollback and this test does not care, it is more consistent to keep that pattern. Additionally, promoting two globals to our. Signed-off-by: Marcel de Rooy --- t/db_dependent/TestBuilder.t | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t index d417894..efce9c3 100644 --- a/t/db_dependent/TestBuilder.t +++ b/t/db_dependent/TestBuilder.t @@ -30,9 +30,9 @@ BEGIN { use_ok('t::lib::TestBuilder'); } -my $schema = Koha::Database->new->schema; +our $schema = Koha::Database->new->schema; $schema->storage->txn_begin; -my $builder; +our $builder; subtest 'Start with some trivial tests' => sub { @@ -342,14 +342,10 @@ subtest 'Default values' => sub { is( $item->{more_subfields_xml}, 'some xml', 'Default should not overwrite assigned value' ); }; -$schema->storage->txn_rollback; - subtest 'build_object() tests' => sub { plan tests => 5; - $schema->storage->txn_begin; - $builder = t::lib::TestBuilder->new(); my $categorycode = $builder->build( { source => 'Category' } )->{categorycode}; @@ -366,8 +362,8 @@ subtest 'build_object() tests' => sub { is( ref($issuing_rule), 'Koha::IssuingRule', 'Type is correct' ); is( $issuing_rule->categorycode, - $categorycode, 'Firstname correctly set' ); - is( $issuing_rule->itemtype, $itemtype, 'Firstname correctly set' ); + $categorycode, 'Category code correctly set' ); + is( $issuing_rule->itemtype, $itemtype, 'Item type correctly set' ); warning_is { $issuing_rule = $builder->build_object( {} ); } { carped => 'Missing class param' }, @@ -375,7 +371,6 @@ subtest 'build_object() tests' => sub { is( $issuing_rule, undef, 'If the class parameter is missing, undef is returned' ); - $schema->storage->txn_rollback; }; -1; +$schema->storage->txn_rollback; -- 2.1.4