mMchid = 1; } else { $this->mMchid = 1092; } } public function testPushMessage() { foreach (range(1,2000,1) as $i) { queue\DispatcherClient::instance()->push('xxx',$i); } } public function testAdd() { foreach (range(1,2000,1) as $i) { queue\DispatcherClient::instance()->push('add',[]); } } public function testNotify() { $logic = Logic('queue'); $logic->NotifyMerchantComplete(['order_id' => 6462,'manual' => true]); } public function testAddoil() { foreach (range(1,2000,1) as $i) { queue\DispatcherClient::instance()->push('add',$this->make_order()); } } public function testAddO() { foreach (range(1,1,1) as $i) { queue\DispatcherClient::instance()->push('add',$this->make_order()); } } public function testAddH() { foreach (range(1,50000,1) as $i) { queue\DispatcherClient::instance()->push('add',$this->make_order()); } } public function testGoods() { $goods = refill\RefillFactory::instance()->goods(); $result = []; foreach ($goods as $type => $specs) { if($type == mtopcard\SinopecCard || $type == mtopcard\PetroChinaCard) { foreach ($specs as $spec) { $result['oil_amount'][] = $spec; } } else { $result['phone_amount'][] = $spec; } } return $result; } private function make_order() { $mchid = 1092;// // $mchid = $this->mMchid; $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]); $buyer_id = intval($mchinfo['admin_id']); $params = [ 'mchid' => $mchid, 'buyer_id' => $buyer_id, 'amount' => 100, 'card_no' => 15120035568, 'mch_order' => $this->make_sn(), 'notify_url' => 'https://www.xyzshops.cn/mobile/signature.php']; return $params; } private function make_sn() { return mt_rand(1000, 9999) . sprintf('%010d', time()) . sprintf('%06d', (float)microtime() * 1000000); } public function testCurl() { Swoole\Coroutine\run(function () { $curl = curl_init(); var_dump($curl, (int) $curl); //resource(4) of type (Swoole-Coroutine-cURL Handle) //int(4) $resp = http_request('https://www.xyzshops.cn/mobile/index.php?act=index&op=index&client_type=ios'); Log::record("recv size=" . strlen($resp), Log::DEBUG); }); } public function testDefine() { $x = MASTER_DBHOST . 'xxx'; } public function testPolicy() { $key = "common_phone_speed_"; } }