1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of graze/gigya-client |
4
|
|
|
* |
5
|
|
|
* Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* @license https://github.com/graze/gigya-client/blob/master/LICENSE.md |
11
|
|
|
* @link https://github.com/graze/gigya-client |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Graze\Gigya\Test; |
15
|
|
|
|
16
|
|
|
class TestFixtures |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @param string $name |
20
|
|
|
* |
21
|
|
|
* @return string|null |
22
|
|
|
*/ |
23
|
|
|
public static function getFixture($name) |
24
|
|
|
{ |
25
|
|
|
if (array_key_exists($name, static::$fixtures)) { |
26
|
|
|
return static::$fixtures[$name]; |
27
|
|
|
} else { |
28
|
|
|
return null; |
29
|
|
|
} |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** @var array */ |
33
|
|
|
protected static $fixtures = [ |
34
|
|
|
'accounts.getAccountInfo' => '{ |
35
|
|
|
"UID": "_gid_30A3XVJciH95WEEnoRmfZS7ee3MY+lUAtpVxvUWNseU=", |
36
|
|
|
"UIDSignature": "HHPLo/TC7KobjnGB7JflcWvAXfg=", |
37
|
|
|
"signatureTimestamp": "1412516469", |
38
|
|
|
"loginProvider": "facebook", |
39
|
|
|
"isRegistered": true, |
40
|
|
|
"isActive": true, |
41
|
|
|
"isLockedOut": false, |
42
|
|
|
"isVerified": true, |
43
|
|
|
"iRank": 57.3400, |
44
|
|
|
"loginIDs": { |
45
|
|
|
"emails": [], |
46
|
|
|
"unverifiedEmails": [] |
47
|
|
|
}, |
48
|
|
|
"emails": { |
49
|
|
|
"verified": [ |
50
|
|
|
"[email protected]" |
51
|
|
|
], |
52
|
|
|
"unverified": [] |
53
|
|
|
}, |
54
|
|
|
"socialProviders": "facebook,site", |
55
|
|
|
"profile": { |
56
|
|
|
"firstName": "Pinky", |
57
|
|
|
"lastName": "Ray", |
58
|
|
|
"photoURL": "https://graph.facebook.com/v2.0/10204456750325770/picture?type=large", |
59
|
|
|
"thumbnailURL": "https://graph.facebook.com/v2.0/10204456750325770/picture?type=square", |
60
|
|
|
"birthYear": 1980, |
61
|
|
|
"birthMonth": 4, |
62
|
|
|
"birthDay": 22, |
63
|
|
|
"profileURL": "https://www.facebook.com/app_scoped_user_id/10204456750325770/", |
64
|
|
|
"city": "Athens, Greece", |
65
|
|
|
"gender": "m", |
66
|
|
|
"age": 34, |
67
|
|
|
"email": "[email protected]", |
68
|
|
|
"samlData": {} |
69
|
|
|
}, |
70
|
|
|
"identities": [ |
71
|
|
|
{ |
72
|
|
|
"provider": "facebook", |
73
|
|
|
"providerUID": "10204456750325770", |
74
|
|
|
"isLoginIdentity": true, |
75
|
|
|
"photoURL": "https://graph.facebook.com/v2.0/10204456750325770/picture?type=large", |
76
|
|
|
"thumbnailURL": "https://graph.facebook.com/v2.0/10204456750325770/picture?type=square", |
77
|
|
|
"firstName": "Pinky", |
78
|
|
|
"lastName": "Ray", |
79
|
|
|
"gender": "m", |
80
|
|
|
"age": "34", |
81
|
|
|
"birthDay": "22", |
82
|
|
|
"birthMonth": "4", |
83
|
|
|
"birthYear": "1980", |
84
|
|
|
"email": "[email protected]", |
85
|
|
|
"city": "Athens, Greece", |
86
|
|
|
"profileURL": "https://www.facebook.com/app_scoped_user_id/10204456750325770/", |
87
|
|
|
"proxiedEmail": "", |
88
|
|
|
"allowsLogin": true, |
89
|
|
|
"isExpiredSession": false, |
90
|
|
|
"lastUpdated": "2014-10-05T13:35:14.039Z", |
91
|
|
|
"lastUpdatedTimestamp": 1412516114039, |
92
|
|
|
"oldestDataUpdated": "2014-10-05T13:35:13.421Z", |
93
|
|
|
"oldestDataUpdatedTimestamp": 1412516113421 |
94
|
|
|
}, |
95
|
|
|
{ |
96
|
|
|
"provider": "site", |
97
|
|
|
"providerUID": "_gid_30A3XVJciH95WEEnoRmfZS7ee3MY+lUAtpVxvUWNseU=", |
98
|
|
|
"isLoginIdentity": false, |
99
|
|
|
"allowsLogin": false, |
100
|
|
|
"isExpiredSession": false, |
101
|
|
|
"lastUpdated": "2014-10-05T13:39:53.455Z", |
102
|
|
|
"lastUpdatedTimestamp": 1412516393455, |
103
|
|
|
"oldestDataUpdated": "2014-10-05T13:39:53.455Z", |
104
|
|
|
"oldestDataUpdatedTimestamp": 1412516393455 |
105
|
|
|
} |
106
|
|
|
], |
107
|
|
|
"data": { |
108
|
|
|
"hair": "blond" |
109
|
|
|
}, |
110
|
|
|
"password": {}, |
111
|
|
|
"tfaStatus": "forceOff", |
112
|
|
|
"created": "2014-09-27T23:47:41.527Z", |
113
|
|
|
"createdTimestamp": 1411861661527, |
114
|
|
|
"lastLogin": "2014-10-05T13:35:13.437Z", |
115
|
|
|
"lastLoginTimestamp": 1412516113437, |
116
|
|
|
"lastUpdated": "2014-10-05T13:39:53.455Z", |
117
|
|
|
"lastUpdatedTimestamp": 1412516393455, |
118
|
|
|
"oldestDataUpdated": "2014-10-05T13:35:13.421Z", |
119
|
|
|
"oldestDataUpdatedTimestamp": 1412516113421, |
120
|
|
|
"registered": "2014-09-27T23:47:41.59Z", |
121
|
|
|
"registeredTimestamp": 1411861661590, |
122
|
|
|
"verified": "2014-09-27T23:47:41.543Z", |
123
|
|
|
"verifiedTimestamp": 1411861661543, |
124
|
|
|
"regSource": "", |
125
|
|
|
"lastLoginLocation": { |
126
|
|
|
"country": "IL", |
127
|
|
|
"coordinates": { |
128
|
|
|
"lat": 31.5, |
129
|
|
|
"lon": 34.75 |
130
|
|
|
} |
131
|
|
|
}, |
132
|
|
|
"statusCode": 200, |
133
|
|
|
"errorCode": 0, |
134
|
|
|
"statusReason": "OK", |
135
|
|
|
"callId": "e6f891ac17f24810bee6eb533524a152", |
136
|
|
|
"time": "2015-03-22T11:42:25.943Z" |
137
|
|
|
}', |
138
|
|
|
'accounts.search_simple' => '{"results": [ |
139
|
|
|
{"profile": {"email": "[email protected]"} }, |
140
|
|
|
{"profile": {"firstName": "George", "lastName": "Lucas", "email": "[email protected]" } }, |
141
|
|
|
{"profile": {"firstName": "Paris", "lastName": "Radisson" } }, |
142
|
|
|
{"profile": {"firstName": "Barry", "lastName": "Ray", "email": "[email protected]" } }, |
143
|
|
|
{"profile": {"firstName": "Tina", "lastName": "Tuna", "email": "[email protected]" } } ], |
144
|
|
|
"objectsCount": 5, |
145
|
|
|
"totalCount": 1840, |
146
|
|
|
"statusCode": 200, |
147
|
|
|
"errorCode": 0, |
148
|
|
|
"statusReason": "OK", |
149
|
|
|
"callId": "123456", |
150
|
|
|
"time": "2015-03-22T11:42:25.943Z" |
151
|
|
|
}', |
152
|
|
|
'basic' => '{ |
153
|
|
|
"statusCode": 200, |
154
|
|
|
"errorCode": 0, |
155
|
|
|
"statusReason": "OK", |
156
|
|
|
"callId": "123456", |
157
|
|
|
"time": "2015-03-22T11:42:25.943Z" |
158
|
|
|
}', |
159
|
|
|
'failure_403' => '{ |
160
|
|
|
"errorCode": 403005, |
161
|
|
|
"errorMessage": "Unauthorized user", |
162
|
|
|
"errorDetails": "The user billyBob cannot login", |
163
|
|
|
"statusCode": 403, |
164
|
|
|
"statusReason": "Forbidden", |
165
|
|
|
"callId": "d8b041336e354a789553830705203779", |
166
|
|
|
"time": "2015-03-22T11:42:25.943Z" |
167
|
|
|
}', |
168
|
|
|
'missing_field' => '{ |
169
|
|
|
"errorCode": 403005, |
170
|
|
|
"errorMessage": "Unauthorized user", |
171
|
|
|
"errorDetails": "The user billyBob cannot login", |
172
|
|
|
"statusCode": 403, |
173
|
|
|
"callId": "d8b041336e354a789553830705203779", |
174
|
|
|
"time": "2015-03-22T11:42:25.943Z" |
175
|
|
|
}', |
176
|
|
|
'invalid_json' => '{ |
177
|
|
|
"errorCode": 403005, |
178
|
|
|
"errorMessage": "Unauthorized user", |
179
|
|
|
"statusCode": 403,', |
180
|
|
|
]; |
181
|
|
|
} |
182
|
|
|
|