Bug 18882: Add location code to statistics table for checkouts and renewals
[koha-ffzg.git] / t / db_dependent / Stats.t
index 5ad9608..21a3226 100644 (file)
@@ -3,7 +3,7 @@
 use Modern::Perl;
 use C4::Stats;
 
-use Test::More tests => 17;
+use Test::More tests => 18;
 
 BEGIN {
     use_ok('C4::Stats');
@@ -33,6 +33,7 @@ my $params = {
               amount =>5.1,
               other => "bla",
               itemtype => "BK",
+              location => "LOC",
               accountno => 51,
               ccode => "CODE",
 };
@@ -105,6 +106,7 @@ $params = {
               amount =>5.1,
               other => "bla",
               itemtype => "BK",
+              location => "LOC",
               accountno => 51,
               ccode => "CODE",
               type => "return"
@@ -113,14 +115,15 @@ UpdateStats ($params);
 my $sth = $dbh->prepare("SELECT * FROM statistics");
 $sth->execute();
 my $line = ${ $sth->fetchall_arrayref( {} ) }[0];
-is ($params-> {branch},         $line->{branch},         "UpdateStats save branch param in branch field of statistics table");
-is ($params-> {type},           $line->{type},           "UpdateStats save type param in type field of statistics table");
-is ($params-> {borrowernumber}, $line->{borrowernumber}, "UpdateStats save borrowernumber param in borrowernumber field of statistics table");
-cmp_ok($params-> {amount},'==', $line->{value},          "UpdateStats save amount param in value field of statistics table");
-is ($params-> {other},          $line->{other},          "UpdateStats save other param in other field of statistics table");
-is ($params-> {itemtype},       $line->{itemtype},       "UpdateStats save itemtype param in itemtype field of statistics table");
-is ($params-> {accountno},      $line->{proccode},       "UpdateStats save accountno param in proccode field of statistics table");
-is ($params-> {ccode},          $line->{ccode},          "UpdateStats save ccode param in ccode field of statistics table");
+is ($params->{branch},         $line->{branch},         "UpdateStats save branch param in branch field of statistics table");
+is ($params->{type},           $line->{type},           "UpdateStats save type param in type field of statistics table");
+is ($params->{borrowernumber}, $line->{borrowernumber}, "UpdateStats save borrowernumber param in borrowernumber field of statistics table");
+cmp_ok($params->{amount},'==', $line->{value},          "UpdateStats save amount param in value field of statistics table");
+is ($params->{other},          $line->{other},          "UpdateStats save other param in other field of statistics table");
+is ($params->{itemtype},       $line->{itemtype},       "UpdateStats save itemtype param in itemtype field of statistics table");
+is ($params->{location},       $line->{location},       "UpdateStats save location param in location field of statistics table");
+is ($params->{accountno},      $line->{proccode},       "UpdateStats save accountno param in proccode field of statistics table");
+is ($params->{ccode},          $line->{ccode},          "UpdateStats save ccode param in ccode field of statistics table");
 
 #
 # Test TotalPaid