Bugzilla – Attachment 61358 Details for
Bug 18066
Hea - Version 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18066: Fix tests
Bug-18066-Fix-tests.patch (text/plain), 4.56 KB, created by
Jonathan Druart
on 2017-03-21 10:22:04 UTC
(
hide
)
Description:
Bug 18066: Fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-21 10:22:04 UTC
Size:
4.56 KB
patch
obsolete
>From 5e94ad5f202fa870a83e5cc97367fcb8176d8472 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Mar 2017 07:21:38 -0300 >Subject: [PATCH] Bug 18066: Fix tests > >--- > t/db_dependent/UsageStats.t | 42 ++++++++++++++++++++++-------------------- > 1 file changed, 22 insertions(+), 20 deletions(-) > >diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t >index 33af62d..2625efa 100644 >--- a/t/db_dependent/UsageStats.t >+++ b/t/db_dependent/UsageStats.t >@@ -15,7 +15,7 @@ > # with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 59; >+use Test::More tests => 57; > use t::lib::Mocks qw(mock_preference); > use POSIX qw(strftime); > use Data::Dumper; >@@ -74,6 +74,8 @@ t::lib::Mocks::mock_preference( "UsageStatsLastUpdateTime", $now ); > $update = C4::UsageStats->NeedUpdate; > is( $update, 0, "Last update just be done, no update needed " ); > >+my $nb_of_libraries = Koha::Libraries->count; >+ > # ---------- Testing BuildReport ---------------- > > #Test report->library ----------------- >@@ -87,15 +89,15 @@ t::lib::Mocks::mock_preference( "UsageStatsLibraryUrl", 0 ); > > 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}} ), 6, "There are 6 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" ); >-is( $report->{library}->{type}, '', "UsageStatsLibraryType is good" ); >-is( $report->{library}->{country}, '', "UsageStatsCountry is good" ); >-is( $report->{library}->{number_of_libraries}, undef, "UsageStatsLibrariesInfo is good" ); >+isa_ok( $report, 'HASH', '$report is a HASH' ); >+isa_ok( $report->{libraries}, 'ARRAY', '$report->{libraries} is an ARRAY' ); >+is( scalar( @{ $report->{libraries} } ), 0, "There are 0 fields in libraries, libraries info are not shared" ); >+is( $report->{installation}->{koha_id}, 0, "UsageStatsID is good" ); >+is( $report->{installation}->{name}, '', "UsageStatsLibraryName is good" ); >+is( $report->{installation}->{url}, '', "UsageStatsLibraryUrl is good" ); >+is( $report->{installation}->{type}, '', "UsageStatsLibraryType is good" ); >+is( $report->{installation}->{country}, '', "UsageStatsCountry is good" ); >+ > > #mock with values > t::lib::Mocks::mock_preference( "UsageStatsID", 1 ); >@@ -104,19 +106,19 @@ t::lib::Mocks::mock_preference( "UsageStatsLibraryUrl", 'URL' ); > t::lib::Mocks::mock_preference( "UsageStatsLibraryType", 'TYPE' ); > t::lib::Mocks::mock_preference( "UsageStatsCountry", 'COUNTRY' ); > t::lib::Mocks::mock_preference( "UsageStatsLibrariesInfo", 1 ); >+t::lib::Mocks::mock_preference( "UsageStatsGeolocation", 1 ); >+ > > $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}} ), 6, "There are 6 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" ); >-is( $report->{library}->{type}, 'TYPE', "UsageStatsLibraryType is good" ); >-is( $report->{library}->{country}, 'COUNTRY', "UsageStatsCountry is good" ); >-my $nb_of_libraries = Koha::Libraries->count; >-is( $report->{library}->{number_of_libraries}, $nb_of_libraries, "UsageStatsLibrariesInfo is good" ); >+isa_ok( $report, 'HASH', '$report is a HASH' ); >+isa_ok( $report->{libraries}, 'ARRAY', '$report->{libraries} is an ARRAY' ); >+is( scalar( @{ $report->{libraries} } ), $nb_of_libraries, "There are 6 fields in $report->{libraries}" ); >+is( $report->{installation}->{koha_id}, 1, "UsageStatsID is good" ); >+is( $report->{installation}->{name}, 'NAME', "UsageStatsLibraryName is good" ); >+is( $report->{installation}->{url}, 'URL', "UsageStatsLibraryUrl is good" ); >+is( $report->{installation}->{type}, 'TYPE', "UsageStatsLibraryType is good" ); >+is( $report->{installation}->{country}, 'COUNTRY', "UsageStatsCountry is good" ); > > #Test report->volumetry --------------- > #with original values >-- >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 18066
:
59975
|
59976
|
60729
|
60730
|
60734
|
60742
|
60743
|
60744
|
60745
|
60746
|
61355
|
61356
|
61358
|
61361
|
61362
|
61392
|
61393
|
61394
|
61395
|
61396
|
61397
|
61398
|
61427
|
61428
|
61429
|
61430
|
61431
|
61432
|
61433
|
61582
|
62646