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

(-)a/t/db_dependent/Items.t (-2 / +24 lines)
Lines 407-413 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
407
};
407
};
408
408
409
subtest 'SearchItems test' => sub {
409
subtest 'SearchItems test' => sub {
410
    plan tests => 15;
410
    plan tests => 17;
411
411
412
    $schema->storage->txn_begin;
412
    $schema->storage->txn_begin;
413
    my $dbh = C4::Context->dbh;
413
    my $dbh = C4::Context->dbh;
Lines 605-610 subtest 'SearchItems test' => sub { Link Here
605
    ($items, $total_results) = SearchItems($filter);
605
    ($items, $total_results) = SearchItems($filter);
606
    is($total_results, 1, "Search items.issues issues = 0 returns result (items.issues defaults to 0)");
606
    is($total_results, 1, "Search items.issues issues = 0 returns result (items.issues defaults to 0)");
607
607
608
    # Is null
609
    $filter = {
610
        conjunction => 'AND',
611
        filters     => [
612
            {
613
                field    => 'new_status',
614
                query    => 0,
615
                operator => '='
616
            },
617
            {
618
                field    => 'homebranch',
619
                query    => $library1->{branchcode},
620
                operator => '=',
621
            },
622
        ],
623
    };
624
    ($items, $total_results) = SearchItems($filter);
625
    is($total_results, 0, 'found no item with new_status=0 without ifnull');
626
627
    $filter->{filters}[0]->{ifnull} = 0;
628
    ($items, $total_results) = SearchItems($filter);
629
    is($total_results, 1, 'found all items of library1 with new_status=0 with ifnull = 0');
630
608
    $schema->storage->txn_rollback;
631
    $schema->storage->txn_rollback;
609
};
632
};
610
633
611
- 

Return to bug 26032