123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/15
- * Time: 下午3:12
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- 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');
- class TestPay extends PHPUnit_Framework_TestCase
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public static function tearDownAfterClass()
- {
- }
- 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://passport.lrlz.com/mobile/web_wxnotify.php',$body);
- }
- }
|