Bugzilla – Attachment 147838 Details for
Bug 30928
Add interface to statistics table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30928: Add tests
Bug-30928-Add-tests.patch (text/plain), 3.58 KB, created by
Lucas Gass (lukeg)
on 2023-03-07 13:19:01 UTC
(
hide
)
Description:
Bug 30928: Add tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-03-07 13:19:01 UTC
Size:
3.58 KB
patch
obsolete
>From 4f0c8b1bab341f884406d5ec61b744f54cd327e9 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 3 Feb 2023 23:22:20 +0000 >Subject: [PATCH] Bug 30928: Add tests > >prove -v t/db_dependent/Koha/Statistics.t >prove -v t/db_dependent/Stats.t >--- > t/db_dependent/Koha/Statistics.t | 5 ++++- > t/db_dependent/Stats.t | 13 +++++++++---- > 2 files changed, 13 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/Statistics.t b/t/db_dependent/Koha/Statistics.t >index 01600fa348..d3f8a76c80 100755 >--- a/t/db_dependent/Koha/Statistics.t >+++ b/t/db_dependent/Koha/Statistics.t >@@ -19,10 +19,11 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > > use Koha::Database; > use Koha::Statistics; >+use C4::Context; > use C4::Stats qw( UpdateStats ); > > use t::lib::TestBuilder; >@@ -43,6 +44,7 @@ C4::Stats::UpdateStats( > itemtype => $item->effective_itemtype, > location => $item->location, > ccode => $item->ccode, >+ interface => C4::Context->interface > } > ); > >@@ -52,5 +54,6 @@ is( $stat->borrowernumber, $patron->borrowernumber, 'Patron is there' ); > is( $stat->branch, $library->branchcode, 'Library is there' ); > is( ref( $stat->item ), 'Koha::Item', '->item returns a Koha::Item object' ); > is( $stat->item->itemnumber, $item->itemnumber, '->item works great' ); >+is( $stat->interface, 'opac', 'Interface is recorded successfully' ); > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Stats.t b/t/db_dependent/Stats.t >index ce411905c5..117dfbea28 100755 >--- a/t/db_dependent/Stats.t >+++ b/t/db_dependent/Stats.t >@@ -4,7 +4,7 @@ use Modern::Perl; > use C4::Stats qw( UpdateStats ); > use Koha::Database; > >-use Test::More tests => 18; >+use Test::More tests => 19; > > BEGIN { > use_ok('C4::Stats', qw( UpdateStats )); >@@ -33,6 +33,7 @@ my $params = { > itemtype => "BK", > location => "LOC", > ccode => "CODE", >+ interface => "INTERFACE", > }; > my $return_error; > >@@ -105,7 +106,8 @@ $params = { > itemtype => "BK", > location => "LOC", > ccode => "CODE", >- type => "return" >+ type => "return", >+ interface => "INTERFACE", > }; > UpdateStats ($params); > my $sth = $dbh->prepare("SELECT * FROM statistics"); >@@ -119,6 +121,7 @@ is ($params->{other}, $line->{other}, "UpdateStats save other > is ($params->{itemtype}, $line->{itemtype}, "UpdateStats save itemtype param in itemtype field of statistics table"); > is ($params->{location}, $line->{location}, "UpdateStats save location param in location field of statistics table"); > is ($params->{ccode}, $line->{ccode}, "UpdateStats save ccode param in ccode field of statistics table"); >+is ($params->{interface}, $line->{interface}, "UpdateStats save interface param in interface field of statistics table"); > > $dbh->do(q|DELETE FROM statistics|); > $params = { >@@ -129,7 +132,8 @@ $params = { > other => "bla", > itemtype => "BK", > ccode => "CODE", >- type => "return" >+ type => "return", >+ interface => "INTERFACE", > }; > UpdateStats($params); > $sth = $dbh->prepare("SELECT * FROM statistics"); >@@ -148,7 +152,8 @@ $params = { > itemtype => "BK", > location => undef, > ccode => "CODE", >- type => "return" >+ type => "return", >+ interface => "interface" > }; > UpdateStats($params); > $sth = $dbh->prepare("SELECT * FROM statistics"); >-- >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 30928
:
145982
|
146042
|
146171
|
146172
|
146653
|
146654
|
147838
|
147839
|
150386
|
150387
|
150433
|
150434
|
150435
|
150436