stanley-king 2 years ago
parent
commit
20578ae84f
2 changed files with 11 additions and 6 deletions
  1. 0 3
      crontab/control/date.php
  2. 11 3
      test/TestRefillCommand.php

+ 0 - 3
crontab/control/date.php

@@ -122,9 +122,6 @@ class dateControl extends BaseCronControl
         $sDate = date('Y-m-d',$start_date);
         $refill = new statistics\stat_refill();
         $refill->restat([$sDate]);
-
-//        $clear = new refill\pdlog_clear();
-//        $clear->clear($start_date,$end_date);
     }
 
     public function merchant_daytimeOp()

+ 11 - 3
test/TestRefillCommand.php

@@ -31,6 +31,17 @@ class TestRefillCommand extends TestCase
         $refill->restat($dates);
     }
 
+    //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()
+    {
+        $end_date = strtotime(date('Y-m-d',time()));
+        $start_date  = $end_date - 86400;
+
+        $sDate = date('Y-m-d',$start_date);
+        $refill = new statistics\stat_refill();
+        $refill->restat([$sDate]);
+    }
+
     public function testCurDate()
     {
         $end_date = strtotime(date('Y-m-d',time()));
@@ -42,8 +53,5 @@ class TestRefillCommand extends TestCase
         $sDate = date('Y-m-d',$start_date);
         $refill = new statistics\stat_refill();
         $refill->restat([$sDate]);
-
-        $clear = new refill\pdlog_clear();
-        $clear->clear($start_date,$end_date);
     }
 }