]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Providing more test data
[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         'item-content' => [
183                 [
184                         'id'          => 1,
185                         'uri-id'      => 1,
186                         'uri-plink-hash' => '1',
187                         'body'        => 'Parent status',
188                         'plink'       => 'http://localhost/display/1',
189                 ],
190                 [
191                         'id'          => 2,
192                         'uri-id'      => 2,
193                         'uri-plink-hash' => '2',
194                         'body'        => 'Reply',
195                         'plink'       => 'http://localhost/display/2',
196                 ],
197                 [
198                         'id'          => 3,
199                         'uri-id'      => 3,
200                         'uri-plink-hash' => '3',
201                         'body'        => 'Other user status',
202                         'plink'       => 'http://localhost/display/3',
203                 ],
204                 [
205                         'id'          => 4,
206                         'uri-id'      => 4,
207                         'uri-plink-hash' => '4',
208                         'body'        => 'Friend user reply',
209                         'plink'       => 'http://localhost/display/4',
210                 ],
211                 [
212                         'id'          => 5,
213                         'uri-id'      => 5,
214                         'uri-plink-hash' => '5',
215                         'body'        => '[share]Shared status[/share]',
216                         'plink'       => 'http://localhost/display/5',
217                 ],
218                 [
219                         'id'          => 6,
220                         'uri-id'      => 6,
221                         'uri-plink-hash' => '6',
222                         'body'        => 'Friend user status',
223                         'plink'       => 'http://localhost/display/6',
224                 ],
225         ],
226         'post-user' => [
227                 [
228                         'id'          => 1,
229                         'uri-id'      => 1,
230                         'uid'         => 42,
231                         'contact-id'  => 42,
232                         'unseen'      => 1,
233                         'origin'      => 1,
234                 ],
235                 [
236                         'id'          => 2,
237                         'uri-id'      => 2,
238                         'uid'         => 42,
239                         'contact-id'  => 42,
240                         'unseen'      => 0,
241                         'origin'      => 1,
242                 ],
243                 [
244                         'id'          => 3,
245                         'uri-id'      => 3,
246                         'uid'         => 42,
247                         'contact-id'  => 43,
248                         'unseen'      => 0,
249                         'origin'      => 1,
250                 ],
251                 [
252                         'id'          => 4,
253                         'uri-id'      => 4,
254                         'uid'         => 42,
255                         'contact-id'  => 44,
256                         'unseen'      => 0,
257                         'origin'      => 1,
258                 ],
259                 [
260                         'id'          => 5,
261                         'uri-id'      => 5,
262                         'uid'         => 42,
263                         'contact-id'  => 42,
264                         'unseen'      => 0,
265                         'origin'      => 1,
266                 ],
267                 [
268                         'id'          => 6,
269                         'uri-id'      => 6,
270                         'uid'         => 42,
271                         'contact-id'  => 44,
272                         'unseen'      => 0,
273                         'origin'      => 1,
274                 ],
275
276         ],
277         'item'    => [
278                 [
279                         'id'          => 1,
280                         'uri-id'      => 1,
281                         'visible'     => 1,
282                         'contact-id'  => 42,
283                         'author-id'   => 42,
284                         'owner-id'    => 42,
285                         'causer-id'   => 42,
286                         'uid'         => 42,
287                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
288                         'unseen'      => 1,
289                         'parent'      => 1,
290                         'parent-uri-id' => 1,
291                         'thr-parent-id' => 1,
292                         'gravity'     => GRAVITY_PARENT,
293                         'author-link' => 'http://localhost/profile/selfcontact',
294                         'wall'        => 1,
295                         'starred'     => 1,
296                         'origin'      => 1,
297                         'allow_cid'   => '',
298                         'allow_gid'   => '',
299                         'deny_cid'    => '',
300                         'deny_gid'    => '',
301                         'guid'        => '1',
302                 ],
303                 [
304                         'id'          => 2,
305                         'uri-id'      => 2,
306                         'visible'     => 1,
307                         'contact-id'  => 42,
308                         'author-id'   => 42,
309                         'owner-id'    => 42,
310                         'causer-id'   => 42,
311                         'uid'         => 42,
312                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
313                         'unseen'      => 0,
314                         'parent'      => 1,
315                         'parent-uri-id' => 1,
316                         'thr-parent-id' => 1,
317                         'gravity'     => GRAVITY_COMMENT,
318                         'author-link' => 'http://localhost/profile/selfcontact',
319                         'wall'        => 1,
320                         'starred'     => 0,
321                         'origin'      => 1,
322                         'guid'        => '2',
323                 ],
324                 [
325                         'id'          => 3,
326                         'uri-id'      => 3,
327                         'visible'     => 1,
328                         'contact-id'  => 43,
329                         'author-id'   => 43,
330                         'owner-id'    => 42,
331                         'causer-id'   => 43,
332                         'uid'         => 42,
333                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
334                         'unseen'      => 0,
335                         'parent'      => 3,
336                         'parent-uri-id' => 3,
337                         'thr-parent-id' => 3,
338                         'gravity'     => GRAVITY_PARENT,
339                         'author-link' => 'http://localhost/profile/othercontact',
340                         'wall'        => 1,
341                         'starred'     => 0,
342                         'origin'      => 1,
343                         'guid'        => '3',
344                 ],
345                 [
346                         'id'          => 4,
347                         'uri-id'      => 4,
348                         'visible'     => 1,
349                         'contact-id'  => 44,
350                         'author-id'   => 44,
351                         'owner-id'    => 42,
352                         'causer-id'   => 44,
353                         'uid'         => 42,
354                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
355                         'unseen'      => 0,
356                         'body'        => 'Friend user reply',
357                         'parent'      => 1,
358                         'parent-uri-id' => 1,
359                         'thr-parent-id' => 1,
360                         'gravity'     => GRAVITY_COMMENT,
361                         'author-link' => 'http://localhost/profile/othercontact',
362                         'wall'        => 1,
363                         'starred'     => 0,
364                         'origin'      => 1,
365                         'guid'        => '4',
366                 ],
367                 [
368
369                         'id'          => 5,
370                         'uri-id'      => 5,
371                         'visible'     => 1,
372                         'contact-id'  => 42,
373                         'author-id'   => 42,
374                         'owner-id'    => 42,
375                         'causer-id'   => 42,
376                         'uid'         => 42,
377                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
378                         'unseen'      => 0,
379                         'parent'      => 1,
380                         'parent-uri-id' => 1,
381                         'thr-parent-id' => 1,
382                         'gravity'     => GRAVITY_COMMENT,
383                         'author-link' => 'http://localhost/profile/othercontact',
384                         'wall'        => 1,
385                         'starred'     => 0,
386                         'origin'      => 1,
387                         'allow_cid'   => '',
388                         'allow_gid'   => '',
389                         'deny_cid'    => '',
390                         'deny_gid'    => '',
391                         'guid'        => '5',
392                 ],
393                 [
394                         'id'          => 6,
395                         'uri-id'      => 6,
396                         'visible'     => 1,
397                         'contact-id'  => 44,
398                         'author-id'   => 44,
399                         'owner-id'    => 42,
400                         'causer-id'   => 44,
401                         'uid'         => 42,
402                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
403                         'unseen'      => 0,
404                         'parent'      => 6,
405                         'parent-uri-id' => 6,
406                         'thr-parent-id' => 6,
407                         'gravity'     => GRAVITY_PARENT,
408                         'author-link' => 'http://localhost/profile/othercontact',
409                         'wall'        => 1,
410                         'starred'     => 0,
411                         'origin'      => 1,
412                         'guid'        => '6',
413                 ],
414         ],
415         'notify' => [
416                 [
417                         'id' => 1,
418                         'type' => 8,
419                         'name' => 'Reply to',
420                         'url' => 'http://localhost/display/1',
421                         'photo' => 'http://localhost/',
422                         'date' => '2020-01-01 12:12:02',
423                         'msg' => 'A test reply from an item',
424                         'uid' => 42,
425                         'link' => 'http://localhost/notification/1',
426                         'iid' => 4,
427                         'seen' => 0,
428                         'verb' => '',
429                         'otype' => Notification\ObjectType::ITEM,
430                         'name_cache' => 'Reply to',
431                         'msg_cache' => 'A test reply from an item',
432                 ],
433         ],
434         'thread'  => [
435                 [
436                         'iid'        => 1,
437                         'uri-id'     => 1,
438                         'visible'    => 1,
439                         'contact-id' => 42,
440                         'author-id'  => 42,
441                         'owner-id'   => 42,
442                         'uid'        => 42,
443                         'wall'       => 1,
444                 ],
445                 [
446                         'iid'        => 3,
447                         'uri-id'     => 3,
448                         'visible'    => 1,
449                         'contact-id' => 43,
450                         'author-id'  => 43,
451                         'owner-id'   => 43,
452                         'uid'        => 0,
453                         'wall'       => 1,
454                 ],
455                 [
456                         'iid'        => 6,
457                         'uri-id'     => 6,
458                         'visible'    => 1,
459                         'contact-id' => 44,
460                         'author-id'  => 44,
461                         'owner-id'   => 44,
462                         'uid'        => 0,
463                         'wall'       => 1,
464                 ],
465         ],
466         'profile' => [
467                 [
468                         'id' => 1,
469                         'uid' => 42,
470                 ],
471         ],
472         'group'   => [
473                 [
474                         'id'      => 1,
475                         'uid'     => 42,
476                         'visible' => 1,
477                         'name'    => 'Visible list',
478                 ],
479                 [
480                         'id'      => 2,
481                         'uid'     => 42,
482                         'visible' => 0,
483                         'name'    => 'Private list',
484                 ],
485         ],
486         'search'  => [
487                 [
488                         'id'   => 1,
489                         'term' => 'Saved search',
490                         'uid'  => 42,
491                 ],
492         ],
493 ];