From efccc73e24f6bfb6a7af2473ce221d10d36892a5 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 30 Sep 2024 20:45:04 +0000 Subject: [PATCH] Bug 37720: (follow-up) Adjust tests Signed-off-by: wainuiwitikapark --- t/db_dependent/Creators/Lib.t | 45 ++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/t/db_dependent/Creators/Lib.t b/t/db_dependent/Creators/Lib.t index c18a659c1f..5b314bcd68 100755 --- a/t/db_dependent/Creators/Lib.t +++ b/t/db_dependent/Creators/Lib.t @@ -18,7 +18,7 @@ use Modern::Perl; use Graphics::Magick; -use Test::More tests => 647; +use Test::More tests => 653; use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; @@ -903,12 +903,14 @@ my $summary1 = $record_title . " | " . ( $b_author1 ? $b_author1 : 'N/A' my $itemtypes_pref = C4::Context->preference("item-level_itypes"); my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; -is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); -is( $labels->[0]->{_summary}, $summary1, '_summary is good' ); -is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); -is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); -is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); -is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); +is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); +is( $labels->[0]->{_summary}->{author}, $b_author1, '_summary->{author} is good' ); +is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber1, '_summary->{biblionumber} is good' ); +is( $labels->[0]->{_summary}->{title}, $b_title1, '_summary->{title} is good' ); +is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); +is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); +is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); +is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); # record without author @items = [ @@ -931,12 +933,14 @@ my $summary2 = $record_title . " | " . ( $b_author2 ? $b_author2 : 'N/A' ); $itemtypes_pref = C4::Context->preference("item-level_itypes"); $record_itemtype = $itemtypes_pref ? $i_itype2 : $bi_itemtype2; -is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); -is( $labels->[0]->{_summary}, $summary2, '_summary is good' ); -is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); -is( $labels->[0]->{_barcode}, $i_barcode2, '_barcode is good' ); -is( $labels->[0]->{_item_number}, $i_itemnumber2, '_item_number is good' ); -is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' ); +is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); +is( $labels->[0]->{_summary}->{author}, $b_author2, '_summary->{author} is good' ); +is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber2, '_summary->{biblionumber} is good' ); +is( $labels->[0]->{_summary}->{title}, $b_title2, '_summary->{title} is good' ); +is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); +is( $labels->[0]->{_barcode}, $i_barcode2, '_barcode is good' ); +is( $labels->[0]->{_item_number}, $i_itemnumber2, '_item_number is good' ); +is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' ); #Mocking C4::Context->preference("item-level_itypes") { @@ -963,12 +967,15 @@ is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' ); my $itemtypes_pref = C4::Context->preference("item-level_itypes"); my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; - is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); - is( $labels->[0]->{_summary}, $summary1, '_summary is good' ); - is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); - is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); - is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); - is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); + is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); + is( $labels->[0]->{_summary}->{author}, "Author 1", '_summary->{author} is good' ); + is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber1, '_summary->{biblionumber} is good' ); + is( $labels->[0]->{_summary}->{title}, "Title 1", '_summary->{title} is good' ); + is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); + is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); + is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); + is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); + } # ---------- Testing get_card_summary ---------------------