From a8da733380b6cefa4d04f3cd1e1f667e612d36e5 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 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- 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 2a1ab17..a57d94b 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 { @@ -344,14 +344,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}; @@ -368,8 +364,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' }, @@ -377,7 +373,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.9.3