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

(-)a/t/db_dependent/Koha/Items.t (-2 / +24 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 16;
22
use Test::More tests => 17;
23
23
24
use Test::MockModule;
24
use Test::MockModule;
25
use Test::Exception;
25
use Test::Exception;
Lines 2000-2002 subtest 'filter_by_for_hold' => sub { Link Here
2000
2000
2001
    $schema->storage->txn_rollback;
2001
    $schema->storage->txn_rollback;
2002
};
2002
};
2003
- 
2003
2004
subtest 'filter_by_bookable' => sub {
2005
    plan tests => 2;
2006
2007
    $schema->storage->txn_begin;
2008
2009
    my $biblio = $builder->build_sample_biblio;
2010
2011
    # bookable items
2012
    my $bookable_item1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 1 } );
2013
2014
    # not bookable items
2015
    my $non_bookable_item1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 0 } );
2016
    my $non_bookable_item2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 0 } );
2017
2018
    is( $biblio->items->filter_by_bookable->count, 1, "filter_by_bookable returns the correct number of items" );
2019
    is(
2020
        $biblio->items->filter_by_bookable->next->itemnumber, $bookable_item1->itemnumber,
2021
        "the correct item is returned from filter_by_bookable"
2022
    );
2023
2024
    $schema->storage->txn_rollback;
2025
};

Return to bug 35787