TestCardNo.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. use refill\hongxudagy\config;
  4. define('APP_ID', 'test');
  5. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  6. require_once(BASE_ROOT_PATH . '/global.php');
  7. require_once(BASE_CORE_PATH . '/lrlz.php');
  8. require_once(BASE_ROOT_PATH . '/fooder.php');
  9. require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
  10. require_once(BASE_ROOT_PATH . '/core/framework/function/http.php');
  11. class TestCardNo extends TestCase
  12. {
  13. public static function setUpBeforeClass(): void
  14. {
  15. Base::run_util();
  16. }
  17. public function testValidPhone()
  18. {
  19. $phones = ['18163987390','18918378542','18175821272','17717221667','15338020320','18017765111','13370247789',
  20. '13612062983','18108470122','18916108861','17315355854','19945713207','15338020320','17397951988','18151151490',
  21. '17369275856','18101666589','18113244616','18975487566','15376430402','13386059635','15317570849','17737167078',
  22. '18975358619','18104192319','18991174100','18006917657','19979990008','17800202658','18909241633','18913750625'];
  23. $count = count($phones);
  24. $phones = array_unique($phones);
  25. $count = count($phones);
  26. foreach ($phones as $phone) {
  27. [$validate,$card_type,$region_no,$isTransfer] = mtopcard\valid_phone($phone);
  28. Log::record("validate={$validate} card_type={$card_type} region_no={$region_no}",Log::DEBUG);
  29. }
  30. }
  31. public function testTianYanValidPhone()
  32. {
  33. [$validate,$card_type,$region_no,$isTransfer] = mtopcard\valid_phone('15975503200');
  34. Log::record("validate={$validate} card_type={$card_type} region_no={$region_no}",Log::DEBUG);
  35. }
  36. public function testRound()
  37. {
  38. $price = round(30 * 0.992, 4);
  39. $params['recharge_amount'] = number_format($price,4,'.','');
  40. }
  41. }