|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 40; |
20 |
use Test::More tests => 41; |
|
|
21 |
use Test::Warn; |
| 21 |
|
22 |
|
| 22 |
my $destructorcount = 0; |
23 |
my $destructorcount = 0; |
| 23 |
|
24 |
|
|
Lines 40-45
SKIP: {
Link Here
|
| 40 |
is( $cache->get_from_cache("not in here"), |
41 |
is( $cache->get_from_cache("not in here"), |
| 41 |
undef, "fetching item NOT in cache" ); |
42 |
undef, "fetching item NOT in cache" ); |
| 42 |
|
43 |
|
|
|
44 |
# set_in_cache should not warn |
| 45 |
my $warn; |
| 46 |
{ |
| 47 |
local $SIG{__WARN__} = sub { |
| 48 |
$warn = shift; |
| 49 |
}; |
| 50 |
$cache->set_in_cache( "a key", undef ); |
| 51 |
is( $warn, undef, 'Koha::Cache->set_in_cache should not return any warns' ); |
| 52 |
} |
| 53 |
|
| 43 |
# test expiry time in cache |
54 |
# test expiry time in cache |
| 44 |
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second |
55 |
$cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second |
| 45 |
sleep 2; |
56 |
sleep 2; |
| 46 |
- |
|
|