Bugzilla – Attachment 97958 Details for
Bug 12469
Add more information to the ILS-DI results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12469: Added Unit tests for GetAvailability
Bug-12469-Added-Unit-tests-for-GetAvailability.patch (text/plain), 2.02 KB, created by
Arthur Suzuki
on 2020-01-27 02:55:09 UTC
(
hide
)
Description:
Bug 12469: Added Unit tests for GetAvailability
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2020-01-27 02:55:09 UTC
Size:
2.02 KB
patch
obsolete
>From ce0b3deb929d4a9377b87af1f2883c822261101d Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Mon, 27 Jan 2020 03:43:51 +0100 >Subject: [PATCH] Bug 12469: Added Unit tests for GetAvailability > >--- > t/db_dependent/ILSDI_Services.t | 32 +++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 430d900c77..9d6ea6bb06 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -18,8 +18,9 @@ > use Modern::Perl; > > use CGI qw ( -utf8 ); >+use XML::LibXML; > >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -684,3 +685,32 @@ subtest 'GetPatronInfo paginated loans' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'GetAvailability tests' => sub { >+ plan tests => 5; >+ >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object({ >+ class => 'Koha::Libraries', >+ }); >+ >+ my $item1 = $builder->build_sample_item({ library => $library->branchcode, >+ itemcallnumber => "CAL.123", >+ }); >+ >+ my $cgi = new CGI; >+ >+ $cgi->param( 'service', 'GetAvailability' ); >+ $cgi->param( 'id', $item1->itemnumber ); >+ $cgi->param( 'id_type', 'item' ); >+ my $reply = XML::LibXML->load_xml( string => C4::ILSDI::Services::GetAvailability($cgi) ); >+ >+ is($reply->findnodes('//dlf:identifier'), $item1->itemnumber, 'itemnumber valid'); >+ is($reply->findnodes('//dlf:availabilitystatus'), 'available', 'item1 is available'); >+ is($reply->findnodes('//dlf:location'), $library->branchname, 'item1 location (branchname) is fine'); >+ is($reply->findnodes('//dlf:callnumber'), $item1->itemcallnumber, 'item1 callnumber is returned too'); >+ is($reply->findnodes('//dlf:dateavailable'), DateTime->now , 'item1 available as of now'); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.20.1
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 12469
:
29183
|
29201
|
29202
|
97955
|
97956
|
97957
| 97958