Lines 1-11
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 1; |
2 |
use Test::More tests => 2; |
3 |
|
3 |
|
4 |
use t::lib::Mocks; |
4 |
use t::lib::Mocks; |
5 |
use C4::XSLT; |
5 |
use C4::XSLT; |
|
|
6 |
use Koha::Caches; |
6 |
use Koha::Database; |
7 |
use Koha::Database; |
7 |
|
8 |
|
8 |
our $schema = Koha::Database->new->schema; |
9 |
our $schema = Koha::Database->new->schema; |
|
|
10 |
our $cache = Koha::Caches->get_instance; |
9 |
|
11 |
|
10 |
# Here we go |
12 |
# Here we go |
11 |
$schema->storage->txn_begin; |
13 |
$schema->storage->txn_begin; |
Lines 20-23
subtest 'CustomXSLTExportList: Check export options' => sub {
Link Here
|
20 |
$list = C4::XSLT::CustomXSLTExportList(1); |
22 |
$list = C4::XSLT::CustomXSLTExportList(1); |
21 |
is( @$list, 0, 'We expect an empty list now' ); |
23 |
is( @$list, 0, 'We expect an empty list now' ); |
22 |
}; |
24 |
}; |
|
|
25 |
|
26 |
subtest 'CustomXSLTExportList: Caching' => sub { |
27 |
plan tests => 1; |
28 |
t::lib::Mocks::mock_preference('OpacExportOptions', 'custom'); |
29 |
$cache->clear_from_cache('CustomXSLTExportListOPAC'); |
30 |
my $list = C4::XSLT::CustomXSLTExportList(1); |
31 |
push @$list, { nonsense => 1 }; |
32 |
$cache->set_in_cache( 'CustomXSLTExportListOPAC', $list ); |
33 |
my $n = @$list; |
34 |
$list = C4::XSLT::CustomXSLTExportList(1); |
35 |
is( @$list, $n, 'This list comes from the cache and that is fine' ); |
36 |
$cache->clear_from_cache('CustomXSLTExportListOPAC'); |
37 |
}; |
23 |
$schema->storage->txn_rollback; |
38 |
$schema->storage->txn_rollback; |
24 |
- |
|
|