From b57a0462ecf12c1353d8650febf6feab89e4ff60 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 8 Jan 2020 10:55:40 -0300 Subject: [PATCH] Bug 24277: Regression tests Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 76f7c46613687b712fa2342049557f2a769db8bf) Signed-off-by: Lucas Gass --- t/db_dependent/Acquisition.t | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index b6fe38d3e9..0e7fe62b3e 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -19,9 +19,10 @@ use Modern::Perl; use POSIX qw(strftime); -use Test::More tests => 77; +use Test::More tests => 78; use t::lib::Mocks; use Koha::Database; +use Koha::DateUtils qw(dt_from_string output_pref); use Koha::Acquisition::Basket; use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'MARC21' ); @@ -304,16 +305,36 @@ my $invoiceid = AddInvoice( my $invoice = GetInvoice( $invoiceid ); +my $reception_date = output_pref( + { + dt => dt_from_string->add( days => 1 ), + dateformat => 'iso', + dateonly => 1, + } +); my ($datereceived, $new_ordernumber) = ModReceiveOrder( { biblionumber => $biblionumber4, order => Koha::Acquisition::Orders->find( $ordernumbers[4] )->unblessed, quantityreceived => 1, invoice => $invoice, - budget_id => $order_content[4]->{str}->{budget_id}, + budget_id => $order_content[4]->{str}->{budget_id}, + datereceived => $reception_date, } ); +is( + output_pref( + { + dt => dt_from_string($datereceived), + dateformat => 'iso', + dateonly => 1 + } + ), + $reception_date, + 'ModReceiveOrder sets the passed date' +); + my $search_orders = SearchOrders({ booksellerid => $booksellerid, basketno => $basketno -- 2.20.1