Bugzilla – Attachment 39435 Details for
Bug 14097
Add unit tests to C4::UsageStats
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14097 - Correct noise under Debian
Bug-14097---Correct-noise-under-Debian.patch (text/plain), 5.46 KB, created by
Mark Tompsett
on 2015-05-23 04:29:08 UTC
(
hide
)
Description:
Bug 14097 - Correct noise under Debian
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-05-23 04:29:08 UTC
Size:
5.46 KB
patch
obsolete
>From 3c974974c14bc8c83d4986da8d694555c4770502 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 23 May 2015 00:22:26 -0400 >Subject: [PATCH] Bug 14097 - Correct noise under Debian > >The first four patches do not create any noise under Ubuntu 14.04 LTS. > >Running on Debian Jessie: >[SNIP] >keys on reference is experimental at t/db_dependent/UsageStats.t line 88. >keys on reference is experimental at t/db_dependent/UsageStats.t line 106. >keys on reference is experimental at t/db_dependent/UsageStats.t line 119. >keys on reference is experimental at t/db_dependent/UsageStats.t line 136. >keys on reference is experimental at t/db_dependent/UsageStats.t line 153. >keys on reference is experimental at t/db_dependent/UsageStats.t line 162. >keys on reference is experimental at t/db_dependent/UsageStats.t line 587. >[SNIP] > >Instead of having 'keys $foo->{bar}', 'keys %{$foo->{bar}}' was used. > >TEST PLAN >--------- >1) On a DEBIAN system (Jessie gives above messages) > apply the first 4 patches interactively. >2) $ prove t/db_dependent/UsageStats.t > -- trigger noise like above. >3) apply this patch >4) $ prove t/db_dependent/UsageStats.t > -- no noise triggered. >5) koha qa test tools >--- > t/db_dependent/UsageStats.t | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t >index b98f05b..ad2dd15 100644 >--- a/t/db_dependent/UsageStats.t >+++ b/t/db_dependent/UsageStats.t >@@ -85,7 +85,7 @@ my $report = C4::UsageStats->BuildReport(); > > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{library}, 'HASH', '$report->{library} is a HASH' ); >-is( scalar( keys( $report->{library} ) ), 5, "There are 5 fields in $report->{library}" ); >+is( scalar( keys %{$report->{library}} ), 5, "There are 5 fields in $report->{library}" ); > is( $report->{library}->{id}, 0, "UsageStatsID is good" ); > is( $report->{library}->{name}, '', "UsageStatsLibraryName is good" ); > is( $report->{library}->{url}, '', "UsageStatsLibraryUrl is good" ); >@@ -103,7 +103,7 @@ $report = C4::UsageStats->BuildReport(); > > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{library}, 'HASH', '$report->{library} is a HASH' ); >-is( scalar( keys( $report->{library} ) ), 5, "There are 5 fields in $report->{library}" ); >+is( scalar( keys %{$report->{library}} ), 5, "There are 5 fields in $report->{library}" ); > is( $report->{library}->{id}, 1, "UsageStatsID is good" ); > is( $report->{library}->{name}, 'NAME', "UsageStatsLibraryName is good" ); > is( $report->{library}->{url}, 'URL', "UsageStatsLibraryUrl is good" ); >@@ -116,7 +116,7 @@ $report = C4::UsageStats->BuildReport(); > > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{volumetry}, 'HASH', '$report->{volumetry} is a HASH' ); >-is( scalar( keys( $report->{volumetry} ) ), 8, "There are 8 fields in $report->{volumetry}" ); >+is( scalar( keys %{$report->{volumetry}} ), 8, "There are 8 fields in $report->{volumetry}" ); > is( $report->{volumetry}->{biblio}, 0, "There is no biblio" ); > is( $report->{volumetry}->{items}, 0, "There is no items" ); > is( $report->{volumetry}->{auth_header}, 0, "There is no auth_header" ); >@@ -133,7 +133,7 @@ $report = C4::UsageStats->BuildReport(); > > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{volumetry}, 'HASH', '$report->{volumetry} is a HASH' ); >-is( scalar( keys( $report->{volumetry} ) ), 8, "There are 8 fields in $report->{volumetry}" ); >+is( scalar( keys %{$report->{volumetry}} ), 8, "There are 8 fields in $report->{volumetry}" ); > is( $report->{volumetry}->{biblio}, 3, "There are 3 biblio" ); > is( $report->{volumetry}->{items}, 3, "There are 3 items" ); > is( $report->{volumetry}->{auth_header}, 2, "There are 2 auth_header" ); >@@ -150,7 +150,7 @@ mocking_systempreferences_to_a_set_value(0); > $report = C4::UsageStats->BuildReport(); > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{systempreferences}, 'HASH', '$report->{systempreferences} is a HASH' ); >-is( scalar( keys( $report->{systempreferences} ) ), 248, "There are 248 fields in $report->{systempreferences}" ); >+is( scalar( keys %{$report->{systempreferences}} ), 248, "There are 248 fields in $report->{systempreferences}" ); > verif_systempreferences_values( $report, 0 ); > > #mock with values >@@ -159,7 +159,7 @@ mocking_systempreferences_to_a_set_value(1); > $report = C4::UsageStats->BuildReport(); > isa_ok( $report, 'HASH', '$report is a HASH' ); > isa_ok( $report->{systempreferences}, 'HASH', '$report->{systempreferences} is a HASH' ); >-is( scalar( keys( $report->{systempreferences} ) ), 248, "There are 248 fields in $report->{systempreferences}" ); >+is( scalar( keys %{$report->{systempreferences}} ), 248, "There are 248 fields in $report->{systempreferences}" ); > verif_systempreferences_values( $report, 1 ); > > # ---------- Testing ReportToCommunity ---------- >@@ -584,7 +584,7 @@ sub mocking_systempreferences_to_a_set_value { > sub verif_systempreferences_values { > my ( $report, $value_to_test ) = @_; > >- foreach my $key ( keys $report->{systempreferences} ) { >+ foreach my $key ( keys %{$report->{systempreferences}} ) { > is( $report->{systempreferences}->{$key}, $value_to_test, "\$report->{systempreferences}->{$key} = $value_to_test" ); > } > } >-- >2.1.4
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 14097
:
38719
|
38800
|
38814
|
38946
|
38947
|
38948
|
39080
|
39085
|
39435
|
41837
|
41843
|
41844
|
46200
|
46201
|
46202
|
46203
|
46204
|
46205
|
46206
|
46207
|
46208
|
46209
|
46210
|
46211
|
46212
|
46213
|
46214
|
46215
|
47717
|
47719
|
47720
|
47721
|
47722
|
47723
|
47724
|
47725
|
47726
|
47727
|
47798
|
47799
|
47800
|
47801
|
47802
|
47803
|
47804
|
47805