Lines 19-25
use Modern::Perl;
Link Here
|
19 |
use Data::Dumper; |
19 |
use Data::Dumper; |
20 |
|
20 |
|
21 |
use MARC::Record; |
21 |
use MARC::Record; |
22 |
use C4::Items qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen CartToShelf ); |
22 |
use C4::Items |
|
|
23 |
qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen CartToShelf ); |
23 |
use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); |
24 |
use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); |
24 |
use C4::Circulation qw( AddIssue ); |
25 |
use C4::Circulation qw( AddIssue ); |
25 |
use Koha::BackgroundJobs; |
26 |
use Koha::BackgroundJobs; |
Lines 978-984
subtest 'CartToShelf test' => sub {
Link Here
|
978 |
plan tests => 2; |
979 |
plan tests => 2; |
979 |
|
980 |
|
980 |
$schema->storage->txn_begin; |
981 |
$schema->storage->txn_begin; |
981 |
my $dbh = C4::Context->dbh; |
982 |
my $dbh = C4::Context->dbh; |
982 |
my $builder = t::lib::TestBuilder->new; |
983 |
my $builder = t::lib::TestBuilder->new; |
983 |
|
984 |
|
984 |
my $item = $builder->build_sample_item(); |
985 |
my $item = $builder->build_sample_item(); |
Lines 989-1005
subtest 'CartToShelf test' => sub {
Link Here
|
989 |
|
990 |
|
990 |
$item->discard_changes; |
991 |
$item->discard_changes; |
991 |
|
992 |
|
992 |
is( $item->location, 'BANANA', 'Item is correctly returned to permanent location'); |
993 |
is( $item->location, 'BANANA', 'Item is correctly returned to permanent location' ); |
993 |
|
|
|
994 |
|
994 |
|
995 |
my $mock_RTHQ = Test::MockModule->new("Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue"); |
995 |
my $mock_RTHQ = Test::MockModule->new("Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue"); |
996 |
$mock_RTHQ->mock( enqueue => sub { warn "RTHQ" } ); |
996 |
$mock_RTHQ->mock( enqueue => sub { warn "RTHQ" } ); |
997 |
t::lib::Mocks::mock_preference('RealTimeHoldsQueue', '1'); |
997 |
t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', '1' ); |
998 |
|
998 |
|
999 |
$item->location('CART')->store({ skip_holds_queue => 1 }); |
999 |
$item->location('CART')->store( { skip_holds_queue => 1 } ); |
1000 |
warnings_are{ |
1000 |
warnings_are { |
1001 |
CartToShelf( $item->id ); |
1001 |
CartToShelf( $item->id ); |
1002 |
} [], 'No RTHQ update triggered by CartToShelf'; |
1002 |
} |
|
|
1003 |
[], 'No RTHQ update triggered by CartToShelf'; |
1003 |
|
1004 |
|
1004 |
$schema->storage->txn_rollback; |
1005 |
$schema->storage->txn_rollback; |
1005 |
|
1006 |
|
1006 |
- |
|
|