Bugzilla – Attachment 93494 Details for
Bug 20816
Add ability to send custom field(s) containing patron information in SIP patron responses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20816: Make SIP tests pass under ES
Bug-20816-Make-SIP-tests-pass-under-ES.patch (text/plain), 5.20 KB, created by
Nick Clemens (kidclamp)
on 2019-10-02 14:54:37 UTC
(
hide
)
Description:
Bug 20816: Make SIP tests pass under ES
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-10-02 14:54:37 UTC
Size:
5.20 KB
patch
obsolete
>From ab2d88290b7bc16276787f203cd390453c018300 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Wed, 2 Oct 2019 14:53:42 +0000 >Subject: [PATCH] Bug 20816: Make SIP tests pass under ES > >--- > t/db_dependent/SIP/Message.t | 17 ++++++++++------- > t/db_dependent/SIP/Transaction.t | 21 ++++++++------------- > 2 files changed, 18 insertions(+), 20 deletions(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 2cdeba73d6..4ff440c0d2 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -317,11 +317,14 @@ sub test_checkin_v2 { > my $card1 = $patron1->{cardnumber}; > my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); > $findpatron = $sip_patron1; >- my $item = $builder->build({ >- source => 'Item', >- value => { damaged => 0, withdrawn => 0, itemlost => 0, restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode }, >+ my $item_object = $builder->build_sample_item({ >+ damaged => 0, >+ withdrawn => 0, >+ itemlost => 0, >+ restricted => 0, >+ homebranch => $branchcode, >+ holdingbranch => $branchcode, > }); >- my $item_object = Koha::Items->find( $item->{itemnumber} ); > > my $mockILS = $mocks->{ils}; > my $server = { ils => $mockILS, account => {} }; >@@ -355,7 +358,7 @@ sub test_checkin_v2 { > $siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . > siprequestdate( $today->clone->add( days => 1) ) . > FID_INST_ID . $branchcode . '|'. >- FID_ITEM_ID . $item->{barcode} . '|' . >+ FID_ITEM_ID . $item_object->barcode . '|' . > FID_TERMINAL_PWD . 'ignored' . '|'; > undef $response; > $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >@@ -434,7 +437,7 @@ sub test_checkin_v2 { > $server->{account}->{ct_always_send} = 0; > > # Checkin at wrong branch: issue item and switch branch, and checkin >- my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item->{itemnumber} })->store; >+ my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item_object->itemnumber })->store; > $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; > t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'homebranch' ); > undef $response; >@@ -443,7 +446,7 @@ sub test_checkin_v2 { > is( substr($response,2,1), '0', 'OK flag is false when we check in at the wrong branch and we do not allow it' ); > is( substr($response,5,1), 'Y', 'Alert flag is set' ); > check_field( $respcode, $response, FID_SCREEN_MSG, 'Checkin failed', 'Check screen msg' ); >- $branchcode = $item->{homebranch}; # switch back >+ $branchcode = $item_object->homebranch; # switch back > t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); > > # Data corrupted: add same issue_id to old_issues >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index c630fadfde..fcd3c32778 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -45,25 +45,20 @@ subtest fill_holds_at_checkout => sub { > t::lib::Mocks::mock_userenv({ branchcode => $branch->{branchcode}, flags => 1 }); > > my $itype = $builder->build({ source => 'Itemtype', value =>{notforloan=>0} }); >- my $biblio = $builder->build({ source => 'Biblio' }); >- my $biblioitem = $builder->build({ source => 'Biblioitem', value=>{biblionumber=>$biblio->{biblionumber}} }); >- my $item1 = $builder->build({ source => 'Item', value => { >+ my $item1 = $builder->build_sample_item({ > barcode => 'barcode4test', > homebranch => $branch->{branchcode}, > holdingbranch => $branch->{branchcode}, >- biblionumber => $biblio->{biblionumber}, > itype => $itype->{itemtype}, > notforloan => 0, >- } >- }); >- my $item2 = $builder->build({ source => 'Item', value => { >+ })->unblessed; >+ my $item2 = $builder->build_sample_item({ > homebranch => $branch->{branchcode}, > holdingbranch => $branch->{branchcode}, >- biblionumber => $biblio->{biblionumber}, >+ biblionumber => $item1->{biblionumber}, > itype => $itype->{itemtype}, > notforloan => 0, >- } >- }); >+ })->unblessed; > > Koha::IssuingRule->new({ > categorycode => $borrower->{categorycode}, >@@ -76,9 +71,9 @@ subtest fill_holds_at_checkout => sub { > lengthunit => 'days', > })->store; > >- my $reserve1 = AddReserve($branch->{branchcode},$borrower->{borrowernumber},$biblio->{biblionumber}); >- my $reserve2 = AddReserve($branch->{branchcode},$borrower->{borrowernumber},$biblio->{biblionumber}); >- my $bib = Koha::Biblios->find( $biblio->{biblionumber} ); >+ my $reserve1 = AddReserve($branch->{branchcode},$borrower->{borrowernumber},$item1->{biblionumber}); >+ my $reserve2 = AddReserve($branch->{branchcode},$borrower->{borrowernumber},$item1->{biblionumber}); >+ my $bib = Koha::Biblios->find( $item1->{biblionumber} ); > is( $bib->holds->count(), 2, "Bib has 2 holds"); > > my $sip_patron = C4::SIP::ILS::Patron->new( $borrower->{cardnumber} ); >-- >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 20816
:
90813
|
93493
|
93494
|
96811
|
96812
|
102447
|
102469
|
102470
|
103385
|
103386
|
104622