init_member(65999); } //docker-compose run php php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitMerchants)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test public function testInitMerchants() { $helper = new refill\divert_account(); $helper->init_merchants(); } //docker-compose run php php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitChannels)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test public function testInitChannels() { $helper = new refill\divert_account(); $helper->init_channels(); } public function testDivertMember() { $helper = new refill\divert_account(); $helper->add_member(60221,-100); } public function testUpdateAccount() { $stamp = 0; while (true) { try { $divertor = new refill\divert_account(); $divertor->update_account($stamp); $stamp = time(); } catch (Exception $ex) { Log::record($ex->getMessage(),Log::ERR); } sleep(1); } } //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitChannels)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test public function testInitChannelsAccount() { $helper = new refill\divert_account(); $helper->init_channels_account(); } //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitChannelsAccount)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test public function testStoreMember() { $ret = refill\store_member::instance()->get_member(13); $ret = refill\store_member::instance()->get_member(13); } public function testInitTimeout() { $i = 0; while (true) { $start = $i * 100; $items = Model()->table('merchant')->where(['mchid' => ['gt',0]])->field('mchid,time_out')->order('mchid asc')->limit("{$start},100")->select(); if(empty($items)) { return; } $i++; foreach ($items as $item) { $mchid = intval($item['mchid']); if($mchid <= 0) continue; $time_out = intval($item['time_out']); Model()->table('merchant')->where(['mchid' => $mchid])->update(['day_timeout' => $time_out,'night_timeout' => $time_out]); } } } //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitTimeout)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test }