From 4ece369b1ff202b6f7df2599d6caf0ccf541d712 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 14 Dec 2022 23:08:40 -1000 Subject: [PATCH] Bug 32464: (follow-up) fix t/db_dependent/Koha/Item.t Remove useless unit tests with mss arg Test with : prove t/db_dependent/Koha/Filter/EmbedItems.t Signed-off-by: Nick Clemens --- t/db_dependent/Koha/Item.t | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 8b6abda059..bd3cdbd7a2 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -362,7 +362,7 @@ subtest "as_marc_field() tests" => sub { my @schema_columns = $schema->resultset('Item')->result_source->columns; my @mapped_columns = grep { exists $mss->{'items.'.$_} } @schema_columns; - plan tests => 2 * (scalar @mapped_columns + 1) + 4; + plan tests => scalar @mapped_columns + 5; $schema->storage->txn_begin; @@ -370,23 +370,7 @@ subtest "as_marc_field() tests" => sub { # Make sure it has at least one undefined attribute $item->set({ replacementprice => undef })->store->discard_changes; - # Tests with the mss parameter - my $marc_field = $item->as_marc_field({ mss => $mss }); - - is( - $marc_field->tag, - $itemtag, - 'Generated field set the right tag number' - ); - - foreach my $column ( @mapped_columns ) { - my $tagsubfield = $mss->{ 'items.' . $column }[0]->{tagsubfield}; - is( $marc_field->subfield($tagsubfield), - $item->$column, "Value is mapped correctly for column $column" ); - } - - # Tests without the mss parameter - $marc_field = $item->as_marc_field(); + my $marc_field = $item->as_marc_field; is( $marc_field->tag, -- 2.30.2