Bug 20144: [sql_modes] Fix values when creating a sql report in tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Feb 2018 17:39:32 +0000 (14:39 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 16:59:00 +0000 (13:59 -0300)
For fix:
Data too long for column 'report_area'
Incorrect integer value: 'null' for column 'cache_expiry'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Reports/Guided.t

index 0a2c734..2de7340 100644 (file)
@@ -186,19 +186,19 @@ subtest 'get_saved_reports' => sub {
     is( $count, 0, "There is no report" );
 
     my @report_ids;
-    foreach ( 1..3 ) {
+    foreach my $ii ( 1..3 ) {
         my $id = $builder->build({ source => 'Borrower' })->{ borrowernumber };
         push @report_ids, save_report({
             borrowernumber => $id,
             sql            => "SQL$id",
             name           => "Name$id",
-            area           => "area$id",
+            area           => "area$ii", # ii vs id area is varchar(6)
             group          => "group$id",
             subgroup       => "subgroup$id",
             type           => "type$id",
             notes          => "note$id",
-            cache_expiry   => "null",
-            public         => "null"
+            cache_expiry   => undef,
+            public         => 0,
         });
         $count++;
     }