Bugzilla – Attachment 92131 Details for
Bug 16284
With CheckPrevCheckout used, check only the item for previous checkout if biblio is serial
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16284: Add test
Bug-16284-Add-test.patch (text/plain), 2.69 KB, created by
Katrin Fischer
on 2019-08-10 12:38:42 UTC
(
hide
)
Description:
Bug 16284: Add test
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-08-10 12:38:42 UTC
Size:
2.69 KB
patch
obsolete
>From c3016a13d479a3c73a607c77b04e8ac9ec47f964 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 16 Apr 2019 10:59:43 +0000 >Subject: [PATCH] Bug 16284: Add test > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Patron/Borrower_PrevCheckout.t | 39 ++++++++++++++++++++++++--- > 1 file changed, 36 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Patron/Borrower_PrevCheckout.t b/t/db_dependent/Patron/Borrower_PrevCheckout.t >index dc53e65b46..d2af210db7 100644 >--- a/t/db_dependent/Patron/Borrower_PrevCheckout.t >+++ b/t/db_dependent/Patron/Borrower_PrevCheckout.t >@@ -6,7 +6,7 @@ use C4::Circulation; > use Koha::Database; > use Koha::Patrons; > >-use Test::More tests => 59; >+use Test::More tests => 60; > > use_ok('Koha::Patron'); > >@@ -234,10 +234,16 @@ map { > # $patron, $different_patron, $items (same bib number), $different_item > my $patron = $builder->build({source => 'Borrower'}); > my $patron_d = $builder->build({source => 'Borrower'}); >-my $item_1 = $builder->build({source => 'Item'}); >+ >+my $biblio = $builder->build_sample_biblio; >+$biblio->serial(0)->store; >+my $item_1 = $builder->build({ >+ source => 'Item', >+ value => { biblionumber => $biblio->biblionumber } >+}); > my $item_2 = $builder->build({ > source => 'Item', >- value => { biblionumber => $item_1->{biblionumber} }, >+ value => { biblionumber => $biblio->biblionumber }, > }); > my $item_d = $builder->build({source => 'Item'}); > >@@ -440,3 +446,30 @@ map { > > $schema->storage->txn_rollback; > >+subtest 'Check previous checkouts for serial' => sub { >+ plan tests => 2; >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object({ class => 'Koha::Libraries'}); >+ >+ my $patron = $builder->build_object({ >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode >+ } >+ }); >+ t::lib::Mocks::mock_userenv({ patron => $patron }); >+ >+ my $biblio = $builder->build_sample_biblio; >+ $biblio->serial(1)->store; >+ >+ my $item1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ my $item2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ >+ AddIssue($patron->unblessed, $item1->barcode); >+ >+ is($patron->do_check_for_previous_checkout($item1->unblessed), 1, 'Check only one item if bibliographic record is serial'); >+ is($patron->do_check_for_previous_checkout($item2->unblessed), 0, 'Check only one item if bibliographic record is serial'); >+ >+ $schema->storage->txn_rollback; >+} >-- >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 16284
:
88050
|
88051
|
88236
|
88237
|
88258
|
88259
|
90642
|
90643
|
90644
|
90645
|
90646
|
90647
|
90648
|
90649
|
92130
| 92131 |
92132
|
92133