Bugzilla – Attachment 56830 Details for
Bug 16246
Return all reserves columns in ILS-DI GetRecords response
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16246: Add tests for ILS-DI GetRecords
Bug-16246-Add-tests-for-ILS-DI-GetRecords.patch (text/plain), 2.38 KB, created by
Julian Maurice
on 2016-10-25 07:53:43 UTC
(
hide
)
Description:
Bug 16246: Add tests for ILS-DI GetRecords
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2016-10-25 07:53:43 UTC
Size:
2.38 KB
patch
obsolete
>From 9fe2422c693810aeac39552b2b2cbe43516d8022 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 12 Apr 2016 13:54:13 +0200 >Subject: [PATCH] Bug 16246: Add tests for ILS-DI GetRecords > >--- > t/db_dependent/ILSDI_Services.t | 60 ++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 59 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 15806a6f..a34e9e5 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -17,9 +17,13 @@ > > use Modern::Perl; > >+use C4::Biblio qw( AddBiblio ); >+use C4::Items qw( AddItem ); >+use C4::Reserves qw( AddReserve GetReserve ); > use CGI qw ( -utf8 ); >+use MARC::Record; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use t::lib::Mocks; > use t::lib::TestBuilder; > >@@ -191,4 +195,58 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes > $schema->storage->txn_rollback; > }; > >+ >+subtest 'GetRecords' => sub { >+ >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference('ILS-DI', 1); >+ >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $branch = $builder->build({ >+ source => 'Branch', >+ value => { >+ branchcode => 'T_ILSDI', >+ } >+ }); >+ >+ my $category = $builder->build({ >+ source => 'Category', >+ value => { >+ category_type => 'A', >+ } >+ }); >+ >+ # Create a new user: >+ my $borrower = $builder->build({ >+ source => 'Borrower', >+ value => { >+ categorycode => $category->{categorycode}, >+ branchcode => $branch->{branchcode}, >+ } >+ }); >+ >+ my ($biblionumber) = AddBiblio(MARC::Record->new, ''); >+ my $item = {}; >+ my $itemnumber = AddItem($item, $biblionumber); >+ >+ my $reserve_id = AddReserve($branch, $borrower->{borrowernumber}, $biblionumber); >+ >+ # Prepare and send web request for IL-SDI server: >+ my $query = new CGI; >+ $query->param( 'service', 'GetRecords' ); >+ $query->param( 'id', $biblionumber ); >+ >+ my $response = C4::ILSDI::Services::GetRecords( $query ); >+ >+ my $reserve = GetReserve($reserve_id); >+ $reserve->{rtimestamp} = $reserve->{timestamp}; >+ >+ is_deeply( $response->{record}->[0]->{reserves}->{reserve}, [ $reserve ], >+ 'GetRecords /record/reserves/reserve is as expected' ); >+}; >+ > 1; >-- >2.1.4
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 16246
:
50143
|
50144
|
56829
|
56830
|
61032
|
61033
|
61329
|
61330