|
Lines 49-55
my $schema = Koha::Database->new->schema;
Link Here
|
| 49 |
|
49 |
|
| 50 |
subtest 'BuildReport() tests' => sub { |
50 |
subtest 'BuildReport() tests' => sub { |
| 51 |
|
51 |
|
| 52 |
plan tests => 30; |
52 |
plan tests => 32; |
| 53 |
|
53 |
|
| 54 |
$schema->storage->txn_begin; |
54 |
$schema->storage->txn_begin; |
| 55 |
|
55 |
|
|
Lines 89-94
subtest 'BuildReport() tests' => sub {
Link Here
|
| 89 |
t::lib::Mocks::mock_preference( "UsageStatsCountry", 'COUNTRY' ); |
89 |
t::lib::Mocks::mock_preference( "UsageStatsCountry", 'COUNTRY' ); |
| 90 |
t::lib::Mocks::mock_preference( "UsageStatsLibrariesInfo", 1 ); |
90 |
t::lib::Mocks::mock_preference( "UsageStatsLibrariesInfo", 1 ); |
| 91 |
t::lib::Mocks::mock_preference( "UsageStatsGeolocation", 1 ); |
91 |
t::lib::Mocks::mock_preference( "UsageStatsGeolocation", 1 ); |
|
|
92 |
t::lib::Mocks::mock_preference( "IntranetUserJS", 'This is some javascript' ); |
| 92 |
|
93 |
|
| 93 |
$report = C4::UsageStats->BuildReport(); |
94 |
$report = C4::UsageStats->BuildReport(); |
| 94 |
|
95 |
|
|
Lines 102-107
subtest 'BuildReport() tests' => sub {
Link Here
|
| 102 |
is( $report->{installation}->{country}, 'COUNTRY', "UsageStatsCountry is good" ); |
103 |
is( $report->{installation}->{country}, 'COUNTRY', "UsageStatsCountry is good" ); |
| 103 |
is( $report->{installation}->{geolocation}, '1', "UsageStatsGeolocation is good" ); |
104 |
is( $report->{installation}->{geolocation}, '1', "UsageStatsGeolocation is good" ); |
| 104 |
ok( exists $report->{systempreferences}, 'systempreferences is present' ); |
105 |
ok( exists $report->{systempreferences}, 'systempreferences is present' ); |
|
|
106 |
is( $report->{systempreferences}->{IntranetUserJS}, 'Used', "IntranetUserJS is good" ); |
| 107 |
is( $report->{systempreferences}->{IntranetUserCSS}, 'Empty', "IntranetUserCSS is good" ); |
| 105 |
|
108 |
|
| 106 |
isa_ok( $report, 'HASH', '$report is a HASH' ); |
109 |
isa_ok( $report, 'HASH', '$report is a HASH' ); |
| 107 |
isa_ok( $report->{volumetry}, 'HASH', '$report->{volumetry} is a HASH' ); |
110 |
isa_ok( $report->{volumetry}, 'HASH', '$report->{volumetry} is a HASH' ); |
| 108 |
- |
|
|