From f0f40e0fb4aa7c031011056b2dbda72626a2aeae Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Feb 2018 12:26:56 -0300 Subject: [PATCH] Bug 20144: [sql_modes] Remove 'Null' string values from GetHardDueDate.t Must be undef or correct integer value Fix for: Incorrect integer value: 'Null' for column 'enrolmentperiod' Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice --- t/db_dependent/Circulation/GetHardDueDate.t | 76 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t index c2b831fd89..b5a571b589 100644 --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ b/t/db_dependent/Circulation/GetHardDueDate.t @@ -78,17 +78,17 @@ Koha::Library->new($samplebranch2)->store; my $samplecat = { categorycode => 'CAT1', description => 'Description1', - enrolmentperiod => 'Null', - enrolmentperioddate => 'Null', - dateofbirthrequired => 'Null', - finetype => 'Null', - bulk => 'Null', - enrolmentfee => 'Null', - overduenoticerequired => 'Null', - issuelimit => 'Null', - reservefee => 'Null', + enrolmentperiod => undef, + enrolmentperioddate => undef, + dateofbirthrequired => undef, + finetype => undef, + bulk => undef, + enrolmentfee => undef, + overduenoticerequired => undef, + issuelimit => undef, + reservefee => undef, hidelostitems => 0, - category_type => 'Null' + category_type => 'A', }; my $query = "INSERT INTO categories (categorycode,description,enrolmentperiod,enrolmentperioddate,dateofbirthrequired ,finetype,bulk,enrolmentfee,overduenoticerequired,issuelimit ,reservefee ,hidelostitems ,category_type) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?)"; @@ -114,7 +114,7 @@ my $default = { #Test GetIssuingRule my $sampleissuingrule1 = { reservecharge => '0.000000', - chargename => 'Null', + chargename => undef, restrictedtype => 0, accountsent => 0, maxissueqty => 5, @@ -132,7 +132,7 @@ my $sampleissuingrule1 = { hardduedate => '2013-01-01', branchcode => $samplebranch1->{branchcode}, fine => '0.000000', - hardduedatecompare => 5, + hardduedatecompare => 0, overduefinescap => '0.000000', renewalsallowed => 0, firstremind => 0, @@ -153,26 +153,26 @@ my $sampleissuingrule2 = { itemtype => 'BOOK', maxissueqty => 2, maxonsiteissueqty => 1, - renewalsallowed => 'Null', + renewalsallowed => 0, renewalperiod => 2, norenewalbefore => 7, auto_renew => 0, - reservesallowed => 'Null', + reservesallowed => 0, issuelength => 2, lengthunit => 'days', - hardduedate => 2, - hardduedatecompare => 'Null', - fine => 'Null', - finedays => 'Null', - firstremind => 'Null', - chargeperiod => 'Null', + hardduedate => undef, + hardduedatecompare => 0, + fine => undef, + finedays => undef, + firstremind => undef, + chargeperiod => undef, chargeperiod_charge_at => 0, rentaldiscount => 2.00, - overduefinescap => 'Null', - accountsent => 'Null', - reservecharge => 'Null', - chargename => 'Null', - restrictedtype => 'Null', + overduefinescap => undef, + accountsent => undef, + reservecharge => undef, + chargename => undef, + restrictedtype => undef, maxsuspensiondays => 0, onshelfholds => 1, opacitemholds => 'Y', @@ -186,26 +186,26 @@ my $sampleissuingrule3 = { itemtype => 'DVD', maxissueqty => 3, maxonsiteissueqty => 2, - renewalsallowed => 'Null', + renewalsallowed => 0, renewalperiod => 3, norenewalbefore => 8, auto_renew => 0, - reservesallowed => 'Null', + reservesallowed => 0, issuelength => 3, lengthunit => 'days', - hardduedate => 3, - hardduedatecompare => 'Null', - fine => 'Null', - finedays => 'Null', - firstremind => 'Null', - chargeperiod => 'Null', + hardduedate => undef, + hardduedatecompare => 0, + fine => undef, + finedays => undef, + firstremind => undef, + chargeperiod => undef, chargeperiod_charge_at => 0, rentaldiscount => 3.00, - overduefinescap => 'Null', - accountsent => 'Null', - reservecharge => 'Null', - chargename => 'Null', - restrictedtype => 'Null', + overduefinescap => undef, + accountsent => undef, + reservecharge => undef, + chargename => undef, + restrictedtype => undef, maxsuspensiondays => 0, onshelfholds => 1, opacitemholds => 'F', -- 2.14.2