Bugzilla – Attachment 147257 Details for
Bug 32805
When recording localuse in the statistics table location is always NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32805: Add tests
Bug-32805-Add-tests.patch (text/plain), 2.30 KB, created by
Jonathan Druart
on 2023-02-23 15:30:31 UTC
(
hide
)
Description:
Bug 32805: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-23 15:30:31 UTC
Size:
2.30 KB
patch
obsolete
>From bad2900b4388c2e3354c4251a53b3d2e6d224625 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 23 Feb 2023 14:51:30 +0000 >Subject: [PATCH] Bug 32805: Add tests > >JD amended patch: tidy > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Circulation.t | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 35e4d91a0f9..d998d83c858 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2246,7 +2246,6 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > } > ); > >- > my ( $error, $question, $alerts ); > > # Patron cannot issue item_1, they have overdues >@@ -2277,7 +2276,7 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > }; > > subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { >- plan tests => 1; >+ plan tests => 9; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron_category_x = $builder->build_object( >@@ -2307,6 +2306,16 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > 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)' ); > >+ my $stat = Koha::Statistics->search( { itemnumber => $item_1->itemnumber } )->next; >+ is( $stat->branch, C4::Context->userenv->{'branch'}, 'Recorded a branch' ); >+ is( $stat->type, 'localuse', 'Recorded type as localuse' ); >+ is( $stat->itemnumber, $item_1->itemnumber, 'Recorded an itemnumber' ); >+ is( $stat->itemtype, $item_1->effective_itemtype, 'Recorded an itemtype' ); >+ is( $stat->borrowernumber, $patron->borrowernumber, 'Recorded a borrower number' ); >+ is( $stat->ccode, $item_1->ccode, 'Recorded a collection code' ); >+ is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); >+ is( $stat->location, $item_1->location, 'Recorded a location' ); >+ > # TODO There are other tests to provide here > }; > >-- >2.25.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 32805
:
146024
|
146158
|
147249
|
147256
| 147257