TestCrontab.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. define('APP_ID', 'test');
  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_CORE_PATH . '/framework/function/http.php');
  9. require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
  10. require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
  11. require_once(BASE_CRONTAB_PATH . '/control/control.php');
  12. require_once(BASE_CRONTAB_PATH . '/control/minutes.php');
  13. class TestCrontab extends TestCase
  14. {
  15. private $min_controller;
  16. public static function setUpBeforeClass(): void
  17. {
  18. Base::run_util();
  19. }
  20. public function __construct(?string $name = null, array $data = [], $dataName = '')
  21. {
  22. parent::__construct($name, $data, $dataName);
  23. $this->min_controller = new minutesControl();
  24. }
  25. public function testLimit()
  26. {
  27. $this->min_controller->check_refill_order_limit();
  28. }
  29. public function testUpdateBalance()
  30. {
  31. $this->min_controller->update_channel_balanceOp();
  32. }
  33. }