Bugzilla – Attachment 96816 Details for
Bug 23015
Create a "GetPickupLocation" endpoint for the ILS-DI Service
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23015: Adding tests for GetPickupLocation method
Bug-23015-Adding-tests-for-GetPickupLocation-metho.patch (text/plain), 2.59 KB, created by
Arthur Suzuki
on 2020-01-04 20:26:12 UTC
(
hide
)
Description:
Bug 23015: Adding tests for GetPickupLocation method
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2020-01-04 20:26:12 UTC
Size:
2.59 KB
patch
obsolete
>From 39fb3c71a634f2ad66efe446d96857a8e3ec0e28 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Sat, 4 Jan 2020 21:17:15 +0100 >Subject: [PATCH] Bug 23015: Adding tests for GetPickupLocation method > >--- > t/db_dependent/ILSDI_Services.t | 61 ++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 60 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index b1288ec469..d42289abbb 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -544,6 +544,65 @@ subtest 'Holds test for branch transfer limits' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'GetPickupLocation test' => sub { >+ >+ plan tests => 5; >+ >+ $schema->storage->txn_begin; >+ >+ my $pickup_branch = $builder->build( >+ { >+ source => 'Branch', >+ value => { >+ pickup_location => 1, >+ } >+ } >+ ); >+ >+ my $biblio = $builder->build({ >+ source => 'Biblio', >+ }); >+ my $biblioitem = $builder->build({ >+ source => 'Biblioitem', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ } >+ }); >+ my $item = $builder->build({ >+ source => 'Item', >+ value => { >+ homebranch => $pickup_branch->{branchcode}, >+ holdingbranch => $pickup_branch->{branchcode}, >+ biblionumber => $biblio->{biblionumber}, >+ } >+ }); >+ >+ my $patron = $builder->build({ >+ source => 'Borrower', >+ }); >+ >+ my $query = new CGI; >+ >+ my $reply = C4::ILSDI::Services::GetPickupLocation( $query ); >+ is( $reply->{error}, 'PatronNotFound', "Patron not found" ); >+ >+ $query->param( 'patron_id', $patron->{borrowernumber}); >+ $reply = C4::ILSDI::Services::GetPickupLocation( $query ); >+ is( $reply->{error}, 'MissingParameter', 'Id type undefined' ); >+ >+ $query->param( 'id_type', 'bib'); >+ $query->param( 'id', '105799999' ); >+ $reply = C4::ILSDI::Services::GetPickupLocation( $query ); >+ is( $reply->{error}, 'RecordNotFound', 'Record not found' ); >+ >+ $query->param( 'id', $biblio->{biblionumber}); >+ $reply = C4::ILSDI::Services::GetPickupLocation( $query ); >+ is( $reply->{error}, undef, 'no error' ); >+ is( defined $reply->{library}, 1, 'got branchcode' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'GetRecords' => sub { > > plan tests => 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 23015
:
90195
|
93455
|
94039
|
96815
| 96816