123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use PHPUnit\Framework\TestCase;
- use refill\mratio_controlex;
- define('APP_ID', 'refill_stat');
- 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 . '/refill/RefillFactory.php');
- require_once(BASE_HELPER_PATH . '/queue/iqueue.php');
- require_once(BASE_HELPER_PATH . '/queue/monitor.php');
- require_once(BASE_HELPER_PATH . '/refill/util.php');
- class TestRefillPolicy extends TestCase
- {
- public static function setUpBeforeClass(): void
- {
- Base::run_util();
- }
- private function getRatios()
- {
- $ins = Cache::getInstance('cacheredis');
- $content = $ins->get_org('refill_merchant_profit_ratio');
- $counts = json_decode($content,true);
- $gross = $counts['gross'];
- $detail = $counts['detail'];
- return [$gross,$detail];
- }
- public function testRatioCtl()
- {
- [$gross,$detail] = $this->getRatios();
- $ratio_ctl = new refill\mratio_controlex();
- $ratio_ctl->update($gross,$detail);
- $mchid = 10202;
- $ratio_ctl->ratio_match($mchid, 14, 4, 50, [1, 2]);
- }
- }
|