Lines 24-30
use Koha::Items;
Link Here
|
24 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
25 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
26 |
|
26 |
|
27 |
use Test::More tests => 9; |
27 |
use Test::More tests => 10; |
28 |
use Test::MockModule; |
28 |
use Test::MockModule; |
29 |
|
29 |
|
30 |
BEGIN { |
30 |
BEGIN { |
Lines 71-90
my $patron = $builder->build(
Link Here
|
71 |
} |
71 |
} |
72 |
); |
72 |
); |
73 |
|
73 |
|
74 |
my $biblio = $builder->build( |
74 |
my $biblio = $builder->build_sample_biblio({branchcode => $branch->{branchcode}}); |
75 |
{ |
|
|
76 |
source => 'Biblio', |
77 |
value => { |
78 |
branchcode => $branch->{branchcode}, |
79 |
}, |
80 |
} |
81 |
); |
82 |
|
75 |
|
83 |
my $item = $builder->build_object( |
76 |
my $item = $builder->build_object( |
84 |
{ |
77 |
{ |
85 |
class => 'Koha::Items', |
78 |
class => 'Koha::Items', |
86 |
value => { |
79 |
value => { |
87 |
biblionumber => $biblio->{biblionumber}, |
80 |
biblionumber => $biblio->biblionumber, |
88 |
homebranch => $branch->{branchcode}, |
81 |
homebranch => $branch->{branchcode}, |
89 |
holdingbranch => $branch->{branchcode}, |
82 |
holdingbranch => $branch->{branchcode}, |
90 |
withdrawn => 0, # randomly assigned value may block return. |
83 |
withdrawn => 0, # randomly assigned value may block return. |
Lines 153-158
$item->set( { homebranch => $branch->{branchcode}, holdingbranch => $branch->{br
Link Here
|
153 |
|
146 |
|
154 |
} |
147 |
} |
155 |
|
148 |
|
|
|
149 |
{ # last_item_for_hold |
150 |
C4::Reserves::AddReserve($branch->{branchcode}, $patron->{borrowernumber}, $item->biblionumber ); |
151 |
is( $item->safe_to_delete, 'last_item_for_hold', 'Item cannot be deleted if a biblio-level is placed on the biblio and there is only 1 item attached to the biblio' ); |
152 |
|
153 |
# With another item attached to the biblio, the item can be deleted |
154 |
$builder->build_sample_item({ biblionumber => $item->biblionumber }); |
155 |
} |
156 |
|
156 |
is( |
157 |
is( |
157 |
$item->safe_to_delete, |
158 |
$item->safe_to_delete, |
158 |
1, |
159 |
1, |
159 |
- |
|
|