|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 9; |
22 |
use Test::More tests => 10; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
|
24 |
|
| 25 |
use C4::Circulation; |
25 |
use C4::Circulation; |
|
Lines 34-40
use t::lib::Mocks;
Link Here
|
| 34 |
my $schema = Koha::Database->new->schema; |
34 |
my $schema = Koha::Database->new->schema; |
| 35 |
$schema->storage->txn_begin; |
35 |
$schema->storage->txn_begin; |
| 36 |
|
36 |
|
| 37 |
my $builder = t::lib::TestBuilder->new; |
37 |
our $builder = t::lib::TestBuilder->new; |
| 38 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
38 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
| 39 |
my $library = $builder->build( { source => 'Branch' } ); |
39 |
my $library = $builder->build( { source => 'Branch' } ); |
| 40 |
my $nb_of_items = Koha::Items->search->count; |
40 |
my $nb_of_items = Koha::Items->search->count; |
|
Lines 164-168
subtest 'can_be_transferred' => sub {
Link Here
|
| 164 |
$retrieved_item_1->delete; |
164 |
$retrieved_item_1->delete; |
| 165 |
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' ); |
165 |
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' ); |
| 166 |
|
166 |
|
|
|
167 |
subtest 'is_waiting_or_transit' => sub { |
| 168 |
plan tests => 3; |
| 169 |
|
| 170 |
my $hold = $builder->build_object({ class => 'Koha::Holds', value => { found => 'W' } }); |
| 171 |
is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 1, |
| 172 |
'Item is waiting' ); |
| 173 |
$hold->found('T')->store; |
| 174 |
is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 1, |
| 175 |
'Item has transit hold' ); |
| 176 |
$hold->found(undef)->store; |
| 177 |
is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, q{}, |
| 178 |
'Item should be available' ); |
| 179 |
}; |
| 180 |
|
| 167 |
$schema->storage->txn_rollback; |
181 |
$schema->storage->txn_rollback; |
| 168 |
|
182 |
|
| 169 |
- |
|
|