Bugzilla – Attachment 147190 Details for
Bug 31051
Show patron's 'savings' on the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31051: Generate items correctly in test
Bug-31051-Generate-items-correctly-in-test.patch (text/plain), 1.86 KB, created by
Jonathan Druart
on 2023-02-23 08:21:59 UTC
(
hide
)
Description:
Bug 31051: Generate items correctly in test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-23 08:21:59 UTC
Size:
1.86 KB
patch
obsolete
>From 77f93725f775fe4d273ac47aebeaacc83a8e71c4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Feb 2023 09:20:25 +0100 >Subject: [PATCH] Bug 31051: Generate items correctly in test > >There was a misplaced bracket in build_object. >To generate item you should need build_sample_item anyway. >--- > t/db_dependent/Koha/Patron.t | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index c25b8c49b65..eee0ec9527e 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -1362,9 +1362,21 @@ subtest 'get_savings tests' => sub { > > t::lib::Mocks::mock_userenv({ patron => $patron, branchcode => $library->branchcode }); > >- my $biblio1 = $builder->build_object({ class => 'Koha::Biblios' }); >- my $item1 = $builder->build_object({ class => 'Koha::Items' }, { value => { biblionumber => $biblio1->biblionumber, replacementprice => '5.00', holdingbranch => $library->branchcode, homebranch => $library->branchcode } }); >- my $item2 = $builder->build_object({ class => 'Koha::Items' }, { value => { biblionumber => $biblio1->biblionumber, replacementprice => '5.00', holdingbranch => $library->branchcode, homebranch => $library->branchcode } }); >+ my $biblio = $builder->build_sample_biblio; >+ my $item1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ replacementprice => rand(20), >+ } >+ ); >+ my $item2 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ replacementprice => rand(20), >+ } >+ ); > > is( $patron->get_savings, 0, 'No checkouts, no savings' ); > >-- >2.25.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 31051
:
136564
|
136664
|
136698
|
136699
|
136770
|
136772
|
136773
|
136779
|
136781
|
139100
|
139101
|
139102
|
139408
|
139409
|
139410
|
139911
|
139912
|
139913
|
139914
|
139937
|
143384
|
144082
|
144759
|
144760
|
144761
|
144762
|
144763
|
146431
|
146432
|
147189
| 147190