Parcourir la source

clear and stat 2003-04-14 order

stanley-king il y a 2 ans
Parent
commit
c00530e59d
1 fichiers modifiés avec 27 ajouts et 0 suppressions
  1. 27 0
      test/TestRefillCommand.php

+ 27 - 0
test/TestRefillCommand.php

@@ -35,6 +35,33 @@ class TestRefillCommand extends TestCase
         $refill->restat($dates);
     }
 
+    //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillCommand::testClearStat)( .*)?$/" --test-suffix TestRefillCommand.php /var/www/html/test
+    public function testClearStat()
+    {
+        $clear_stat = function ($date)
+        {
+            $start_date = strtotime($date);
+            $end_date  = $start_date + 86400;
+
+            $clear = new refill\order_clear();
+            $clear->clear($start_date,$end_date);
+
+            $sDate = date('Y-m-d',$start_date);
+            $refill = new statistics\stat_refill();
+            $refill->restat([$sDate]);
+        };
+
+        $dates = [
+            '2023-04-12',
+            '2023-04-14'
+        ];
+        foreach ($dates as $date)
+        {
+            $clear_stat($date);
+        }
+    }
+
+
     //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillCommand::testRefillStatYesterday)( .*)?$/" --test-suffix TestRefillCommand.php /var/www/html/test
     public function testRefillStatYesterday()
     {