1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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/RefillFactory.php');
- require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
- class TestFcgi extends TestCase
- {
- public static function setUpBeforeClass() : void
- {
- Base::run_util();
- }
- public function testEcho()
- {
- $phone = '13911129867';
- $amount = 100;
- $url = 'http://host.docker.internal' . "/mobile/index.php";
- $params = ['mchid' => 1,
- 'cardno' => $phone,
- 'amount' => $amount,
- "act" => "refill",
- "op" => "add",
- 'order_sn' => $this->make_sn(),
- 'notifyurl' => "http://www.baidu.com"];
- $proxy = new refill_proxy("1ff02223b771c0414468c8892151c602");
- while (true) {
- $resp = $proxy->send($url, $params);
- }
- }
- private function make_sn()
- {
- return mt_rand(1000, 9999)
- . sprintf('%010d', time())
- . sprintf('%06d', (float)microtime() * 1000000);
- }
- public function testMicroTime()
- {
- [$micro,$time] = explode(' ',microtime());
- }
- }
|