is( $iteminfo[0], $biblionumber, "biblionumber is $biblionumber" );
is( $iteminfo[1], $biblioitemnumber, "biblioitemnumber is $biblioitemnumber" );
ok( $iteminfo[2], "itemnumber is $iteminfo[2]" );
+ push @{ $self->{'items'} },
+ { biblionumber => $iteminfo[0],
+ biblioitemnumber => $iteminfo[1],
+ itemnumber => $iteminfo[2],
+ };
}
push @{$self->{'biblios'}}, $biblionumber;
}
$self->add_biblios( add_items => 1 );
- ok( $self->{'biblios'}, 'An item has been aded' )
- or diag( Data::Dumper->Dump( [ $self->{'biblios'} ], ['biblios'] ) );
+ ok( $self->{'items'}, 'An item has been aded' )
+ or diag( Data::Dumper->Dump( [ $self->{'items'} ], ['items'] ) );
- my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'biblios'}[0] );
+ my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'items'}[0]{'biblionumber'} );
ok( $biblioitems[0]->{'biblioitemnumber'}, '...and it has a biblioitemnumber' )
or diag( Data::Dumper->Dump( [ \@biblioitems ], ['biblioitems'] ) );
local $TODO = 'GetItemsForInventory should fail when missing required parameters';
my $items = C4::Items::GetItemsForInventory();
- ok( not $items, 'GetItemsForInventory fails when parameters are missing' )
+ ok( ! defined $items, 'GetItemsForInventory fails when parameters are missing' )
or diag( Data::Dumper->Dump( [ $items ], [ 'items' ] ) );
}
isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
is( scalar @$items, 1, '...and we found only one item' );
my $our_item = $items->[0];
- is( $our_item->{'itemnumber'}, $self->{'biblios'}[0], '...and the item we found has the right itemnumber' );
+ is( $our_item->{'itemnumber'}, $self->{'items'}[0]{'itemnumber'}, '...and the item we found has the right itemnumber' );
- diag( Data::Dumper->Dump( [$items], ['items'] ) );
+ # diag( Data::Dumper->Dump( [$items], ['items'] ) );
}
=head3 date_last_seen
isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
is( scalar @$items, 1, '...and we found only one item' );
my $our_item = $items->[0];
- is( $our_item->{'itemnumber'}, $self->{'biblios'}[0], '...and the item we found has the right itemnumber' );
+ is( $our_item->{'itemnumber'}, $self->{'items'}[0]{'itemnumber'}, '...and the item we found has the right itemnumber' );
# give a datelastseen of yesterday, and we should not get our item.
$items = C4::Items::GetItemsForInventory(