X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2FCache.t;h=fa20a451aa0970104b556ee83eb4b3615d2ff312;hb=956dc953b52a1fd525bc75682bbdfe6848683ace;hp=8adaf1c92782e8844e82ee61fe05ed0fcd83d7fe;hpb=8ec54c86feb92989807837d71f4c0a5e901e07e3;p=koha-ffzg.git diff --git a/t/Cache.t b/t/Cache.t index 8adaf1c927..fa20a451aa 100644 --- a/t/Cache.t +++ b/t/Cache.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 37; +use Test::More tests => 38; my $destructorcount = 0; @@ -181,6 +181,12 @@ SKIP: { $item_from_cache = $cache->get_from_cache('test_deep_copy_array'); @$item_from_cache = qw( another array ref ); is_deeply( $cache->get_from_cache('test_deep_copy_array'), [ qw ( an array ref ) ], 'An array will be deep copied'); + + $cache->flush_L1_cache(); + $item_from_cache = $cache->get_from_cache('test_deep_copy_array'); + @$item_from_cache = qw( another array ref ); + is_deeply( $cache->get_from_cache('test_deep_copy_array'), [ qw ( an array ref ) ], 'An array will be deep copied even it is the first fetch from L2'); + $item_from_cache = $cache->get_from_cache('test_deep_copy_array', { unsafe => 1 }); @$item_from_cache = qw( another array ref ); is_deeply( $cache->get_from_cache('test_deep_copy_array'), [ qw ( another array ref ) ], 'An array will not be deep copied if the unsafe flag is set');