]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
3e9e53164691e0a105c1ad999c668224d75f0f08
[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 use Friendica\Model\Notification;
23
24 return [
25         // Empty these tables
26         'cache',
27         'conversation',
28         'pconfig',
29         'photo',
30         'workerqueue',
31         'mail',
32         'post-delivery-data',
33         // Base test config to avoid notice messages
34         'config'  => [
35                 [
36                         'cat' => 'system',
37                         'k'   => 'url',
38                         'v'   => 'http://localhost',
39                 ],
40                 [
41                         'cat' => 'config',
42                         'k'   => 'hostname',
43                         'v'   => 'localhost',
44                 ],
45                 [
46                         'cat' => 'system',
47                         'k'   => 'worker_dont_fork',
48                         'v'   => '1',
49                 ],
50         ],
51         'user'    => [
52                 [
53                         'uid'      => 42,
54                         'username' => 'Test user',
55                         'nickname' => 'selfcontact',
56                         'verified' => 1,
57                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
58                         'theme'    => 'frio',
59                 ],
60         ],
61         'contact' => [
62                 [
63                         'id'      => 42,
64                         'uid'     => 42,
65                         'name'    => 'Self contact',
66                         'nick'    => 'selfcontact',
67                         'self'    => 1,
68                         'nurl'    => 'http://localhost/profile/selfcontact',
69                         'url'     => 'http://localhost/profile/selfcontact',
70                         'about'   => 'User used in tests',
71                         'pending' => 0,
72                         'blocked' => 0,
73                         'rel'     => 1,
74                         'network' => 'dfrn',
75                         'location' => 'DFRN',
76                 ],
77                 // Having the same name and nick allows us to test
78                 // the fallback to api_get_nick() in api_get_user()
79                 [
80                         'id'      => 43,
81                         'uid'     => 0,
82                         'name'    => 'othercontact',
83                         'nick'    => 'othercontact',
84                         'self'    => 0,
85                         'nurl'    => 'http://localhost/profile/othercontact',
86                         'url'     => 'http://localhost/profile/othercontact',
87                         'pending' => 0,
88                         'blocked' => 0,
89                         'rel'     => 0,
90                         'network' => 'dfrn',
91                         'location' => 'DFRN',
92                 ],
93                 [
94                         'id'      => 44,
95                         'uid'     => 42,
96                         'name'    => 'Friend contact',
97                         'nick'    => 'friendcontact',
98                         'self'    => 0,
99                         'nurl'    => 'http://localhost/profile/friendcontact',
100                         'url'     => 'http://localhost/profile/friendcontact',
101                         'pending' => 0,
102                         'blocked' => 0,
103                         'rel'     => 2,
104                         'network' => 'dfrn',
105                         'location' => 'DFRN',
106                 ],
107                 [
108                         'id'      => 45,
109                         'uid'     => 0,
110                         'name'    => 'Friend contact',
111                         'nick'    => 'friendcontact',
112                         'self'    => 0,
113                         'nurl'    => 'http://localhost/profile/friendcontact',
114                         'url'     => 'http://localhost/profile/friendcontact',
115                         'pending' => 0,
116                         'blocked' => 0,
117                         'rel'     => 2,
118                         'network' => 'dfrn',
119                         'location' => 'DFRN',
120                 ],
121                 [
122                         'id'      => 46,
123                         'uid'     => 42,
124                         'name'    => 'Mutual contact',
125                         'nick'    => 'mutualcontact',
126                         'self'    => 0,
127                         'nurl'    => 'http://localhost/profile/mutualcontact',
128                         'url'     => 'http://localhost/profile/mutualcontact',
129                         'pending' => 0,
130                         'blocked' => 0,
131                         'rel'     => 3,
132                         'network' => 'dfrn',
133                         'location' => 'DFRN',
134                 ],
135                 [
136                         'id'      => 47,
137                         'uid'     => 0,
138                         'name'    => 'Mutual contact',
139                         'nick'    => 'mutualcontact',
140                         'self'    => 0,
141                         'nurl'    => 'http://localhost/profile/mutualcontact',
142                         'url'     => 'http://localhost/profile/mutualcontact',
143                         'pending' => 0,
144                         'blocked' => 0,
145                         'rel'     => 2,
146                         'network' => 'dfrn',
147                         'location' => 'DFRN',
148                 ],
149         ],
150         'item-uri'    => [
151                 [
152                         'id'   => 1,
153                         'uri'  => '1',
154                         'guid' => '1',
155                 ],
156                 [
157                         'id'   => 2,
158                         'uri'  => '2',
159                         'guid' => '2',
160                 ],
161                 [
162                         'id'   => 3,
163                         'uri'  => '3',
164                         'guid' => '3',
165                 ],
166                 [
167                         'id'   => 4,
168                         'uri'  => '4',
169                         'guid' => '4',
170                 ],
171                 [
172                         'id'   => 5,
173                         'uri'  => '5',
174                         'guid' => '5',
175                 ],
176                 [
177                         'id'   => 6,
178                         'uri'  => '6',
179                         'guid' => '6',
180                 ],
181         ],
182         'post-content' => [
183                 [
184                         'uri-id' => 1,
185                         'body'   => 'Parent status',
186                         'plink'  => 'http://localhost/display/1',
187                 ],
188                 [
189                         'uri-id' => 2,
190                         'body'   => 'Reply',
191                         'plink'  => 'http://localhost/display/2',
192                 ],
193                 [
194                         'uri-id' => 3,
195                         'body'   => 'Other user status',
196                         'plink'  => 'http://localhost/display/3',
197                 ],
198                 [
199                         'uri-id' => 4,
200                         'body'   => 'Friend user reply',
201                         'plink'  => 'http://localhost/display/4',
202                 ],
203                 [
204                         'uri-id' => 5,
205                         'body'   => '[share]Shared status[/share]',
206                         'plink'  => 'http://localhost/display/5',
207                 ],
208                 [
209                         'uri-id' => 6,
210                         'body'   => 'Friend user status',
211                         'plink'  => 'http://localhost/display/6',
212                 ],
213         ],
214         'post-thread'  => [
215                 [
216                         'uri-id'     => 1,
217                         'author-id'  => 42,
218                         'owner-id'   => 42,
219                         'causer-id'  => 42,
220                         'network' => 'dfrn',
221                 ],
222                 [
223                         'uri-id'     => 3,
224                         'author-id'  => 43,
225                         'owner-id'   => 43,
226                         'causer-id'  => 43,
227                         'network' => 'dfrn',
228                 ],
229                 [
230                         'uri-id'     => 6,
231                         'author-id'  => 44,
232                         'owner-id'   => 44,
233                         'causer-id'  => 44,
234                         'network' => 'dfrn',
235                 ],
236         ],
237         'post-thread-user'  => [
238                 [
239                         'uri-id'     => 1,
240                         'uid'        => 42,
241                         'wall'       => 1,
242                 ],
243                 [
244                         'uri-id'     => 3,
245                         'uid'        => 42,
246                         'wall'       => 1,
247                 ],
248                 [
249                         'uri-id'     => 6,
250                         'uid'        => 42,
251                         'wall'       => 1,
252                 ],
253         ],
254         'post-user' => [
255                 [
256                         'id'          => 1,
257                         'uri-id'      => 1,
258                         'uid'         => 42,
259                         'contact-id'  => 42,
260                         'unseen'      => 1,
261                         'origin'      => 1,
262                 ],
263                 [
264                         'id'          => 2,
265                         'uri-id'      => 2,
266                         'uid'         => 42,
267                         'contact-id'  => 42,
268                         'unseen'      => 0,
269                         'origin'      => 1,
270                 ],
271                 [
272                         'id'          => 3,
273                         'uri-id'      => 3,
274                         'uid'         => 42,
275                         'contact-id'  => 43,
276                         'unseen'      => 0,
277                         'origin'      => 1,
278                 ],
279                 [
280                         'id'          => 4,
281                         'uri-id'      => 4,
282                         'uid'         => 42,
283                         'contact-id'  => 44,
284                         'unseen'      => 0,
285                         'origin'      => 1,
286                 ],
287                 [
288                         'id'          => 5,
289                         'uri-id'      => 5,
290                         'uid'         => 42,
291                         'contact-id'  => 42,
292                         'unseen'      => 0,
293                         'origin'      => 1,
294                 ],
295                 [
296                         'id'          => 6,
297                         'uri-id'      => 6,
298                         'uid'         => 42,
299                         'contact-id'  => 44,
300                         'unseen'      => 0,
301                         'origin'      => 1,
302                 ],
303
304         ],
305         'item'    => [
306                 [
307                         'id'          => 1,
308                         'uri-id'      => 1,
309                         'uri'         => '1',
310                         'visible'     => 1,
311                         'contact-id'  => 42,
312                         'author-id'   => 42,
313                         'owner-id'    => 42,
314                         'causer-id'   => 42,
315                         'uid'         => 42,
316                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
317                         'unseen'      => 1,
318                         'parent'      => 1,
319                         'parent-uri-id' => 1,
320                         'parent-uri'  => '1',
321                         'thr-parent-id' => 1,
322                         'thr-parent'  => '1',
323                         'gravity'     => GRAVITY_PARENT,
324                         'author-link' => 'http://localhost/profile/selfcontact',
325                         'wall'        => 1,
326                         'starred'     => 1,
327                         'origin'      => 1,
328                         'allow_cid'   => '',
329                         'allow_gid'   => '',
330                         'deny_cid'    => '',
331                         'deny_gid'    => '',
332                         'guid'        => '1',
333                 ],
334                 [
335                         'id'          => 2,
336                         'uri-id'      => 2,
337                         'uri'         => '2',
338                         'visible'     => 1,
339                         'contact-id'  => 42,
340                         'author-id'   => 42,
341                         'owner-id'    => 42,
342                         'causer-id'   => 42,
343                         'uid'         => 42,
344                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
345                         'unseen'      => 0,
346                         'parent'      => 1,
347                         'parent-uri-id' => 1,
348                         'parent-uri'  => '1',
349                         'thr-parent-id' => 1,
350                         'thr-parent'  => '1',
351                         'gravity'     => GRAVITY_COMMENT,
352                         'author-link' => 'http://localhost/profile/selfcontact',
353                         'wall'        => 1,
354                         'starred'     => 0,
355                         'origin'      => 1,
356                         'guid'        => '2',
357                 ],
358                 [
359                         'id'          => 3,
360                         'uri-id'      => 3,
361                         'uri'         => '3',
362                         'visible'     => 1,
363                         'contact-id'  => 43,
364                         'author-id'   => 43,
365                         'owner-id'    => 42,
366                         'causer-id'   => 43,
367                         'uid'         => 42,
368                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
369                         'unseen'      => 0,
370                         'parent'      => 3,
371                         'parent-uri-id' => 3,
372                         'parent-uri'  => '3',
373                         'thr-parent-id' => 3,
374                         'thr-parent'  => '3',
375                         'gravity'     => GRAVITY_PARENT,
376                         'author-link' => 'http://localhost/profile/othercontact',
377                         'wall'        => 1,
378                         'starred'     => 0,
379                         'origin'      => 1,
380                         'guid'        => '3',
381                 ],
382                 [
383                         'id'          => 4,
384                         'uri-id'      => 4,
385                         'uri'         => '4',
386                         'visible'     => 1,
387                         'contact-id'  => 44,
388                         'author-id'   => 44,
389                         'owner-id'    => 42,
390                         'causer-id'   => 44,
391                         'uid'         => 42,
392                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
393                         'unseen'      => 0,
394                         'body'        => 'Friend user reply',
395                         'parent'      => 1,
396                         'parent-uri-id' => 1,
397                         'parent-uri'  => '1',
398                         'thr-parent-id' => 1,
399                         'thr-parent'  => '1',
400                         'gravity'     => GRAVITY_COMMENT,
401                         'author-link' => 'http://localhost/profile/othercontact',
402                         'wall'        => 1,
403                         'starred'     => 0,
404                         'origin'      => 1,
405                         'guid'        => '4',
406                 ],
407                 [
408
409                         'id'          => 5,
410                         'uri-id'      => 5,
411                         'uri'         => '5',
412                         'visible'     => 1,
413                         'contact-id'  => 42,
414                         'author-id'   => 42,
415                         'owner-id'    => 42,
416                         'causer-id'   => 42,
417                         'uid'         => 42,
418                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
419                         'unseen'      => 0,
420                         'parent'      => 1,
421                         'parent-uri-id' => 1,
422                         'parent-uri'  => '1',
423                         'thr-parent-id' => 1,
424                         'thr-parent'  => '1',
425                         'gravity'     => GRAVITY_COMMENT,
426                         'author-link' => 'http://localhost/profile/othercontact',
427                         'wall'        => 1,
428                         'starred'     => 0,
429                         'origin'      => 1,
430                         'allow_cid'   => '',
431                         'allow_gid'   => '',
432                         'deny_cid'    => '',
433                         'deny_gid'    => '',
434                         'guid'        => '5',
435                 ],
436                 [
437                         'id'          => 6,
438                         'uri-id'      => 6,
439                         'uri'         => '6',
440                         'visible'     => 1,
441                         'contact-id'  => 44,
442                         'author-id'   => 44,
443                         'owner-id'    => 42,
444                         'causer-id'   => 44,
445                         'uid'         => 42,
446                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
447                         'unseen'      => 0,
448                         'parent'      => 6,
449                         'parent-uri-id' => 6,
450                         'parent-uri'  => '6',
451                         'thr-parent-id' => 6,
452                         'thr-parent'  => '6',
453                         'gravity'     => GRAVITY_PARENT,
454                         'author-link' => 'http://localhost/profile/othercontact',
455                         'wall'        => 1,
456                         'starred'     => 0,
457                         'origin'      => 1,
458                         'guid'        => '6',
459                 ],
460         ],
461         'notify' => [
462                 [
463                         'id' => 1,
464                         'type' => 8,
465                         'name' => 'Reply to',
466                         'url' => 'http://localhost/display/1',
467                         'photo' => 'http://localhost/',
468                         'date' => '2020-01-01 12:12:02',
469                         'msg' => 'A test reply from an item',
470                         'uid' => 42,
471                         'link' => 'http://localhost/notification/1',
472                         'iid' => 4,
473                         'seen' => 0,
474                         'verb' => '',
475                         'otype' => Notification\ObjectType::ITEM,
476                         'name_cache' => 'Reply to',
477                         'msg_cache' => 'A test reply from an item',
478                 ],
479         ],
480         'profile' => [
481                 [
482                         'id' => 1,
483                         'uid' => 42,
484                 ],
485         ],
486         'group'   => [
487                 [
488                         'id'      => 1,
489                         'uid'     => 42,
490                         'visible' => 1,
491                         'name'    => 'Visible list',
492                 ],
493                 [
494                         'id'      => 2,
495                         'uid'     => 42,
496                         'visible' => 0,
497                         'name'    => 'Private list',
498                 ],
499         ],
500         'search'  => [
501                 [
502                         'id'   => 1,
503                         'term' => 'Saved search',
504                         'uid'  => 42,
505                 ],
506         ],
507 ];