TestRefillCommand.php 961 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. define('APP_ID', 'refill_stat');
  4. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  5. require_once(BASE_ROOT_PATH . '/global.php');
  6. require_once(BASE_CORE_PATH . '/lrlz.php');
  7. require_once(BASE_ROOT_PATH . '/fooder.php');
  8. require_once (BASE_ROOT_PATH . '/helper/statistics/stat_refill.php');
  9. class TestRefillCommand extends TestCase
  10. {
  11. public static function setUpBeforeClass(): void
  12. {
  13. Base::run_util();
  14. }
  15. //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillCommand::testRefillStat)( .*)?$/" --test-suffix TestRefillCommand.php /var/www/html/test
  16. public function testRefillStat()
  17. {
  18. $dates = [
  19. '2022-01-10',
  20. '2022-01-11',
  21. '2022-01-12',
  22. '2022-01-14',
  23. '2022-01-15'
  24. ];
  25. $refill = new statistics\stat_refill();
  26. $refill->restat($dates);
  27. }
  28. }