Lines 18-24
Link Here
|
18 |
|
18 |
|
19 |
use Modern::Perl; |
19 |
use Modern::Perl; |
20 |
use Graphics::Magick; |
20 |
use Graphics::Magick; |
21 |
use Test::More tests => 647; |
21 |
use Test::More tests => 653; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
24 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
Lines 903-914
my $summary1 = $record_title . " | " . ( $b_author1 ? $b_author1 : 'N/A'
Link Here
|
903 |
my $itemtypes_pref = C4::Context->preference("item-level_itypes"); |
903 |
my $itemtypes_pref = C4::Context->preference("item-level_itypes"); |
904 |
my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; |
904 |
my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; |
905 |
|
905 |
|
906 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
906 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
907 |
is( $labels->[0]->{_summary}, $summary1, '_summary is good' ); |
907 |
is( $labels->[0]->{_summary}->{author}, $b_author1, '_summary->{author} is good' ); |
908 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
908 |
is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber1, '_summary->{biblionumber} is good' ); |
909 |
is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); |
909 |
is( $labels->[0]->{_summary}->{title}, $b_title1, '_summary->{title} is good' ); |
910 |
is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); |
910 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
911 |
is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); |
911 |
is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); |
|
|
912 |
is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); |
913 |
is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); |
912 |
|
914 |
|
913 |
# record without author |
915 |
# record without author |
914 |
@items = [ |
916 |
@items = [ |
Lines 931-942
my $summary2 = $record_title . " | " . ( $b_author2 ? $b_author2 : 'N/A' );
Link Here
|
931 |
$itemtypes_pref = C4::Context->preference("item-level_itypes"); |
933 |
$itemtypes_pref = C4::Context->preference("item-level_itypes"); |
932 |
$record_itemtype = $itemtypes_pref ? $i_itype2 : $bi_itemtype2; |
934 |
$record_itemtype = $itemtypes_pref ? $i_itype2 : $bi_itemtype2; |
933 |
|
935 |
|
934 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
936 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
935 |
is( $labels->[0]->{_summary}, $summary2, '_summary is good' ); |
937 |
is( $labels->[0]->{_summary}->{author}, $b_author2, '_summary->{author} is good' ); |
936 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
938 |
is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber2, '_summary->{biblionumber} is good' ); |
937 |
is( $labels->[0]->{_barcode}, $i_barcode2, '_barcode is good' ); |
939 |
is( $labels->[0]->{_summary}->{title}, $b_title2, '_summary->{title} is good' ); |
938 |
is( $labels->[0]->{_item_number}, $i_itemnumber2, '_item_number is good' ); |
940 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
939 |
is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' ); |
941 |
is( $labels->[0]->{_barcode}, $i_barcode2, '_barcode is good' ); |
|
|
942 |
is( $labels->[0]->{_item_number}, $i_itemnumber2, '_item_number is good' ); |
943 |
is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' ); |
940 |
|
944 |
|
941 |
#Mocking C4::Context->preference("item-level_itypes") |
945 |
#Mocking C4::Context->preference("item-level_itypes") |
942 |
{ |
946 |
{ |
Lines 963-974
is( $labels->[0]->{_label_id}, $c_label_id2, '_label_id is good' );
Link Here
|
963 |
my $itemtypes_pref = C4::Context->preference("item-level_itypes"); |
967 |
my $itemtypes_pref = C4::Context->preference("item-level_itypes"); |
964 |
my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; |
968 |
my $record_itemtype = $itemtypes_pref ? $i_itype1 : $bi_itemtype1; |
965 |
|
969 |
|
966 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
970 |
is( $labels->[0]->{_label_number}, 1, '_label_number is good' ); |
967 |
is( $labels->[0]->{_summary}, $summary1, '_summary is good' ); |
971 |
is( $labels->[0]->{_summary}->{author}, "Author 1", '_summary->{author} is good' ); |
968 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
972 |
is( $labels->[0]->{_summary}->{biblionumber}, $b_biblionumber1, '_summary->{biblionumber} is good' ); |
969 |
is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); |
973 |
is( $labels->[0]->{_summary}->{title}, "Title 1", '_summary->{title} is good' ); |
970 |
is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); |
974 |
is( $labels->[0]->{_item_type}, $record_itemtype, '_item_type is good' ); |
971 |
is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); |
975 |
is( $labels->[0]->{_barcode}, $i_barcode1, '_barcode is good' ); |
|
|
976 |
is( $labels->[0]->{_item_number}, $i_itemnumber1, '_item_number is good' ); |
977 |
is( $labels->[0]->{_label_id}, $c_label_id1, '_label_id is good' ); |
978 |
|
972 |
} |
979 |
} |
973 |
|
980 |
|
974 |
# ---------- Testing get_card_summary --------------------- |
981 |
# ---------- Testing get_card_summary --------------------- |
975 |
- |
|
|