|
Lines 387-393
subtest 'SearchItems test' => sub {
Link Here
|
| 387 |
}); |
387 |
}); |
| 388 |
|
388 |
|
| 389 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
389 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
| 390 |
my $cpl_items_before = SearchItemsByField( 'homebranch', $library1->{branchcode}); |
390 |
my ($cpl_items_before) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); |
| 391 |
|
391 |
|
| 392 |
my $biblio = $builder->build_sample_biblio({ title => 'Silence in the library' }); |
392 |
my $biblio = $builder->build_sample_biblio({ title => 'Silence in the library' }); |
| 393 |
$builder->build_sample_biblio({ title => 'Silence in the shadow' }); |
393 |
$builder->build_sample_biblio({ title => 'Silence in the shadow' }); |
|
Lines 542-549
subtest 'SearchItems test' => sub {
Link Here
|
| 542 |
($items, $total_results) = SearchItems($filter); |
542 |
($items, $total_results) = SearchItems($filter); |
| 543 |
ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); |
543 |
ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); |
| 544 |
|
544 |
|
| 545 |
my $cpl_items_after = SearchItemsByField( 'homebranch', $library1->{branchcode}); |
545 |
my ($cpl_items_after) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); |
| 546 |
is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' ); |
546 |
is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItems should return something' ); |
| 547 |
|
547 |
|
| 548 |
$schema->storage->txn_rollback; |
548 |
$schema->storage->txn_rollback; |
| 549 |
}; |
549 |
}; |
| 550 |
- |
|
|