From 6ab19f01b8a6ee800b75781f761949c6c44ce634 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 31 Mar 2023 18:30:14 +0200 Subject: [PATCH] Bug 29234: (QA follow-up) Fix test that expects wrong defaults This patch changes the get_items_that_can_fill tests so they explicitly set a 'datearrived' as the new defaults for fresh transfer objects from TestBuilder is more sane and has this field undef. Tests *should always* create their required scenarios explicitly. Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Holds.t | 13 +++++++++---- t/lib/TestBuilder.pm | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 29e773e399..c5c79b1d76 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -1738,10 +1738,15 @@ subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled o my $biblio2 = $builder->build_sample_biblio(); my $item2 = $builder->build_sample_item({ biblionumber => $biblio2->biblionumber }); - my $transfer2 = $builder->build_object({ class => "Koha::Item::Transfers", value => { - datecancelled => undef, - itemnumber => $item2->itemnumber - }}); + my $transfer2 = $builder->build_object( + { class => "Koha::Item::Transfers", + value => { + datearrived => dt_from_string, + datecancelled => undef, + itemnumber => $item2->itemnumber + } + } + ); my $hold2 = $builder->build_object({ class => 'Koha::Holds', value => { biblionumber => $biblio2->biblionumber, diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 59137b143e..d393cc8e8c 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -592,7 +592,7 @@ sub _gen_default_values { }, Branchtransfer => { daterequested => dt_from_string(), - datesent => dt_from_string(), + datesent => undef, datearrived => undef, datecancelled => undef, reason => undef, -- 2.39.5