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 => 12; |
37 |
plan tests => 13; |
38 |
my $item = $builder->build_sample_item({}); |
38 |
my $item = $builder->build_sample_item({}); |
39 |
|
39 |
|
40 |
my $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
40 |
my $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
Lines 57-65
subtest 'buildKohaItemsNamespace status tests' => sub {
Link Here
|
57 |
like($xml,qr{<status>reference</status>},"reference if positive itemtype notforloan value"); |
57 |
like($xml,qr{<status>reference</status>},"reference if positive itemtype notforloan value"); |
58 |
Koha::ItemTypes->find($item->itype)->notforloan(0)->store; |
58 |
Koha::ItemTypes->find($item->itype)->notforloan(0)->store; |
59 |
|
59 |
|
|
|
60 |
my $substatus = Koha::AuthorisedValues->search({ category => 'NOT_LOAN', authorised_value => -1 })->next->lib; |
60 |
$item->notforloan(-1)->store; |
61 |
$item->notforloan(-1)->store; |
61 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
62 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
62 |
like($xml,qr{<status>On order</status>},"On order if negative notforloan value"); |
63 |
like($xml,qr{<status>reallynotforloan</status>},"reallynotforloan if negative notforloan value"); |
|
|
64 |
like($xml,qr{<substatus>$substatus</substatus>},"substatus set if negative notforloan value"); |
63 |
|
65 |
|
64 |
$item->notforloan(1)->store; |
66 |
$item->notforloan(1)->store; |
65 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
67 |
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); |
66 |
- |
|
|