Bugzilla – Attachment 158217 Details for
Bug 27992
When recording local use with statistical patron items are not checked in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27992: Unit test
Bug-27992-Unit-test.patch (text/plain), 1.80 KB, created by
Emily Lamancusa (emlam)
on 2023-11-01 21:18:49 UTC
(
hide
)
Description:
Bug 27992: Unit test
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2023-11-01 21:18:49 UTC
Size:
1.80 KB
patch
obsolete
>From 6a00654014e83dfb05b37cfd1bb28e2724c7f327 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 30 Oct 2023 16:45:54 +0000 >Subject: [PATCH] Bug 27992: Unit test > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > t/db_dependent/Circulation.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index fc6e96b735..f64140defd 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2434,7 +2434,7 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > }; > > subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { >- plan tests => 9; >+ plan tests => 11; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron_category_x = $builder->build_object( >@@ -2474,6 +2474,18 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); > is( $stat->location, $item_1->location, 'Recorded a location' ); > >+ >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); >+ my $item_2 = $builder->build_sample_item( { library => $library->branchcode } ); >+ my $issue = AddIssue( $patron_2, $item_2->barcode ); >+ $item_2->discard_changes; >+ ok($item_2->onloan, "Item is checked out"); >+ >+ ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); >+ $item_2->discard_changes; >+ ok(!$item_2->onloan, "Checked out item is returned"); >+ > # TODO There are other tests to provide here > }; > >-- >2.34.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 27992
:
126865
|
127189
|
128633
|
128634
|
146041
|
158011
|
158073
|
158086
|
158216
|
158217
|
158462
|
158463
|
158464
|
158465
|
158900