TestPay.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/6/15
  6. * Time: 下午3:12
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once (BASE_ROOT_PATH . '/fooder.php');
  10. require_once (BASE_ROOT_PATH . '/helper/util_helper.php');
  11. require_once (BASE_ROOT_PATH . '/helper/pay/IPay.php');
  12. require_once (BASE_ROOT_PATH . '/helper/pay/aopay.php');
  13. class TestPay extends PHPUnit_Framework_TestCase
  14. {
  15. public static function setUpBeforeClass()
  16. {
  17. Base::run_util();
  18. }
  19. public static function tearDownAfterClass()
  20. {
  21. }
  22. public function testAdd()
  23. {
  24. $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";}');
  25. $mobiles = array();
  26. $mobiles['139111269867'] = '江海苗C';
  27. $mobiles['139111269868'] = '江海苗C';
  28. $mobiles['139111269869'] = '江海苗C';
  29. }
  30. public function testSerialize()
  31. {
  32. $data = array (
  33. 'home1_title' => '今年春节放几天假',
  34. 'image' => '',
  35. 'show_type' => 'vote',
  36. 'show_data' => '',
  37. 'type' => 'vote',
  38. 'data' => '[{"id":0,"text":"\\u4e00\\u5929"},{"id":1,"text":"\\u4e24\\u5929"},{"id":2,"text":"\\u4e09\\u5929"}]',
  39. 'title' => '今年春节放几天假',
  40. 'reserved' => 'vote_type=0',
  41. );
  42. $x = serialize($data);
  43. $y = unserialize($x);
  44. }
  45. public function testAopay()
  46. {
  47. $payer = new Pay\aopay();
  48. $ret = $payer->gen_pay('100510761183646482',0.01,'8000000000002204',"实物订单");
  49. }
  50. }