1 package KohaTest::Acquisition::GetParcel;
2 use base qw( KohaTest::Acquisition );
14 at first, there should be no parcels for our bookseller.
18 sub no_parcel : Test( 1 ) {
21 my @parcel = GetParcel( $self->{'booksellerid'}, undef, undef );
22 is( scalar @parcel, 0, 'our new bookseller has no parcels' )
23 or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );
28 we create an order, mark it as received, and then see if we can find
33 sub one_parcel : Test( 17 ) {
36 my $invoice = 123; # XXX what should this be?
38 my $today = sprintf( '%04d-%02d-%02d',
39 localtime->year() + 1900,
42 my ( $basketno, $ordernumber ) = $self->create_new_basket();
44 ok( $basketno, "my basket number is $basketno" );
45 ok( $ordernumber, "my order number is $ordernumber" );
46 my $datereceived = ModReceiveOrder( $self->{'biblios'}[0], # biblionumber
47 $ordernumber, # $ordernumber,
51 $invoice, # $invoiceno,
54 $self->{'bookfundid'}, # $bookfund,
55 $today, # $datereceived
57 is( $datereceived, $today, "the parcel was received on $datereceived" );
59 my @parcel = GetParcel( $self->{'booksellerid'}, $invoice, $today );
60 is( scalar @parcel, 1, 'we found one (1) parcel.' )
61 or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );