Lines 601-612
subtest 'SearchItems test' => sub {
Link Here
|
601 |
|
601 |
|
602 |
# Make sure the link is used |
602 |
# Make sure the link is used |
603 |
my $item3 = Koha::Items->find($item3_itemnumber); |
603 |
my $item3 = Koha::Items->find($item3_itemnumber); |
604 |
ok($item3->itemnotes eq 'foobar', 'itemnotes eq "foobar"'); |
604 |
is($item3->itemnotes, 'foobar', 'itemnotes eq "foobar"'); |
605 |
|
605 |
|
606 |
# Do the same search again. |
606 |
# Do the same search again. |
607 |
# This time it will search in items.itemnotes |
607 |
# This time it will search in items.itemnotes |
608 |
($items, $total_results) = SearchItems($filter); |
608 |
($items, $total_results) = SearchItems($filter); |
609 |
ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); |
609 |
is(scalar(@$items), 1, 'found 1 item with itemnotes = "foobar"'); |
610 |
|
610 |
|
611 |
my ($cpl_items_after) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); |
611 |
my ($cpl_items_after) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); |
612 |
is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItems should return something' ); |
612 |
is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItems should return something' ); |
Lines 984-990
subtest 'Split subfields in Item2Marc (Bug 21774)' => sub {
Link Here
|
984 |
}; |
984 |
}; |
985 |
|
985 |
|
986 |
subtest 'ModItemFromMarc' => sub { |
986 |
subtest 'ModItemFromMarc' => sub { |
987 |
plan tests => 2; |
987 |
plan tests => 4; |
988 |
$schema->storage->txn_begin; |
988 |
$schema->storage->txn_begin; |
989 |
|
989 |
|
990 |
my $builder = t::lib::TestBuilder->new; |
990 |
my $builder = t::lib::TestBuilder->new; |
Lines 1009-1014
subtest 'ModItemFromMarc' => sub {
Link Here
|
1009 |
my $item = Koha::Items->find($itemnumber); |
1009 |
my $item = Koha::Items->find($itemnumber); |
1010 |
is( $item->itemlost, 1, 'itemlost picked from the item marc'); |
1010 |
is( $item->itemlost, 1, 'itemlost picked from the item marc'); |
1011 |
|
1011 |
|
|
|
1012 |
$item->paidfor("this is something")->store; |
1013 |
|
1012 |
my $updated_item_record = new MARC::Record; |
1014 |
my $updated_item_record = new MARC::Record; |
1013 |
$updated_item_record->append_fields( |
1015 |
$updated_item_record->append_fields( |
1014 |
MARC::Field->new( |
1016 |
MARC::Field->new( |
Lines 1019-1024
subtest 'ModItemFromMarc' => sub {
Link Here
|
1019 |
|
1021 |
|
1020 |
my $updated_item = ModItemFromMarc($updated_item_record, $biblio->biblionumber, $itemnumber); |
1022 |
my $updated_item = ModItemFromMarc($updated_item_record, $biblio->biblionumber, $itemnumber); |
1021 |
is( $updated_item->{itemlost}, 0, 'itemlost should have been reset to the default value in DB' ); |
1023 |
is( $updated_item->{itemlost}, 0, 'itemlost should have been reset to the default value in DB' ); |
|
|
1024 |
is( $updated_item->{paidfor}, "this is something", "Non mapped field has not been reset" ); |
1025 |
is( Koha::Items->find($itemnumber)->paidfor, "this is something" ); |
1022 |
|
1026 |
|
1023 |
$schema->storage->txn_rollback; |
1027 |
$schema->storage->txn_rollback; |
1024 |
}; |
1028 |
}; |
1025 |
- |
|
|