Bugzilla – Attachment 128633 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), 2.06 KB, created by
Nick Clemens (kidclamp)
on 2021-12-16 16:04:53 UTC
(
hide
)
Description:
Bug 27992: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-12-16 16:04:53 UTC
Size:
2.06 KB
patch
obsolete
>From 94f6acfb8467be8179b8937c02a4fbb03fcc8235 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 16 Dec 2021 15:37:36 +0000 >Subject: [PATCH] Bug 27992: Unit test > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3000753a92..7a91059afa 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -1973,7 +1973,7 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > }; > > subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { >- plan tests => 1; >+ plan tests => 3; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron_category_x = $builder->build_object( >@@ -1996,13 +1996,23 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > ); > my $item_1 = $builder->build_sample_item( > { >- library => $library->{branchcode}, >+ library => $library->branchcode, > } > ); > > my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode ); > is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' ); > >+ 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->unblessed, $item_2->barcode ); >+ $item_2->discard_changes; >+ ok($item_2->onloan, "Item checked out"); >+ ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); >+ $item_2->discard_changes; >+ ok(!$item_2->onloan, "CanBookBeIssued returns a checked out item when adding a statistical checkout count"); >+ > # TODO There are other tests to provide here > }; > >-- >2.20.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