Bugzilla – Attachment 155011 Details for
Bug 34656
CartToShelf should not trigger RealTimeHoldsQueue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34656: Unit test
Bug-34656-Unit-test.patch (text/plain), 2.35 KB, created by
Emily Lamancusa (emlam)
on 2023-08-31 14:46:29 UTC
(
hide
)
Description:
Bug 34656: Unit test
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2023-08-31 14:46:29 UTC
Size:
2.35 KB
patch
obsolete
>From b7e6bccc9bfc914329e386c1c023b056c46e5420 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 30 Aug 2023 13:46:17 +0000 >Subject: [PATCH] Bug 34656: Unit test > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > t/db_dependent/Items.t | 36 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 34 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 8dec62ca20..be63a071b8 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -19,9 +19,10 @@ use Modern::Perl; > use Data::Dumper; > > use MARC::Record; >-use C4::Items qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen ); >+use C4::Items qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen CartToShelf ); > use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); > use C4::Circulation qw( AddIssue ); >+use Koha::BackgroundJobs; > use Koha::Items; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); >@@ -34,7 +35,7 @@ use Koha::AuthorisedValues; > use t::lib::Mocks; > use t::lib::TestBuilder; > >-use Test::More tests => 12; >+use Test::More tests => 13; > > use Test::Warn; > >@@ -972,3 +973,34 @@ subtest 'ModDateLastSeen' => sub { > is( $item->itemlost, 0, "Item no longer lost when no parameter is passed"); > is( $logs_after, $logs_before + 1, "ModDateLastSeen logs if item was lost and now found"); > }; >+ >+subtest 'CartToShelf test' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ my $dbh = C4::Context->dbh; >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $item = $builder->build_sample_item(); >+ >+ $item->permanent_location('BANANA')->location('CART')->store(); >+ >+ CartToShelf( $item->id ); >+ >+ $item->discard_changes; >+ >+ is( $item->location, 'BANANA', 'Item is correctly returned to permanent location'); >+ >+ >+ my $mock_RTHQ = Test::MockModule->new("Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue"); >+ $mock_RTHQ->mock( enqueue => sub { warn "RTHQ" } ); >+ t::lib::Mocks::mock_preference('RealTimeHoldsQueue', '1'); >+ >+ $item->location('CART')->store({ skip_holds_queue => 1 }); >+ warnings_are{ >+ CartToShelf( $item->id ); >+ } [], 'No RTHQ update triggered by CartToShelf'; >+ >+ $schema->storage->txn_rollback; >+ >+}; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34656
:
154957
|
154958
|
155011
|
155012
|
155013
|
155207
|
155208
|
155209