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

(-)a/t/db_dependent/Koha/Items.t (-1 / +18 lines)
Lines 2002-2008 subtest 'filter_by_for_hold' => sub { Link Here
2002
};
2002
};
2003
2003
2004
subtest 'filter_by_bookable' => sub {
2004
subtest 'filter_by_bookable' => sub {
2005
    plan tests => 2;
2005
    plan tests => 3;
2006
2006
2007
    $schema->storage->txn_begin;
2007
    $schema->storage->txn_begin;
2008
2008
Lines 2021-2025 subtest 'filter_by_bookable' => sub { Link Here
2021
        "the correct item is returned from filter_by_bookable"
2021
        "the correct item is returned from filter_by_bookable"
2022
    );
2022
    );
2023
2023
2024
    # unset level booking on item (for itemtype)
2025
    t::lib::Mocks::mock_preference( 'item-level_booking', 0 );
2026
2027
    # test with itemtype directly bookable
2028
    my $item_type = $builder->build_object( { class => 'Koha::ItemTypes', value => { bookable => 1 } } );
2029
    my $biblio2   = $builder->build_sample_biblio( { itemtype => $item_type->itemtype } );
2030
2031
    # bookable items
2032
    my $bookable_item3 = $builder->build_sample_item(
2033
        { biblionumber => $biblio2->biblionumber, itype => $item_type->itemtype, bookable => 1 } );
2034
    my $bookable_item4 = $builder->build_sample_item(
2035
        { biblionumber => $biblio2->biblionumber, itype => $item_type->itemtype, bookable => 0 } );
2036
2037
    # items are bookable even if bookable => 0 on item (due to itemtype bookable => 1)
2038
    is( $biblio2->items->filter_by_bookable->count, 2, "filter_by_bookable returns the correct number of items" );
2039
2024
    $schema->storage->txn_rollback;
2040
    $schema->storage->txn_rollback;
2041
2025
};
2042
};
(-)a/t/lib/TestBuilder.pm (-1 / +1 lines)
Lines 627-632 sub _gen_default_values { Link Here
627
            defaultreplacecost => 0,
627
            defaultreplacecost => 0,
628
            processfee => 0,
628
            processfee => 0,
629
            notforloan => 0,
629
            notforloan => 0,
630
            bookable => 0,
630
        },
631
        },
631
        Aqbookseller => {
632
        Aqbookseller => {
632
            tax_rate => 0,
633
            tax_rate => 0,
633
- 

Return to bug 35906