123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- use PHPUnit\Framework\TestCase;
- 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_CORE_PATH . '/framework/function/http.php');
- require_once(BASE_HELPER_PATH . '/refill_proxy.php');
- class TestHttp extends TestCase
- {
- public static function setUpBeforeClass(): void
- {
- Base::run_util();
- }
- public function testRequest()
- {
- Log::record(__METHOD__,Log::DEBUG);
- for ($i = 0; $i < 10000; $i++) {
- $rsp = http_request("https://test.xyzshops.cn");
- }
- }
- public function testIPS()
- {
- $ins = Cache::getInstance('cacheredis');
- $ins->hdel('', '', '');
- $x = 'a:2:{i:0;s:14:"222.129.49.232";i:1;s:14:"222.129.55.246";}';
- $x = unserialize($x);
- $x[] = '';
- }
- public function testRefillAdd()
- {
- $time = time() * 10;
- for ($i = 0;$i < 2; $i++) {
- $this->push_order(1092, $time, $i);
- }
- }
- private function push_order($mchid,$time,$index)
- {
- $notify_url = "https://test.xyzshops.cn/mobile/callback/bridge_test.php";
- $params = [ 'mchid' => $mchid,
- 'amount' => 30,
- 'order_sn' => "{$time}" . sprintf("%'010d",$index),
- 'cardno' => '13911129867',
- "act" => "refill",
- "op" => "add",
- 'notifyurl' => $notify_url
- ];
- $proxy = new refill_proxy("210fe406954220f56085997d6a4c5b80");
- $resp = $proxy->send("https://test.xyzshops.cn/mobile/index.php", $params);
- }
- }
|