View | Details | Raw Unified | Return to bug 7162
Collapse All | Expand All

(-)a/t/db_dependent/Acquisition.t (-2 / +27 lines)
Lines 8-14 use POSIX qw(strftime); Link Here
8
8
9
use C4::Bookseller qw( GetBookSellerFromId );
9
use C4::Bookseller qw( GetBookSellerFromId );
10
10
11
use Test::More tests => 79;
11
use Test::More tests => 88;
12
12
13
BEGIN {
13
BEGIN {
14
    use_ok('C4::Acquisition');
14
    use_ok('C4::Acquisition');
Lines 925-928 is( $nonexistent_order, undef, 'GetOrder returns undef if no ordernumber is give Link Here
925
$nonexistent_order = GetOrder( 424242424242 );
925
$nonexistent_order = GetOrder( 424242424242 );
926
is( $nonexistent_order, undef, 'GetOrder returns undef if a nonexistent ordernumber is given' );
926
is( $nonexistent_order, undef, 'GetOrder returns undef if a nonexistent ordernumber is given' );
927
927
928
# Tests for DelOrder
929
my $order1 = GetOrder($ordernumbers[0]);
930
my $error = DelOrder($order1->{biblionumber}, $order1->{ordernumber});
931
ok((not defined $error), "DelOrder does not fail");
932
$order1 = GetOrder($order1->{ordernumber});
933
ok((defined $order1->{datecancellationprinted}), "order is cancelled");
934
ok((not defined $order1->{cancellationreason}), "order has no cancellation reason");
935
ok((defined GetBiblio($order1->{biblionumber})), "biblio still exists");
936
937
my $order2 = GetOrder($ordernumbers[1]);
938
my $error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1);
939
ok((not defined $error), "DelOrder does not fail");
940
$order2 = GetOrder($order2->{ordernumber});
941
ok((defined $order2->{datecancellationprinted}), "order is cancelled");
942
ok((not defined $order2->{cancellationreason}), "order has no cancellation reason");
943
ok((not defined GetBiblio($order2->{biblionumber})), "biblio does not exist anymore");
944
945
my $order4 = GetOrder($ordernumbers[3]);
946
my $error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar");
947
ok((not defined $error), "DelOrder does not fail");
948
$order4 = GetOrder($order4->{ordernumber});
949
ok((defined $order4->{datecancellationprinted}), "order is cancelled");
950
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\"");
951
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
952
# End of tests for DelOrder
953
928
$dbh->rollback;
954
$dbh->rollback;
929
- 

Return to bug 7162