TestRefillBalance.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. define('APP_ID', 'balance');
  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_HELPER_PATH . '/statistics/refill_balance.php');
  9. class TestRefillBalance extends TestCase
  10. {
  11. public static function setUpBeforeClass(): void
  12. {
  13. Base::run_util();
  14. }
  15. public function testAddBalance()
  16. {
  17. $refill_balance = new statistics\refill_balance();
  18. $refill_balance->add_balance('system', 0, 0, strtotime('2021-12-01'),'order_time');
  19. }
  20. //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillBalance::testInitBalance)( .*)?$/" --test-suffix TestRefillBalance.php /var/www/html/test
  21. public function testInitBalance()
  22. {
  23. $refill_balance = new statistics\refill_balance();
  24. $refill_balance->stat_all(0, strtotime('2022-01-15'));
  25. }
  26. }