View | Details | Raw Unified | Return to bug 17189
Collapse All | Expand All

(-)a/t/Cache.t (-2 / +21 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 42;
20
use Test::More tests => 43;
21
use Test::Warn;
21
use Test::Warn;
22
22
23
my $destructorcount = 0;
23
my $destructorcount = 0;
Lines 256-261 subtest 'Koha::Cache::Memory::Lite' => sub { Link Here
256
        undef, "fetching flushed item from cache" );
256
        undef, "fetching flushed item from cache" );
257
};
257
};
258
258
259
subtest 'Koha::Caches' => sub {
260
    plan tests => 8;
261
    my $default_cache = Koha::Cache->get_instance();
262
    my $another_cache = Koha::Cache->get_instance('another_cache');
263
    $default_cache->set_in_cache('key_a', 'value_a');
264
    $default_cache->set_in_cache('key_b', 'value_b');
265
    $another_cache->set_in_cache('key_a', 'another_value_a');
266
    $another_cache->set_in_cache('key_b', 'another_value_b');
267
    is( $default_cache->get_from_cache('key_a'), 'value_a' );
268
    is( $another_cache->get_from_cache('key_a'), 'another_value_a' );
269
    is( $default_cache->get_from_cache('key_b'), 'value_b' );
270
    is( $another_cache->get_from_cache('key_b'), 'another_value_b' );
271
    $another_cache->clear_from_cache('key_b');
272
    is( $default_cache->get_from_cache('key_b'), 'value_b' );
273
    is( $another_cache->get_from_cache('key_b'), undef );
274
    $another_cache->flush_all();
275
    is( $default_cache->get_from_cache('key_a'), 'value_a' );
276
    is( $another_cache->get_from_cache('key_a'), undef );
277
};
278
259
END {
279
END {
260
  SKIP: {
280
  SKIP: {
261
        $ENV{ MEMCACHED_NAMESPACE } = 'unit_tests';
281
        $ENV{ MEMCACHED_NAMESPACE } = 'unit_tests';
262
- 

Return to bug 17189