Lines 811-817
subtest 'store' => sub {
Link Here
|
811 |
}; |
811 |
}; |
812 |
|
812 |
|
813 |
subtest 'get_transfer' => sub { |
813 |
subtest 'get_transfer' => sub { |
814 |
plan tests => 6; |
814 |
plan tests => 7; |
815 |
|
815 |
|
816 |
my $transfer = $new_item_1->get_transfer(); |
816 |
my $transfer = $new_item_1->get_transfer(); |
817 |
is( $transfer, undef, 'Koha::Item->get_transfer should return undef if the item is not in transit' ); |
817 |
is( $transfer, undef, 'Koha::Item->get_transfer should return undef if the item is not in transit' ); |
Lines 828-833
subtest 'get_transfer' => sub {
Link Here
|
828 |
reason => 'Manual', |
828 |
reason => 'Manual', |
829 |
datesent => undef, |
829 |
datesent => undef, |
830 |
datearrived => undef, |
830 |
datearrived => undef, |
|
|
831 |
datecancelled => undef, |
831 |
daterequested => \'NOW()' |
832 |
daterequested => \'NOW()' |
832 |
} |
833 |
} |
833 |
} |
834 |
} |
Lines 840-851
subtest 'get_transfer' => sub {
Link Here
|
840 |
{ |
841 |
{ |
841 |
class => 'Koha::Item::Transfers', |
842 |
class => 'Koha::Item::Transfers', |
842 |
value => { |
843 |
value => { |
843 |
itemnumber => $new_item_1->itemnumber, |
844 |
itemnumber => $new_item_1->itemnumber, |
844 |
frombranch => $new_item_1->holdingbranch, |
845 |
frombranch => $new_item_1->holdingbranch, |
845 |
tobranch => $library_to->{branchcode}, |
846 |
tobranch => $library_to->{branchcode}, |
846 |
reason => 'Manual', |
847 |
reason => 'Manual', |
847 |
datesent => undef, |
848 |
datesent => undef, |
848 |
datearrived => undef, |
849 |
datearrived => undef, |
|
|
850 |
datecancelled => undef, |
849 |
daterequested => \'NOW()' |
851 |
daterequested => \'NOW()' |
850 |
} |
852 |
} |
851 |
} |
853 |
} |
Lines 862-873
subtest 'get_transfer' => sub {
Link Here
|
862 |
{ |
864 |
{ |
863 |
class => 'Koha::Item::Transfers', |
865 |
class => 'Koha::Item::Transfers', |
864 |
value => { |
866 |
value => { |
865 |
itemnumber => $new_item_1->itemnumber, |
867 |
itemnumber => $new_item_1->itemnumber, |
866 |
frombranch => $new_item_1->holdingbranch, |
868 |
frombranch => $new_item_1->holdingbranch, |
867 |
tobranch => $library_to->{branchcode}, |
869 |
tobranch => $library_to->{branchcode}, |
868 |
reason => 'Manual', |
870 |
reason => 'Manual', |
869 |
datesent => undef, |
871 |
datesent => undef, |
870 |
datearrived => undef, |
872 |
datearrived => undef, |
|
|
873 |
datecancelled => undef, |
871 |
daterequested => \'NOW()' |
874 |
daterequested => \'NOW()' |
872 |
} |
875 |
} |
873 |
} |
876 |
} |
Lines 877-882
subtest 'get_transfer' => sub {
Link Here
|
877 |
$transfer = $new_item_1->get_transfer(); |
880 |
$transfer = $new_item_1->get_transfer(); |
878 |
is( $transfer->branchtransfer_id, $transfer_1->branchtransfer_id, 'Koha::Item->get_transfer returns the next queued transfer'); |
881 |
is( $transfer->branchtransfer_id, $transfer_1->branchtransfer_id, 'Koha::Item->get_transfer returns the next queued transfer'); |
879 |
is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer returns the right items transfer' ); |
882 |
is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer returns the right items transfer' ); |
|
|
883 |
|
884 |
$transfer_1->datecancelled(\'NOW()')->store; |
885 |
$transfer = $new_item_1->get_transfer(); |
886 |
is( $transfer->branchtransfer_id, $transfer_3->branchtransfer_id, 'Koha::Item->get_transfer ignores cancelled transfers'); |
880 |
}; |
887 |
}; |
881 |
|
888 |
|
882 |
subtest 'holds' => sub { |
889 |
subtest 'holds' => sub { |
883 |
- |
|
|