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 |
field => 'issues', |
550 |
query => 0, |
551 |
operator => '=', |
552 |
}; |
553 |
($items, $total_results) = SearchItems($filter); |
554 |
ok($total_results == 1, "Search items.issues is NULL with filter issues = 0"); |
555 |
|
546 |
$schema->storage->txn_rollback; |
556 |
$schema->storage->txn_rollback; |
547 |
}; |
557 |
}; |
548 |
|
558 |
|
549 |
- |
|
|