| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function testUserInfo() |
||
| 26 | { |
||
| 27 | // 模拟返回数据 |
||
| 28 | $mockData = [ |
||
|
|
|||
| 29 | 'openid' => 'test_openid', |
||
| 30 | 'nickname' => 'test_name', |
||
| 31 | 'sex' => 1, |
||
| 32 | 'headimgurl' => 'http://test.com/avatar.jpg', |
||
| 33 | ]; |
||
| 34 | |||
| 35 | // 验证返回格式 |
||
| 36 | $userInfo = [ |
||
| 37 | 'open_id' => 'test_openid', |
||
| 38 | 'union_id' => '', |
||
| 39 | 'channel' => ConstCode::TYPE_WECHAT, |
||
| 40 | 'nickname' => 'test_name', |
||
| 41 | 'gender' => 1, |
||
| 42 | 'avatar' => 'http://test.com/avatar.jpg', |
||
| 43 | 'type' => ConstCode::getTypeConst(ConstCode::TYPE_WECHAT, null), |
||
| 44 | ]; |
||
| 45 | |||
| 46 | $this->assertEquals($userInfo['channel'], ConstCode::TYPE_WECHAT); |
||
| 47 | } |
||
| 48 | } |