123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/15
- * Time: 下午3:12
- */
- class TestPay extends PHPUnit_Framework_TestCase
- {
- 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);
- }
- }
|