From 6703dbd0b8dd3517dbbc4d6930c8131645bfa436 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 3 Jan 2017 13:13:32 -0300 Subject: [PATCH] Bug 17836: (ILSDI) Regression test Sponsored-by: ByWater Solutions --- t/db_dependent/ILSDI_Services.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index 15806a6f..88e8181 100644 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -20,6 +20,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Test::More tests => 3; +use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; @@ -94,7 +95,7 @@ subtest 'AuthenticatePatron test' => sub { subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes' => sub { - plan tests => 1; + plan tests => 2; $schema->storage->txn_begin; @@ -165,6 +166,9 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes } } ); + my $members = Test::MockModule->new('C4::Members'); + $members->mock( 'GetMemberAccountBalance', sub { return ( 10, 10, 0 ); } ); + # Prepare and send web request for IL-SDI server: my $query = new CGI; $query->param( 'service', 'GetPatronInfo' ); @@ -184,6 +188,9 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes value_description => undef, }; + is( $reply->{'charges'}, '10.00', + 'The \'charges\' attribute should be correctly filled (bug 17836)' ); + # Check results: is_deeply( $reply->{'attributes'}, [ $cmp ], 'Test GetPatronInfo - show_attributes parameter' ); -- 2.7.4