Lines 16-24
Link Here
|
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use Test::More tests => 5; |
19 |
use Test::More tests => 8; |
20 |
|
20 |
|
21 |
use C4::Items; |
21 |
use C4::Items; |
|
|
22 |
use C4::Reserves; |
22 |
|
23 |
|
23 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
24 |
|
25 |
|
Lines 43-48
my $item3 = $builder->build(
Link Here
|
43 |
} |
44 |
} |
44 |
); |
45 |
); |
45 |
|
46 |
|
|
|
47 |
my $bib_level_hold_not_to_move = $builder->build( |
48 |
{ source => 'Reserve', |
49 |
value => { biblionumber => $from_biblio->{biblionumber}, }, |
50 |
} |
51 |
); |
52 |
my $item_level_hold_not_to_move = $builder->build( |
53 |
{ source => 'Reserve', |
54 |
value => { biblionumber => $from_biblio->{biblionumber}, itemnumber => $item1->{itemnumber} }, |
55 |
} |
56 |
); |
57 |
my $item_level_hold_to_move = $builder->build( |
58 |
{ source => 'Reserve', |
59 |
value => { biblionumber => $from_biblio->{biblionumber}, itemnumber => $item2->{itemnumber} }, |
60 |
} |
61 |
); |
62 |
|
46 |
my $to_biblionumber_after_moved = C4::Items::MoveItemFromBiblio( $item2->{itemnumber}, $from_biblio->{biblionumber}, $to_biblio->{biblionumber} ); |
63 |
my $to_biblionumber_after_moved = C4::Items::MoveItemFromBiblio( $item2->{itemnumber}, $from_biblio->{biblionumber}, $to_biblio->{biblionumber} ); |
47 |
|
64 |
|
48 |
is( $to_biblionumber_after_moved, $to_biblio->{biblionumber}, 'MoveItemFromBiblio should return the to_biblionumber if success' ); |
65 |
is( $to_biblionumber_after_moved, $to_biblio->{biblionumber}, 'MoveItemFromBiblio should return the to_biblionumber if success' ); |
Lines 57-59
my $get_item2 = C4::Items::GetItem( $item2->{itemnumber} );
Link Here
|
57 |
is( $get_item2->{biblionumber}, $to_biblio->{biblionumber}, 'The item2 should have been moved' ); |
74 |
is( $get_item2->{biblionumber}, $to_biblio->{biblionumber}, 'The item2 should have been moved' ); |
58 |
my $get_item3 = C4::Items::GetItem( $item3->{itemnumber} ); |
75 |
my $get_item3 = C4::Items::GetItem( $item3->{itemnumber} ); |
59 |
is( $get_item3->{biblionumber}, $to_biblio->{biblionumber}, 'The item3 should not have been moved' ); |
76 |
is( $get_item3->{biblionumber}, $to_biblio->{biblionumber}, 'The item3 should not have been moved' ); |
60 |
- |
77 |
|
|
|
78 |
my $get_bib_level_hold = C4::Reserves::GetReserve( $bib_level_hold_not_to_move->{reserve_id} ); |
79 |
my $get_item_level_hold_1 = C4::Reserves::GetReserve( $item_level_hold_not_to_move->{reserve_id} ); |
80 |
my $get_item_level_hold_2 = C4::Reserves::GetReserve( $item_level_hold_to_move->{reserve_id} ); |
81 |
|
82 |
is( $get_bib_level_hold->{biblionumber}, $from_biblio->{biblionumber}, 'MoveItemFromBiblio should not have moved the biblio-level hold' ); |
83 |
is( $get_item_level_hold_1->{biblionumber}, $from_biblio->{biblionumber}, 'MoveItemFromBiblio should not have moved the item-level hold placed on item 1' ); |
84 |
is( $get_item_level_hold_2->{biblionumber}, $to_biblio->{biblionumber}, 'MoveItemFromBiblio should have moved the item-level hold placed on item 2' ); |