12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/15
- * Time: 下午3:12
- */
- declare(strict_types=0);
- 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_ROOT_PATH . '/helper/util_helper.php');
- require_once (BASE_ROOT_PATH . '/helper/pay/IPay.php');
- require_once (BASE_ROOT_PATH . '/helper/pay/aopay.php');
- require_once (BASE_ROOT_PATH . '/core/framework/function/http.php');
- use PHPUnit\Framework\TestCase;
- class TestAddData extends TestCase
- {
- public static function setUpBeforeClass() : void
- {
- Base::run_util();
- }
- public function testAdd()
- {
- $y = unserialize('a:8:{s:11:"home1_title";s:9:"那句好";s:5:"image";s:0:"";s:9:"show_type";s:4:"vote";s:9:"show_data";s:0:"";s:4:"type";s:4:"vote";s:4:"data";s:75:"[{"id":0,"text":"u7b2cu4e00u53e5"},{"id":1,"text":"u7b2cu4e8cu53e5"}]";s:5:"title";s:9:"那句好";s:8:"reserved";s:11:"vote_type=0";}');
- $mobiles = array();
- $mobiles['139111269867'] = '江海苗C';
- $mobiles['139111269868'] = '江海苗C';
- $mobiles['139111269869'] = '江海苗C';
- }
- public function testSerialize()
- {
- $data = array (
- 'home1_title' => '今年春节放几天假',
- 'image' => '',
- 'show_type' => 'vote',
- 'show_data' => '',
- 'type' => 'vote',
- 'data' => '[{"id":0,"text":"\\u4e00\\u5929"},{"id":1,"text":"\\u4e24\\u5929"},{"id":2,"text":"\\u4e09\\u5929"}]',
- 'title' => '今年春节放几天假',
- 'reserved' => 'vote_type=0',
- );
- $x = serialize($data);
- $y = unserialize($x);
- }
- public function testAopay()
- {
- $payer = new Pay\aopay();
- $ret = $payer->gen_pay('100510761183646482',0.01,'8000000000002204',"实物订单");
- }
- public function testHfivePay()
- {
- $body = '<xml><appid><![CDATA[wxfdaeb25e38c4c47e]]></appid>
- <attach><![CDATA[590604488911416534]]></attach>
- <bank_type><![CDATA[CFT]]></bank_type>
- <cash_fee><![CDATA[15400]]></cash_fee>
- <fee_type><![CDATA[CNY]]></fee_type>
- <is_subscribe><![CDATA[N]]></is_subscribe>
- <mch_id><![CDATA[1380733702]]></mch_id>
- <nonce_str><![CDATA[0al5w566fsnpvn56zoo5lbf59kymmhbs]]></nonce_str>
- <openid><![CDATA[oQH7D5My2UkjSWv-7YYwM-faZ_3c]]></openid>
- <out_trade_no><![CDATA[590604488911416534686]]></out_trade_no>
- <result_code><![CDATA[SUCCESS]]></result_code>
- <return_code><![CDATA[SUCCESS]]></return_code>
- <sign><![CDATA[7C677137D72376B9B1815D1F084FC068]]></sign>
- <time_end><![CDATA[20190226093533]]></time_end>
- <total_fee>15400</total_fee>
- <trade_type><![CDATA[MWEB]]></trade_type>
- <transaction_id><![CDATA[4200000279201902260421273158]]></transaction_id>
- </xml>^M';
- $resp = http_post_data('https://www.xyzshops.cn/mobile/web_wxnotify.php',$body);
- }
- public function testPostData()
- {
- $msg = "1柜门1箱门,取件码59368";
- $postData['orderCode'] = '4312431431431265900431';
- $postData['boxMsg'] = $msg;
- $count = 1000;
- do{
- $resp = http_post_data('https://yxmall-adminportal.eavic.com/oms-web/box/deliver',json_encode($postData));
- Log::record($resp,Log::DEBUG);
- }
- while($count--);
- }
- }
|