Bugzilla – Attachment 139691 Details for
Bug 12225
SIP does not respect the "no block" flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12225: Add unit tests
Bug-12225-Add-unit-tests.patch (text/plain), 2.03 KB, created by
Kyle M Hall (khall)
on 2022-08-23 16:15:43 UTC
(
hide
)
Description:
Bug 12225: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-08-23 16:15:43 UTC
Size:
2.03 KB
patch
obsolete
>From d63402b76c6f9c130fec00c0671f8df3a222ac9d Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Tue, 23 Aug 2022 12:15:09 -0400 >Subject: [PATCH] Bug 12225: Add unit tests > >--- > t/db_dependent/SIP/Transaction.t | 39 +++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index b17b33e635..e1e15ccb95 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -4,7 +4,7 @@ > # Current state is very rudimentary. Please help to extend it! > > use Modern::Perl; >-use Test::More tests => 15; >+use Test::More tests => 16; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -529,6 +529,43 @@ subtest do_checkout_with_patron_blocked => sub { > > }; > >+subtest do_checkout_with_noblock => sub { >+ plan tests => 3; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ debarred => '9999/01/01', >+ }, >+ } >+ ); >+ >+ t::lib::Mocks::mock_userenv( >+ { branchcode => $library->branchcode, flags => 1 } ); >+ >+ my $item = $builder->build_sample_item( >+ { >+ library => $library->branchcode, >+ } >+ ); >+ >+ >+ my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); >+ my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); >+ my $co_transaction = C4::SIP::ILS::Transaction::Checkout->new(); >+ is( $co_transaction->patron($sip_patron), >+ $sip_patron, "Patron assigned to transaction" ); >+ is( $co_transaction->item($sip_item), >+ $sip_item, "Item assigned to transaction" ); >+ >+ $co_transaction->do_checkout(undef, '19990102 030405'); >+ >+ is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron'); >+}; >+ > subtest do_checkout_with_holds => sub { > plan tests => 7; > >-- >2.30.2
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 12225
:
37446
|
137578
|
137622
|
137655
|
137656
|
137683
|
137712
|
137713
|
139684
|
139685
|
139686
|
139691
|
139706
|
139707
|
139708
|
139709
|
139710