View | Details | Raw Unified | Return to bug 38100
Collapse All | Expand All

(-)a/t/db_dependent/XSLT.t (-2 / +13 lines)
Lines 82-93 subtest 'Tests moved from t' => sub { Link Here
82
};
82
};
83
83
84
subtest 'buildKohaItemsNamespace status tests' => sub {
84
subtest 'buildKohaItemsNamespace status tests' => sub {
85
    plan tests => 18;
85
    plan tests => 20;
86
    $schema->storage->txn_begin;
86
    $schema->storage->txn_begin;
87
87
88
    t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2');
88
    t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2');
89
    t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' );
89
    t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' );
90
    t::lib::Mocks::mock_preference( 'OPACResultsMaxItems', '2' );
90
    t::lib::Mocks::mock_preference( 'OPACResultsMaxItems', '2' );
91
    t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', '0' );
91
92
92
    my $itype = $builder->build_object({ class => 'Koha::ItemTypes' });
93
    my $itype = $builder->build_object({ class => 'Koha::ItemTypes' });
93
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
94
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
Lines 152-157 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
152
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
153
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
153
    like($xml,qr{<substatus>Damaged</substatus>},"Damaged status takes precedence over Lost");
154
    like($xml,qr{<substatus>Damaged</substatus>},"Damaged status takes precedence over Lost");
154
155
156
    my $item2 = $builder->build_sample_item( { itype => $itype->itemtype } );
157
    $item2->holdingbranch( $holdinglibrary->branchcode )->store;
158
    $item2->biblioitem->itemtype( $itemtype->itemtype )->store;
159
    $item2->damaged(1)->store;
160
161
    $xml = C4::XSLT::buildKohaItemsNamespace( $item2->biblionumber, [] );
162
    like( $xml, qr{<status>other</status>}, "Damaged status with AllowHoldsOnDamagedItems = 0 results in 'other'" );
163
    t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', '1' );
164
    $xml = C4::XSLT::buildKohaItemsNamespace( $item2->biblionumber, [] );
165
    like( $xml, qr{<status>available</status>}, "Damaged status with AllowHoldsOnDamagedItems results in 'available'" );
166
155
    $builder->build({ source => "Branchtransfer", value => {
167
    $builder->build({ source => "Branchtransfer", value => {
156
        itemnumber  => $item->itemnumber,
168
        itemnumber  => $item->itemnumber,
157
        datearrived => undef,
169
        datearrived => undef,
158
- 

Return to bug 38100