1edd008ed494e889b98796b1a3553d907f3ea5f1
[koha.git] / t / Persistant.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use Test::More tests => 10;
6 use Data::Dump qw(dump);
7
8 BEGIN { use_ok('Koha::Persistant'); }
9
10 ok my $row = Koha::Persistant::authorised_value( category => 'WITHDROWN', 1 ), 'authorised_value';
11 ok $row->{lib}, 'lib';
12 ok $row->{lib_opac}, 'lib_opac';
13 diag dump $row;
14
15 foreach ( 1 .. 3 ) {
16         is_deeply Koha::Persistant::authorised_value( category => 'WITHDROWN', 1 ), $row, "authorised_value cached $_";
17 }
18
19 is_deeply my $stats = $Koha::Persistant::stats, { authorised_value => [3, 1] }, 'stats correct';
20 diag dump $stats;
21
22 ok my $_cache = $Koha::Persistant::_cache, '_cache';
23 diag dump $_cache;
24
25 ok my $_sql_cache = $Koha::Persistant::_sql_cache, '_sql_cache';
26 diag dump $_sql_cache;