Lines 1-37
Link Here
|
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it |
6 |
# under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 3 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but |
11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
18 |
use Modern::Perl; |
1 |
use Modern::Perl; |
19 |
|
|
|
20 |
use Test::More tests => 2; |
2 |
use Test::More tests => 2; |
21 |
use Test::Warn; |
|
|
22 |
use t::lib::TestBuilder; |
23 |
use t::lib::Mocks; |
24 |
|
3 |
|
25 |
use Koha::ItemTypes; |
4 |
use t::lib::Mocks; |
26 |
|
5 |
use C4::XSLT; |
27 |
BEGIN { |
6 |
use Koha::Database; |
28 |
use_ok('C4::XSLT'); |
|
|
29 |
} |
30 |
|
7 |
|
31 |
my $schema = Koha::Database->new->schema; |
8 |
our $schema = Koha::Database->new->schema; |
32 |
my $builder = t::lib::TestBuilder->new; |
|
|
33 |
|
9 |
|
|
|
10 |
# Here we go |
34 |
$schema->storage->txn_begin; |
11 |
$schema->storage->txn_begin; |
|
|
12 |
subtest 'CustomXSLTExportList: Check export options' => sub { |
13 |
plan tests => 2; |
14 |
t::lib::Mocks::mock_preference('OpacExportOptions', 'custom'); |
15 |
my $list = C4::XSLT::CustomXSLTExportList(1); |
16 |
is( @$list>0, 1, 'We expect at least one result: simple export' ); |
17 |
t::lib::Mocks::mock_preference('OpacExportOptions', 'dc'); |
18 |
$list = C4::XSLT::CustomXSLTExportList(1); |
19 |
is( @$list, 0, 'We expect an empty list now' ); |
20 |
}; |
35 |
|
21 |
|
36 |
subtest 'buildKohaItemsNamespace status tests' => sub { |
22 |
subtest 'buildKohaItemsNamespace status tests' => sub { |
37 |
plan tests => 13; |
23 |
plan tests => 13; |
Lines 111-118
subtest 'buildKohaItemsNamespace status tests' => sub {
Link Here
|
111 |
}); |
97 |
}); |
112 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
98 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
113 |
like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all"); |
99 |
like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all"); |
114 |
|
|
|
115 |
|
116 |
}; |
100 |
}; |
117 |
|
|
|
118 |
$schema->storage->txn_rollback; |
101 |
$schema->storage->txn_rollback; |
119 |
- |
|
|