]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Merge pull request #8770 from annando/probing
[friendica.git] / tests / datasets / api.fixture.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 return [
23         // Empty these tables
24         'cache',
25         'conversation',
26         'pconfig',
27         'photo',
28         'workerqueue',
29         'mail',
30         'post-delivery-data',
31         // Base test config to avoid notice messages
32         'config'  => [
33                 [
34                         'cat' => 'system',
35                         'k'   => 'url',
36                         'v'   => 'http://localhost',
37                 ],
38                 [
39                         'cat' => 'config',
40                         'k'   => 'hostname',
41                         'v'   => 'localhost',
42                 ],
43                 [
44                         'cat' => 'system',
45                         'k'   => 'worker_dont_fork',
46                         'v'   => '1',
47                 ],
48         ],
49         'user'    => [
50                 [
51                         'uid'      => 42,
52                         'username' => 'Test user',
53                         'nickname' => 'selfcontact',
54                         'verified' => 1,
55                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
56                         'theme'    => 'frio',
57                 ],
58         ],
59         'contact' => [
60                 [
61                         'id'      => 42,
62                         'uid'     => 42,
63                         'name'    => 'Self contact',
64                         'nick'    => 'selfcontact',
65                         'self'    => 1,
66                         'nurl'    => 'http://localhost/profile/selfcontact',
67                         'url'     => 'http://localhost/profile/selfcontact',
68                         'about'   => 'User used in tests',
69                         'pending' => 0,
70                         'blocked' => 0,
71                         'rel'     => 1,
72                         'network' => 'dfrn',
73                 ],
74                 // Having the same name and nick allows us to test
75                 // the fallback to api_get_nick() in api_get_user()
76                 [
77                         'id'      => 43,
78                         'uid'     => 0,
79                         'name'    => 'othercontact',
80                         'nick'    => 'othercontact',
81                         'self'    => 0,
82                         'nurl'    => 'http://localhost/profile/othercontact',
83                         'url'     => 'http://localhost/profile/othercontact',
84                         'pending' => 0,
85                         'blocked' => 0,
86                         'rel'     => 0,
87                         'network' => 'dfrn',
88                 ],
89                 [
90                         'id'      => 44,
91                         'uid'     => 42,
92                         'name'    => 'Friend contact',
93                         'nick'    => 'friendcontact',
94                         'self'    => 0,
95                         'nurl'    => 'http://localhost/profile/friendcontact',
96                         'url'     => 'http://localhost/profile/friendcontact',
97                         'pending' => 0,
98                         'blocked' => 0,
99                         'rel'     => 2,
100                         'network' => 'dfrn',
101                 ],
102                 [
103                         'id'      => 45,
104                         'uid'     => 0,
105                         'name'    => 'Friend contact',
106                         'nick'    => 'friendcontact',
107                         'self'    => 0,
108                         'nurl'    => 'http://localhost/profile/friendcontact',
109                         'url'     => 'http://localhost/profile/friendcontact',
110                         'pending' => 0,
111                         'blocked' => 0,
112                         'rel'     => 2,
113                         'network' => 'dfrn',
114                 ],
115                 [
116                         'id'      => 46,
117                         'uid'     => 42,
118                         'name'    => 'Mutual contact',
119                         'nick'    => 'mutualcontact',
120                         'self'    => 0,
121                         'nurl'    => 'http://localhost/profile/mutualcontact',
122                         'url'     => 'http://localhost/profile/mutualcontact',
123                         'pending' => 0,
124                         'blocked' => 0,
125                         'rel'     => 3,
126                         'network' => 'dfrn',
127                 ],
128                 [
129                         'id'      => 47,
130                         'uid'     => 0,
131                         'name'    => 'Mutual contact',
132                         'nick'    => 'mutualcontact',
133                         'self'    => 0,
134                         'nurl'    => 'http://localhost/profile/mutualcontact',
135                         'url'     => 'http://localhost/profile/mutualcontact',
136                         'pending' => 0,
137                         'blocked' => 0,
138                         'rel'     => 2,
139                         'network' => 'dfrn',
140                 ],
141         ],
142         'item-uri'    => [
143                 [
144                         'id'   => 1,
145                         'uri'  => '1',
146                         'guid' => '1',
147                 ],
148                 [
149                         'id'   => 2,
150                         'uri'  => '2',
151                         'guid' => '2',
152                 ],
153                 [
154                         'id'   => 3,
155                         'uri'  => '3',
156                         'guid' => '3',
157                 ],
158                 [
159                         'id'   => 4,
160                         'uri'  => '4',
161                         'guid' => '4',
162                 ],
163                 [
164                         'id'   => 5,
165                         'uri'  => '5',
166                         'guid' => '5',
167                 ],
168                 [
169                         'id'   => 6,
170                         'uri'  => '6',
171                         'guid' => '6',
172                 ],
173         ],
174         'item'    => [
175                 [
176                         'id'          => 1,
177                         'uri-id'      => 1,
178                         'visible'     => 1,
179                         'contact-id'  => 42,
180                         'author-id'   => 42,
181                         'owner-id'    => 42,
182                         'uid'         => 42,
183                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
184                         'unseen'      => 1,
185                         'body'        => 'Parent status',
186                         'parent'      => 1,
187                         'author-link' => 'http://localhost/profile/selfcontact',
188                         'wall'        => 1,
189                         'starred'     => 1,
190                         'origin'      => 1,
191                         'allow_cid'   => '',
192                         'allow_gid'   => '',
193                         'deny_cid'    => '',
194                         'deny_gid'    => '',
195                 ],
196                 [
197                         'id'          => 2,
198                         'uri-id'      => 2,
199                         'visible'     => 1,
200                         'contact-id'  => 42,
201                         'author-id'   => 42,
202                         'owner-id'    => 42,
203                         'uid'         => 42,
204                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
205                         'unseen'      => 0,
206                         'body'        => 'Reply',
207                         'parent'      => 1,
208                         'author-link' => 'http://localhost/profile/selfcontact',
209                         'wall'        => 1,
210                         'starred'     => 0,
211                         'origin'      => 1,
212                 ],
213                 [
214
215                         'id'          => 3,
216                         'uri-id'      => 3,
217                         'visible'     => 1,
218                         'contact-id'  => 43,
219                         'author-id'   => 43,
220                         'owner-id'    => 42,
221                         'uid'         => 42,
222                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
223                         'unseen'      => 0,
224                         'body'        => 'Other user status',
225                         'parent'      => 3,
226                         'author-link' => 'http://localhost/profile/othercontact',
227                         'wall'        => 1,
228                         'starred'     => 0,
229                         'origin'      => 1,
230                 ],
231                 [
232                         'id'          => 4,
233                         'uri-id'      => 4,
234                         'visible'     => 1,
235                         'contact-id'  => 44,
236                         'author-id'   => 44,
237                         'owner-id'    => 42,
238                         'uid'         => 42,
239                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
240                         'unseen'      => 0,
241                         'body'        => 'Friend user reply',
242                         'parent'      => 1,
243                         'author-link' => 'http://localhost/profile/othercontact',
244                         'wall'        => 1,
245                         'starred'     => 0,
246                         'origin'      => 1,
247                 ],
248                 [
249
250                         'id'          => 5,
251                         'uri-id'      => 5,
252                         'visible'     => 1,
253                         'contact-id'  => 42,
254                         'author-id'   => 42,
255                         'owner-id'    => 42,
256                         'uid'         => 42,
257                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
258                         'unseen'      => 0,
259                         'body'        => '[share]Shared status[/share]',
260                         'parent'      => 1,
261                         'author-link' => 'http://localhost/profile/othercontact',
262                         'wall'        => 1,
263                         'starred'     => 0,
264                         'origin'      => 1,
265                         'allow_cid'   => '',
266                         'allow_gid'   => '',
267                         'deny_cid'    => '',
268                         'deny_gid'    => '',
269                 ],
270                 [
271                         'id'          => 6,
272                         'uri-id'      => 6,
273                         'visible'     => 1,
274                         'contact-id'  => 44,
275                         'author-id'   => 44,
276                         'owner-id'    => 42,
277                         'uid'         => 42,
278                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
279                         'unseen'      => 0,
280                         'body'        => 'Friend user status',
281                         'parent'      => 6,
282                         'author-link' => 'http://localhost/profile/othercontact',
283                         'wall'        => 1,
284                         'starred'     => 0,
285                         'origin'      => 1,
286                 ],
287         ],
288         'notify' => [
289                 [
290                         'id' => 1,
291                         'type' => 8,
292                         'name' => 'Reply to',
293                         'url' => 'http://localhost/display/1',
294                         'photo' => 'http://localhost/',
295                         'date' => '2020-01-01 12:12:02',
296                         'msg' => 'A test reply from an item',
297                         'uid' => 42,
298                         'link' => 'http://localhost/notification/1',
299                         'iid' => 4,
300                         'seen' => 0,
301                         'verb' => '',
302                         'otype' => 'item',
303                         'name_cache' => 'Reply to',
304                         'msg_cache' => 'A test reply from an item',
305                 ],
306         ],
307         'thread'  => [
308                 [
309                         'iid'        => 1,
310                         'uri-id'     => 1,
311                         'visible'    => 1,
312                         'contact-id' => 42,
313                         'author-id'  => 42,
314                         'owner-id'   => 42,
315                         'uid'        => 42,
316                         'wall'       => 1,
317                 ],
318                 [
319                         'iid'        => 3,
320                         'uri-id'     => 3,
321                         'visible'    => 1,
322                         'contact-id' => 43,
323                         'author-id'  => 43,
324                         'owner-id'   => 43,
325                         'uid'        => 0,
326                         'wall'       => 1,
327                 ],
328                 [
329                         'iid'        => 6,
330                         'uri-id'     => 6,
331                         'visible'    => 1,
332                         'contact-id' => 44,
333                         'author-id'  => 44,
334                         'owner-id'   => 44,
335                         'uid'        => 0,
336                         'wall'       => 1,
337                 ],
338         ],
339         'profile' => [
340                 [
341                         'id' => 1,
342                         'uid' => 42,
343                 ],
344         ],
345         'group'   => [
346                 [
347                         'id'      => 1,
348                         'uid'     => 42,
349                         'visible' => 1,
350                         'name'    => 'Visible list',
351                 ],
352                 [
353                         'id'      => 2,
354                         'uid'     => 42,
355                         'visible' => 0,
356                         'name'    => 'Private list',
357                 ],
358         ],
359         'search'  => [
360                 [
361                         'id'   => 1,
362                         'term' => 'Saved search',
363                         'uid'  => 42,
364                 ],
365         ],
366 ];