Bugzilla – Attachment 97438 Details for
Bug 24377
Record branch in statistics for auto-renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24377: Unit test
Bug-24377-Unit-test.patch (text/plain), 1.91 KB, created by
Nick Clemens (kidclamp)
on 2020-01-16 13:13:58 UTC
(
hide
)
Description:
Bug 24377: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-16 13:13:58 UTC
Size:
1.91 KB
patch
obsolete
>From 81781c52469a1117c73ac84d67a23fea46b3b6f6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 16 Jan 2020 13:09:50 +0000 >Subject: [PATCH] Bug 24377: Unit test > >--- > t/db_dependent/Circulation.t | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index c0e2dacece..8bf9e56aff 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2985,7 +2985,7 @@ subtest 'AddReturn should clear items.onloan for unissued items' => sub { > > subtest 'AddRenewal and AddIssuingCharge tests' => sub { > >- plan tests => 10; >+ plan tests => 11; > > > t::lib::Mocks::mock_preference('item-level_itypes', 1); >@@ -3062,11 +3062,21 @@ subtest 'AddRenewal and AddIssuingCharge tests' => sub { > is( $line->description, '', 'AddRenewal does not set a hardcoded description for the accountline' ); > > t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); >+ >+ $context = Test::MockModule->new('C4::Context'); >+ $context->mock( userenv => { branch => undef, interface => 'CRON'} ); #Test statistical logging of renewal via cron (atuo_renew) >+ > $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); > $old_log_size = Koha::ActionLogs->count( \%params_renewal ); >+ my $sth = $dbh->prepare("SELECT COUNT(*) FROM statistics WHERE itemnumber = ? AND branch = ?"); >+ $sth->execute($item->id, $library->id); >+ my ($old_stats_size) = $sth->fetchrow_array; > AddRenewal( $patron->id, $item->id, $library->id ); > $new_log_size = Koha::ActionLogs->count( \%params_renewal ); >+ $sth->execute($item->id, $library->id); >+ my ($new_stats_size) = $sth->fetchrow_array; > is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); >+ is( $new_stats_size, $old_stats_size + 1, 'renew statistic successfully added with passed branch' ); > > }; > >-- >2.11.0
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 24377
:
97438
|
97439
|
97441
|
97442
|
97453
|
98167
|
98168