Bugzilla – Attachment 97976 Details for
Bug 23070
Use Koha::Hold in C4::Reserves::RevertWaitingStatus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23070: Add tests
Bug-23070-Add-tests.patch (text/plain), 2.45 KB, created by
Jonathan Druart
on 2020-01-27 13:56:21 UTC
(
hide
)
Description:
Bug 23070: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-27 13:56:21 UTC
Size:
2.45 KB
patch
obsolete
>From 20d634b71153c1402b8bb19330a9937ed4ef2f9a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 27 Jan 2020 14:53:23 +0100 >Subject: [PATCH] Bug 23070: Add tests > >--- > t/db_dependent/Reserves.t | 44 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 43 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 618f0598c9..dc789fe676 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 62; >+use Test::More tests => 63; > use Test::MockModule; > use Test::Warn; > >@@ -875,6 +875,48 @@ subtest 'MoveReserve additional test' => sub { > > }; > >+subtest 'RevertWaitingStatus' => sub { >+ >+ plan tests => 2; >+ >+ # Create the items and patrons we need >+ my $biblio = $builder->build_sample_biblio(); >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $itype = $builder->build_object( >+ { class => "Koha::ItemTypes", value => { notforloan => 0 } } ); >+ my $item_1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ itype => $itype->itemtype, >+ library => $library->branchcode >+ } >+ ); >+ my $patron_1 = $builder->build_object( { class => "Koha::Patrons" } ); >+ my $patron_2 = $builder->build_object( { class => "Koha::Patrons" } ); >+ my $patron_3 = $builder->build_object( { class => "Koha::Patrons" } ); >+ my $patron_4 = $builder->build_object( { class => "Koha::Patrons" } ); >+ >+ # Place a hold on the title for both patrons >+ my $hold_1 = place_item_hold( $patron_1, $item_1, $library, $priority ); >+ my $hold_2 = place_item_hold( $patron_2, $item_1, $library, $priority ); >+ my $hold_3 = place_item_hold( $patron_3, $item_1, $library, $priority ); >+ my $hold_4 = place_item_hold( $patron_4, $item_1, $library, $priority ); >+ >+ $hold_1->set_waiting; >+ AddIssue( $patron_3->unblessed, $item_1->barcode, undef, 'revert' ); >+ >+ my $holds = $biblio->holds; >+ is( $holds->count, 3, 'One hold has been deleted' ); >+ is_deeply( >+ [ >+ $holds->next->priority, $holds->next->priority, >+ $holds->next->priority >+ ], >+ [ 1, 2, 3 ], >+ 'priorities have been reordered' >+ ); >+}; >+ > sub count_hold_print_messages { > my $message_count = $dbh->selectall_arrayref(q{ > SELECT COUNT(*) >-- >2.11.0
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 23070
:
90400
|
97976
|
97977
|
99168
|
99169
|
99170
|
103907
|
103908
|
103909
|
103910
|
104253
|
104261
|
104262
|
104263
|
104264
|
106556
|
106557
|
106558
|
106559