Lines 34-40
my $builder = t::lib::TestBuilder->new;
Link Here
|
34 |
$schema->storage->txn_begin; |
34 |
$schema->storage->txn_begin; |
35 |
|
35 |
|
36 |
subtest 'buildKohaItemsNamespace status tests' => sub { |
36 |
subtest 'buildKohaItemsNamespace status tests' => sub { |
37 |
plan tests => 13; |
37 |
plan tests => 14; |
|
|
38 |
|
39 |
t::lib::Mocks::mock_preference('Available_NFL', '1|2'); |
40 |
|
38 |
my $itype = $builder->build_object({ class => 'Koha::ItemTypes' }); |
41 |
my $itype = $builder->build_object({ class => 'Koha::ItemTypes' }); |
39 |
my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); |
42 |
my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); |
40 |
my $item = $builder->build_sample_item({ itype => $itype->itemtype }); |
43 |
my $item = $builder->build_sample_item({ itype => $itype->itemtype }); |
Lines 45-51
subtest 'buildKohaItemsNamespace status tests' => sub {
Link Here
|
45 |
|
48 |
|
46 |
# notforloan |
49 |
# notforloan |
47 |
{ |
50 |
{ |
48 |
|
|
|
49 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
51 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
50 |
$item->notforloan(0)->store; |
52 |
$item->notforloan(0)->store; |
51 |
Koha::ItemTypes->find($item->itype)->notforloan(0)->store; |
53 |
Koha::ItemTypes->find($item->itype)->notforloan(0)->store; |
Lines 69-74
subtest 'buildKohaItemsNamespace status tests' => sub {
Link Here
|
69 |
$item->notforloan(1)->store; |
71 |
$item->notforloan(1)->store; |
70 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
72 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
71 |
like($xml,qr{<status>reference</status>},"reference if positive notforloan value"); |
73 |
like($xml,qr{<status>reference</status>},"reference if positive notforloan value"); |
|
|
74 |
|
75 |
# But now make status notforloan==1 count under Not available |
76 |
t::lib::Mocks::mock_preference('Available_NFL', '2'); |
77 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
78 |
like($xml,qr{<status>reallynotforloan</status>},"reallynotforloan when we change Avaiable_NFL"); |
79 |
t::lib::Mocks::mock_preference('Available_NFL', '1|2'); |
72 |
} |
80 |
} |
73 |
|
81 |
|
74 |
$item->onloan('2001-01-01')->store; |
82 |
$item->onloan('2001-01-01')->store; |
75 |
- |
|
|