Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use POSIX qw(strftime); |
20 |
use POSIX qw(strftime); |
21 |
|
21 |
|
22 |
use Test::More tests => 79; |
22 |
use Test::More tests => 80; |
23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
Lines 893-896
subtest 'GetHistory - managing library' => sub {
Link Here
|
893 |
|
893 |
|
894 |
}; |
894 |
}; |
895 |
|
895 |
|
|
|
896 |
subtest 'GetHistory - is_standing' => sub { |
897 |
|
898 |
plan tests => 1; |
899 |
|
900 |
my $orders = GetHistory(is_standing => '1'); |
901 |
|
902 |
my $builder = t::lib::TestBuilder->new; |
903 |
|
904 |
my $order_basket1 = $builder->build({ source => 'Aqbasket', value => { is_standing => 0 } }); |
905 |
my $orderinfo1 ={ |
906 |
basketno => $order_basket1->{basketno}, |
907 |
rrp => 19.99, |
908 |
replacementprice => undef, |
909 |
quantity => 1, |
910 |
quantityreceived => 0, |
911 |
datereceived => undef, |
912 |
datecancellationprinted => undef, |
913 |
}; |
914 |
my $order1 = $builder->build({ source => 'Aqorder', value => $orderinfo1 }); |
915 |
|
916 |
my $order_basket2 = $builder->build({ source => 'Aqbasket', value => { is_standing => 1 } }); |
917 |
my $orderinfo2 ={ |
918 |
basketno => $order_basket2->{basketno}, |
919 |
rrp => 19.99, |
920 |
replacementprice => undef, |
921 |
quantity => 1, |
922 |
quantityreceived => 0, |
923 |
datereceived => undef, |
924 |
datecancellationprinted => undef, |
925 |
}; |
926 |
my $order2 = $builder->build({ source => 'Aqorder', value => $orderinfo2 }); |
927 |
|
928 |
my $history = GetHistory(is_standing => 1); |
929 |
is( scalar( @$history), scalar ( @$orders ) +1, "GetHistory returns number of standing orders"); |
930 |
|
931 |
}; |
932 |
|
896 |
$schema->storage->txn_rollback(); |
933 |
$schema->storage->txn_rollback(); |
897 |
- |
|
|