123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- use PHPUnit\Framework\TestCase;
- define('APP_ID', 'test');
- define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/global.php');
- require_once(BASE_CORE_PATH . '/lrlz.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_HELPER_PATH . '/stat_helper.php');
- use refill\gdsinopec;
- class TestRefillStats extends TestCase
- {
- public static function setUpBeforeClass(): void
- {
- Base::run_util();
- }
- public function testLatestDay()
- {
- $refill = new statistics\stat_refill();
- $refill->run();
- }
- public function testReload()
- {
- $refill = new statistics\stat_refill();
- $task_id = 8;
- $mod_task = Model('task');
- $item = $mod_task->where(['task_id' => $task_id])->find();
- $condition = unserialize($item['params']);
- $type = $condition['type'];
- $time_stamp = $condition['time_stamp'];
- $cid = $condition['cid'];
- $order_time_type = $condition['order_time_type'];
- if ($type == 'merchant') {
- $refill->merchant_stat($time_stamp, $cid, $order_time_type);
- } elseif ($type == 'provider') {
- $refill->provider_stat($time_stamp, $cid, $order_time_type);
- }
- }
- public function testToken()
- {
- require_once(BASE_HELPER_RAPI_PATH . "/gdsinopec/config.php");
- $token_req = refill\gdsinopec\config::token();
- }
- }
- //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillStats::testLatestDay)( .*)?$/" --test-suffix TestRefillStats.php /var/www/html/test
|