123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- use PHPUnit\Framework\TestCase;
- use refill\hongxudagy\config;
- 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 . '/mtopcard/mtopcard.php');
- require_once(BASE_ROOT_PATH . '/core/framework/function/http.php');
- class TestCardNo extends TestCase
- {
- public static function setUpBeforeClass(): void
- {
- Base::run_util();
- }
- public function testValidPhone()
- {
- $phones = ['18163987390','18918378542','18175821272','17717221667','15338020320','18017765111','13370247789',
- '13612062983','18108470122','18916108861','17315355854','19945713207','15338020320','17397951988','18151151490',
- '17369275856','18101666589','18113244616','18975487566','15376430402','13386059635','15317570849','17737167078',
- '18975358619','18104192319','18991174100','18006917657','19979990008','17800202658','18909241633','18913750625'];
- $count = count($phones);
- $phones = array_unique($phones);
- $count = count($phones);
- foreach ($phones as $phone) {
- [$validate,$card_type,$region_no,$isTransfer] = mtopcard\valid_phone($phone);
- Log::record("validate={$validate} card_type={$card_type} region_no={$region_no}",Log::DEBUG);
- }
- }
- public function testTianYanValidPhone()
- {
- [$validate,$card_type,$region_no,$isTransfer] = mtopcard\valid_phone('15975503200');
- Log::record("validate={$validate} card_type={$card_type} region_no={$region_no}",Log::DEBUG);
- }
- public function testRound()
- {
- $price = round(30 * 0.992, 4);
- $params['recharge_amount'] = number_format($price,4,'.','');
- }
- }
|