pay_helperTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/6/15
  6. * Time: 下午3:12
  7. */
  8. class pay_helperTest extends PHPUnit_Framework_TestCase
  9. {
  10. public function testAdd()
  11. {
  12. $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";}');
  13. $mobiles = array();
  14. $mobiles['139111269867'] = '江海苗C';
  15. $mobiles['139111269868'] = '江海苗C';
  16. $mobiles['139111269869'] = '江海苗C';
  17. }
  18. public function testSerialize()
  19. {
  20. $data = array (
  21. 'home1_title' => '今年春节放几天假',
  22. 'image' => '',
  23. 'show_type' => 'vote',
  24. 'show_data' => '',
  25. 'type' => 'vote',
  26. 'data' => '[{"id":0,"text":"\\u4e00\\u5929"},{"id":1,"text":"\\u4e24\\u5929"},{"id":2,"text":"\\u4e09\\u5929"}]',
  27. 'title' => '今年春节放几天假',
  28. 'reserved' => 'vote_type=0',
  29. );
  30. $x = serialize($data);
  31. $y = unserialize($x);
  32. }
  33. }