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

(-)a/t/db_dependent/Items.t (-2 / +21 lines)
Lines 368-374 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
368
};
368
};
369
369
370
subtest 'SearchItems test' => sub {
370
subtest 'SearchItems test' => sub {
371
    plan tests => 14;
371
    plan tests => 15;
372
372
373
    $schema->storage->txn_begin;
373
    $schema->storage->txn_begin;
374
    my $dbh = C4::Context->dbh;
374
    my $dbh = C4::Context->dbh;
Lines 402-407 subtest 'SearchItems test' => sub { Link Here
402
        homebranch => $library2->{branchcode},
402
        homebranch => $library2->{branchcode},
403
        holdingbranch => $library2->{branchcode},
403
        holdingbranch => $library2->{branchcode},
404
        itype => $itemtype->{itemtype},
404
        itype => $itemtype->{itemtype},
405
        issues => 3,
405
    }, $biblio->biblionumber);
406
    }, $biblio->biblionumber);
406
407
407
    my ($items, $total_results);
408
    my ($items, $total_results);
Lines 543-548 subtest 'SearchItems test' => sub { Link Here
543
    my $cpl_items_after = SearchItemsByField( 'homebranch', $library1->{branchcode});
544
    my $cpl_items_after = SearchItemsByField( 'homebranch', $library1->{branchcode});
544
    is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' );
545
    is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' );
545
546
547
    # Issues count may be NULL
548
    $filter = {
549
        conjunction => 'AND',
550
        filters => [
551
            {
552
                field => 'issues',
553
                query => 0,
554
                operator => '=',
555
            },
556
            {
557
                field => 'homebranch',
558
                query => $library1->{branchcode},
559
                operator => '=',
560
            },
561
        ],
562
    };
563
    ($items, $total_results) = SearchItems($filter);
564
    is($total_results, 1, "Search items.issues is NULL with filter issues = 0");
565
546
    $schema->storage->txn_rollback;
566
    $schema->storage->txn_rollback;
547
};
567
};
548
568
549
- 

Return to bug 24443