Bugzilla – Attachment 63168 Details for
Bug 18242
Move of checkouts to old_issues is not handled correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18242: 16.05 version - [SOLUTION 2]Add tests
Bug-18242-1605-version---SOLUTION-2Add-tests.patch (text/plain), 1.94 KB, created by
Jonathan Druart
on 2017-05-05 13:28:12 UTC
(
hide
)
Description:
Bug 18242: 16.05 version - [SOLUTION 2]Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-05-05 13:28:12 UTC
Size:
1.94 KB
patch
obsolete
>From 64a927d434bedcf7f91547401262fc6efd2ecead Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Mar 2017 16:41:31 -0300 >Subject: [PATCH] Bug 18242: 16.05 version - [SOLUTION 2]Add tests > >--- > t/db_dependent/Circulation/Returns.t | 32 +++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index bbc96a4750..ef95346d55 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -1,5 +1,6 @@ > use Modern::Perl; >-use Test::More tests => 2; >+ >+use Test::More tests => 3; > > use t::lib::Mocks; > use C4::Biblio; >@@ -8,6 +9,7 @@ use C4::Items; > use C4::Members; > use Koha::Database; > use Koha::DateUtils; >+use Koha::OldIssues; > > use t::lib::TestBuilder; > >@@ -56,3 +58,31 @@ is( $item->{location}, 'TEST', "InProcessingToShelvingCart functions as intended > sub Mock_userenv { > return { branch => $library->{branchcode} }; > } >+ >+subtest 'Handle ids duplication' => sub { >+ plan tests => 1; >+ >+ my $biblio = $builder->build( { source => 'Biblio' } ); >+ my $item = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ notforloan => 0, >+ itemlost => 0, >+ withdrawn => 0, >+ >+ } >+ } >+ ); >+ my $patron = $builder->build({source => 'Borrower'}); >+ >+ my $checkout = AddIssue( $patron, $item->{barcode} ); >+ $builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } }); >+ >+ my @a = AddReturn( $item->{barcode} ); >+ my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id ); >+ isnt( $old_checkout->itemnumber, $item->{itemnumber}, 'If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table' ); >+}; >+ >+1; >-- >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 18242
:
60969
|
60970
|
60971
|
60972
|
60973
|
61056
|
61057
|
61254
|
61255
|
61794
| 63168 |
63169
|
63170