Bugzilla – Attachment 158086 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.74 KB, created by
Lucas Gass (lukeg)
on 2023-10-30 16:46:15 UTC
(
hide
)
Description:
Bug 27992: Unit test
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-10-30 16:46:15 UTC
Size:
1.74 KB
patch
obsolete
>From 683349ec54e32c420472c224d2d95a79cf805a87 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 > >--- > 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 fcd68e9bbe8..af28c551613 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2369,7 +2369,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( >@@ -2409,6 +2409,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.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 27992
:
126865
|
127189
|
128633
|
128634
|
146041
|
158011
|
158073
|
158086
|
158216
|
158217
|
158462
|
158463
|
158464
|
158465
|
158900