1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- use PHPUnit\Framework\TestCase;
- 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]);
- }
- }
|