|
Lines 5-11
Link Here
|
| 5 |
|
5 |
|
| 6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
| 7 |
use Test::NoWarnings; |
7 |
use Test::NoWarnings; |
| 8 |
use Test::More tests => 22; |
8 |
use Test::More tests => 23; |
| 9 |
use Test::Warn; |
9 |
use Test::Warn; |
| 10 |
|
10 |
|
| 11 |
use DateTime; |
11 |
use DateTime; |
|
Lines 1643-1646
subtest 'Checkin message' => sub {
Link Here
|
| 1643 |
is( $circ->{screen_msg}, '', "Checked out item was checked out to the next patron" ); |
1643 |
is( $circ->{screen_msg}, '', "Checked out item was checked out to the next patron" ); |
| 1644 |
}; |
1644 |
}; |
| 1645 |
|
1645 |
|
|
|
1646 |
subtest 'magnetic_media flag from item type' => sub { |
| 1647 |
plan tests => 4; |
| 1648 |
|
| 1649 |
# Create an item type with magnetic = 1 |
| 1650 |
my $itemtype_magnetic = $builder->build_object( |
| 1651 |
{ |
| 1652 |
class => 'Koha::ItemTypes', |
| 1653 |
value => { |
| 1654 |
itemtype => 'MAGNETIC', |
| 1655 |
description => 'Magnetic Test Item Type', |
| 1656 |
sip_magnetic => 1, |
| 1657 |
} |
| 1658 |
} |
| 1659 |
); |
| 1660 |
|
| 1661 |
# Create an item type with magnetic = 0 |
| 1662 |
my $itemtype_non_magnetic = $builder->build_object( |
| 1663 |
{ |
| 1664 |
class => 'Koha::ItemTypes', |
| 1665 |
value => { |
| 1666 |
itemtype => 'NONMAG', |
| 1667 |
description => 'Non-Magnetic Test Item Type', |
| 1668 |
sip_magnetic => 0, |
| 1669 |
} |
| 1670 |
} |
| 1671 |
); |
| 1672 |
|
| 1673 |
# Create items with these types |
| 1674 |
my $item_magnetic = $builder->build_sample_item( |
| 1675 |
{ |
| 1676 |
itype => $itemtype_magnetic->itemtype, |
| 1677 |
} |
| 1678 |
); |
| 1679 |
|
| 1680 |
my $item_non_magnetic = $builder->build_sample_item( |
| 1681 |
{ |
| 1682 |
itype => $itemtype_non_magnetic->itemtype, |
| 1683 |
} |
| 1684 |
); |
| 1685 |
|
| 1686 |
# Test magnetic item |
| 1687 |
my $sip_item_magnetic = C4::SIP::ILS::Item->new( $item_magnetic->barcode ); |
| 1688 |
ok( defined $sip_item_magnetic, 'SIP Item object created for magnetic item' ); |
| 1689 |
is( $sip_item_magnetic->magnetic_media, 1, 'magnetic_media is 1 for magnetic item type' ); |
| 1690 |
|
| 1691 |
# Test non-magnetic item |
| 1692 |
my $sip_item_non_magnetic = C4::SIP::ILS::Item->new( $item_non_magnetic->barcode ); |
| 1693 |
ok( defined $sip_item_non_magnetic, 'SIP Item object created for non-magnetic item' ); |
| 1694 |
is( $sip_item_non_magnetic->magnetic_media, 0, 'magnetic_media is 0 for non-magnetic item type' ); |
| 1695 |
}; |
| 1696 |
|
| 1646 |
$schema->storage->txn_rollback; |
1697 |
$schema->storage->txn_rollback; |
| 1647 |
- |
|
|