Bugzilla – Attachment 151524 Details for
Bug 33791
$hold->fill does not set itemnumber when checking out without confirming hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33791: Add unit test
Bug-33791-Add-unit-test.patch (text/plain), 1.77 KB, created by
Martin Renvoize (ashimema)
on 2023-05-22 13:15:45 UTC
(
hide
)
Description:
Bug 33791: Add unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-05-22 13:15:45 UTC
Size:
1.77 KB
patch
obsolete
>From 57dc745fd2f139f2879d4385928f68ab6e9d6db2 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 22 May 2023 11:35:46 +0000 >Subject: [PATCH] Bug 33791: Add unit test > >Test plan: >Run t/db_dependent/Koha/Hold.t >NOTE: This test should fail without following patch, but pass with it. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Hold.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index e0c4bae997..58f3fc45eb 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -69,7 +69,7 @@ subtest 'store() tests' => sub { > > subtest 'fill() tests' => sub { > >- plan tests => 13; >+ plan tests => 14; > > $schema->storage->txn_begin; > >@@ -124,6 +124,18 @@ subtest 'fill() tests' => sub { > is( $old_hold->priority, 0, 'priority set to 0' ); > is( $old_hold->found, 'F', 'found set to F' ); > >+ subtest 'itemnumber parameter' => sub { >+ plan tests => 1; >+ $category->reservefee(0)->store; # do not disturb later accounts >+ $hold = $builder->build_object({ class => 'Koha::Holds', value => { biblionumber => $biblio->id, borrowernumber => $patron->id, itemnumber => undef, priority => 1 } }); >+ # Simulating checkout without confirming hold >+ $hold->fill({ itemnumber => $item->id }); >+ $old_hold = Koha::Old::Holds->find($hold->id); >+ is( $old_hold->itemnumber, $item->itemnumber, 'The itemnumber has been saved in old_reserves by fill' ); >+ $old_hold->delete; >+ $category->reservefee($fee)->store; # restore >+ }; >+ > subtest 'fee applied tests' => sub { > > plan tests => 9; >-- >2.40.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 33791
:
151507
|
151508
|
151509
|
151524
|
151525
|
151526
|
151527
|
151539