|
Lines 236-241
subtest 'SearchItems test' => sub {
Link Here
|
| 236 |
$dbh->{RaiseError} = 1; |
236 |
$dbh->{RaiseError} = 1; |
| 237 |
|
237 |
|
| 238 |
C4::Context->set_preference('marcflavour', 'MARC21'); |
238 |
C4::Context->set_preference('marcflavour', 'MARC21'); |
|
|
239 |
my $cpl_items_before = SearchItemsByField( 'homebranch', 'CPL'); |
| 240 |
|
| 239 |
my ($biblionumber) = get_biblio(); |
241 |
my ($biblionumber) = get_biblio(); |
| 240 |
|
242 |
|
| 241 |
# Add branches if they don't exist |
243 |
# Add branches if they don't exist |
|
Lines 384-391
subtest 'SearchItems test' => sub {
Link Here
|
| 384 |
($items, $total_results) = SearchItems($filter); |
386 |
($items, $total_results) = SearchItems($filter); |
| 385 |
ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); |
387 |
ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); |
| 386 |
|
388 |
|
| 387 |
my $cpl_items = SearchItemsByField( 'homebranch', 'CPL'); |
389 |
my $cpl_items_after = SearchItemsByField( 'homebranch', 'CPL'); |
| 388 |
is( ( $cpl_items and scalar( @$cpl_items ) ), 1, 'SearchItemsByField should return something' ); |
390 |
is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' ); |
| 389 |
|
391 |
|
| 390 |
$dbh->rollback; |
392 |
$dbh->rollback; |
| 391 |
}; |
393 |
}; |
| 392 |
- |
|
|