Bugzilla – Attachment 102698 Details for
Bug 24966
Fix calls to maybe_add where method call does not return a value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24966: Add unit tests
Bug-24966-Add-unit-tests.patch (text/plain), 2.27 KB, created by
Kyle M Hall (khall)
on 2020-04-10 10:44:31 UTC
(
hide
)
Description:
Bug 24966: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-04-10 10:44:31 UTC
Size:
2.27 KB
patch
obsolete
>From 0d9303135f92f46ba9ac4b1b2eaf19bf2be5b118 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 10 Apr 2020 06:43:51 -0400 >Subject: [PATCH] Bug 24966: Add unit tests > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/SIP/Message.t | 32 +++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 2cdeba73d6..bc8e87a4b3 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -21,7 +21,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::MockObject; > use Test::MockModule; > use Test::Warn; >@@ -73,6 +73,15 @@ subtest 'Checkin V2' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'Test hold_patron_bcode' => sub { >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ plan tests => 2; >+ $C4::SIP::Sip::protocol_version = 2; >+ test_hold_patron_bcode(); >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'Lastseen response' => sub { > > my $schema = Koha::Database->new->schema; >@@ -468,6 +477,27 @@ sub test_checkin_v2 { > 'Issue record is gone now' ); > } > >+sub test_hold_patron_bcode { >+ my $builder = t::lib::TestBuilder->new(); >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my ( $response, $findpatron ); >+ my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); >+ >+ my $item = $builder->build({ >+ source => 'Item', >+ value => { damaged => 0, withdrawn => 0, itemlost => 0, restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode }, >+ }); >+ my $item_object = Koha::Items->find( $item->{itemnumber} ); >+ >+ my $server = { ils => $mocks->{ils} }; >+ my $sip_item = C4::SIP::ILS::Item->new( $item->{barcode} ); >+ >+ is( $sip_item->hold_patron_bcode, q{}, "SIP item with no hold returns empty string" ); >+ >+ my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_bcode, $server ); >+ is( $resp, q{}, "maybe_add returns empty string for SIP item with no hold returns empty string" ); >+} >+ > # Helper routines > > sub create_mocks { >-- >2.24.1 (Apple Git-126)
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 24966
:
101559
|
101632
|
102584
|
102585
|
102689
|
102697
| 102698