]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Test data for the "verb" table
[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\Core\Protocol;
23 use Friendica\Model\Contact;
24 use Friendica\Model\Item;
25 use Friendica\Model\Notification;
26
27 return [
28         // Empty these tables
29         'cache',
30         'conversation',
31         'pconfig',
32         'photo',
33         'workerqueue',
34         'mail',
35         'post-delivery-data',
36         // Base test config to avoid notice messages
37         'config'  => [
38                 [
39                         'cat' => 'system',
40                         'k'   => 'url',
41                         'v'   => 'http://localhost',
42                 ],
43                 [
44                         'cat' => 'config',
45                         'k'   => 'hostname',
46                         'v'   => 'localhost',
47                 ],
48                 [
49                         'cat' => 'system',
50                         'k'   => 'worker_dont_fork',
51                         'v'   => '1',
52                 ],
53         ],
54         'user'    => [
55                 [
56                         'uid'      => 42,
57                         'username' => 'Test user',
58                         'nickname' => 'selfcontact',
59                         'verified' => 1,
60                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
61                         'theme'    => 'frio',
62                 ],
63         ],
64         'contact' => [
65                 [
66                         'id'      => 42,
67                         'uid'     => 42,
68                         'name'    => 'Self contact',
69                         'nick'    => 'selfcontact',
70                         'self'    => 1,
71                         'nurl'    => 'http://localhost/profile/selfcontact',
72                         'url'     => 'http://localhost/profile/selfcontact',
73                         'about'   => 'User used in tests',
74                         'pending' => 0,
75                         'blocked' => 0,
76                         'rel'     => Contact::FOLLOWER,
77                         'network' => Protocol::DFRN,
78                         'location' => 'DFRN',
79                 ],
80                 // Having the same name and nick allows us to test
81                 // the fallback to api_get_nick() in api_get_user()
82                 [
83                         'id'      => 43,
84                         'uid'     => 0,
85                         'name'    => 'othercontact',
86                         'nick'    => 'othercontact',
87                         'self'    => 0,
88                         'nurl'    => 'http://localhost/profile/othercontact',
89                         'url'     => 'http://localhost/profile/othercontact',
90                         'pending' => 0,
91                         'blocked' => 0,
92                         'rel'     => Contact::NOTHING,
93                         'network' => Protocol::DFRN, 
94                         'location' => 'DFRN',
95                 ],
96                 [
97                         'id'      => 44,
98                         'uid'     => 42,
99                         'name'    => 'Friend contact',
100                         'nick'    => 'friendcontact',
101                         'self'    => 0,
102                         'nurl'    => 'http://localhost/profile/friendcontact',
103                         'url'     => 'http://localhost/profile/friendcontact',
104                         'pending' => 0,
105                         'blocked' => 0,
106                         'rel'     => Contact::SHARING,
107                         'network' => Protocol::DFRN,
108                         'location' => 'DFRN',
109                 ],
110                 [
111                         'id'      => 45,
112                         'uid'     => 0,
113                         'name'    => 'Friend contact',
114                         'nick'    => 'friendcontact',
115                         'self'    => 0,
116                         'nurl'    => 'http://localhost/profile/friendcontact',
117                         'url'     => 'http://localhost/profile/friendcontact',
118                         'pending' => 0,
119                         'blocked' => 0,
120                         'rel'     => Contact::SHARING,
121                         'network' => Protocol::DFRN,
122                         'location' => 'DFRN',
123                 ],
124                 [
125                         'id'      => 46,
126                         'uid'     => 42,
127                         'name'    => 'Mutual contact',
128                         'nick'    => 'mutualcontact',
129                         'self'    => 0,
130                         'nurl'    => 'http://localhost/profile/mutualcontact',
131                         'url'     => 'http://localhost/profile/mutualcontact',
132                         'pending' => 0,
133                         'blocked' => 0,
134                         'rel'     => Contact::FRIEND,
135                         'network' => Protocol::DFRN,
136                         'location' => 'DFRN',
137                 ],
138                 [
139                         'id'      => 47,
140                         'uid'     => 0,
141                         'name'    => 'Mutual contact',
142                         'nick'    => 'mutualcontact',
143                         'self'    => 0,
144                         'nurl'    => 'http://localhost/profile/mutualcontact',
145                         'url'     => 'http://localhost/profile/mutualcontact',
146                         'pending' => 0,
147                         'blocked' => 0,
148                         'rel'     => Contact::SHARING,
149                         'network' => Protocol::DFRN,
150                         'location' => 'DFRN',
151                 ],
152         ],
153         'item-uri'    => [
154                 [
155                         'id'   => 1,
156                         'uri'  => '1',
157                         'guid' => '1',
158                 ],
159                 [
160                         'id'   => 2,
161                         'uri'  => '2',
162                         'guid' => '2',
163                 ],
164                 [
165                         'id'   => 3,
166                         'uri'  => '3',
167                         'guid' => '3',
168                 ],
169                 [
170                         'id'   => 4,
171                         'uri'  => '4',
172                         'guid' => '4',
173                 ],
174                 [
175                         'id'   => 5,
176                         'uri'  => '5',
177                         'guid' => '5',
178                 ],
179                 [
180                         'id'   => 6,
181                         'uri'  => '6',
182                         'guid' => '6',
183                 ],
184         ],
185         'verb'    => [
186                 [
187                         'id'   => 0,
188                         'name' => '',
189                 ],
190                 [
191                         'id'   => 1,
192                         'name' => 'http://activitystrea.ms/schema/1.0/like',
193                 ],
194                 [
195                         'id'   => 2,
196                         'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
197                 ],
198                 [
199                         'id'   => 3,
200                         'name' => 'http://purl.org/zot/activity/attendyes',
201                 ],
202                 [
203                         'id'   => 4,
204                         'name' => 'http://purl.org/zot/activity/attendno',
205                 ],
206                 [
207                         'id'   => 5,
208                         'name' => 'http://purl.org/zot/activity/attendmaybe',
209                 ],
210                 [
211                         'id'   => 6,
212                         'name' => 'http://activitystrea.ms/schema/1.0/follow',
213                 ],
214                 [
215                         'id'   => 7,
216                         'name' => 'https://www.w3.org/ns/activitystreams#Announce',
217                 ],
218                 [
219                         'id'   => 8,
220                         'name' => 'http://activitystrea.ms/schema/1.0/post',
221                 ],
222         ],
223         'post-content' => [
224                 [
225                         'uri-id' => 1,
226                         'body'   => 'Parent status',
227                         'plink'  => 'http://localhost/display/1',
228                 ],
229                 [
230                         'uri-id' => 2,
231                         'body'   => 'Reply',
232                         'plink'  => 'http://localhost/display/2',
233                 ],
234                 [
235                         'uri-id' => 3,
236                         'body'   => 'Other user status',
237                         'plink'  => 'http://localhost/display/3',
238                 ],
239                 [
240                         'uri-id' => 4,
241                         'body'   => 'Friend user reply',
242                         'plink'  => 'http://localhost/display/4',
243                 ],
244                 [
245                         'uri-id' => 5,
246                         'body'   => '[share]Shared status[/share]',
247                         'plink'  => 'http://localhost/display/5',
248                 ],
249                 [
250                         'uri-id' => 6,
251                         'body'   => 'Friend user status',
252                         'plink'  => 'http://localhost/display/6',
253                 ],
254         ],
255         'post'    => [
256                 [
257                         'uri-id'        => 1,
258                         'parent-uri-id' => 1,
259                         'thr-parent-id' => 1,
260                         'gravity'       => GRAVITY_PARENT,
261                         'network'       => Protocol::DFRN,
262                         'owner-id'      => 42,
263                         'author-id'     => 42,
264                         'causer-id'     => 42,
265                         'vid'           => 8,
266                         'private'       => Item::PUBLIC,
267                         'visible'       => 1,
268                 ],
269                 [
270                         'uri-id'        => 2,
271                         'parent-uri-id' => 1,
272                         'thr-parent-id' => 1,
273                         'gravity'       => GRAVITY_COMMENT,
274                         'network'       => Protocol::DFRN,
275                         'owner-id'      => 42,
276                         'author-id'     => 42,
277                         'causer-id'     => 42,
278                         'vid'           => 8,
279                         'private'       => Item::PUBLIC,
280                         'visible'       => 1,
281                 ],
282                 [
283                         'uri-id'        => 3,
284                         'parent-uri-id' => 3,
285                         'thr-parent-id' => 3,
286                         'gravity'       => GRAVITY_PARENT,
287                         'network'       => Protocol::DFRN,
288                         'owner-id'      => 42,
289                         'author-id'     => 43,
290                         'causer-id'     => 43,
291                         'vid'           => 8,
292                         'private'       => Item::PUBLIC,
293                         'visible'       => 1,
294                 ],
295                 [
296                         'uri-id'        => 4,
297                         'parent-uri-id' => 1,
298                         'thr-parent-id' => 1,
299                         'gravity'       => GRAVITY_COMMENT,
300                         'network'       => Protocol::DFRN,
301                         'owner-id'      => 42,
302                         'author-id'     => 44,
303                         'causer-id'     => 44,
304                         'vid'           => 8,
305                         'private'       => Item::PUBLIC,
306                         'visible'       => 1,
307                 ],
308                 [
309                         'uri-id'        => 5,
310                         'parent-uri-id' => 1,
311                         'thr-parent-id' => 1,
312                         'gravity'       => GRAVITY_COMMENT,
313                         'network'       => Protocol::DFRN,
314                         'owner-id'      => 42,
315                         'author-id'     => 42,
316                         'causer-id'     => 42,
317                         'vid'           => 8,
318                         'private'       => Item::PUBLIC,
319                         'visible'       => 1,
320                 ],
321                 [
322                         'uri-id'        => 6,
323                         'parent-uri-id' => 6,
324                         'thr-parent-id' => 6,
325                         'gravity'       => GRAVITY_PARENT,
326                         'network'       => Protocol::DFRN,
327                         'owner-id'      => 42,
328                         'author-id'     => 44,
329                         'causer-id'     => 44,
330                         'vid'           => 8,
331                         'private'       => Item::PUBLIC,
332                         'visible'       => 1,
333                 ],
334         ],
335         'post-user' => [
336                 [
337                         'id'            => 1,
338                         'uri-id'        => 1,
339                         'uid'           => 42,
340                         'contact-id'    => 42,
341                         'unseen'        => 1,
342                         'origin'        => 1,
343                         'parent-uri-id' => 1,
344                         'thr-parent-id' => 1,
345                         'gravity'       => GRAVITY_PARENT,
346                         'network'       => Protocol::DFRN,
347                         'owner-id'      => 42,
348                         'author-id'     => 42,
349                         'causer-id'     => 42,
350                         'vid'           => 8,
351                         'private'       => Item::PUBLIC,
352                         'visible'       => 1,
353                 ],
354                 [
355                         'id'            => 2,
356                         'uri-id'        => 2,
357                         'uid'           => 42,
358                         'contact-id'    => 42,
359                         'unseen'        => 0,
360                         'origin'        => 1,
361                         'parent-uri-id' => 1,
362                         'thr-parent-id' => 1,
363                         'gravity'       => GRAVITY_COMMENT,
364                         'network'       => Protocol::DFRN,
365                         'owner-id'      => 42,
366                         'author-id'     => 42,
367                         'causer-id'     => 42,
368                         'vid'           => 8,
369                         'private'       => Item::PUBLIC,
370                         'visible'       => 1,
371                 ],
372                 [
373                         'id'            => 3,
374                         'uri-id'        => 3,
375                         'uid'           => 42,
376                         'contact-id'    => 43,
377                         'unseen'        => 0,
378                         'origin'        => 1,
379                         'parent-uri-id' => 3,
380                         'thr-parent-id' => 3,
381                         'gravity'       => GRAVITY_PARENT,
382                         'network'       => Protocol::DFRN,
383                         'owner-id'      => 42,
384                         'author-id'     => 43,
385                         'causer-id'     => 43,
386                         'vid'           => 8,
387                         'private'       => Item::PUBLIC,
388                         'visible'       => 1,
389                 ],
390                 [
391                         'id'            => 4,
392                         'uri-id'        => 4,
393                         'uid'           => 42,
394                         'contact-id'    => 44,
395                         'unseen'        => 0,
396                         'origin'        => 1,
397                         'parent-uri-id' => 1,
398                         'thr-parent-id' => 1,
399                         'gravity'       => GRAVITY_COMMENT,
400                         'network'       => Protocol::DFRN,
401                         'owner-id'      => 42,
402                         'author-id'     => 44,
403                         'causer-id'     => 44,
404                         'vid'           => 8,
405                         'private'       => Item::PUBLIC,
406                         'visible'       => 1,
407                 ],
408                 [
409                         'id'            => 5,
410                         'uri-id'        => 5,
411                         'uid'           => 42,
412                         'contact-id'    => 42,
413                         'unseen'        => 0,
414                         'origin'        => 1,
415                         'parent-uri-id' => 1,
416                         'thr-parent-id' => 1,
417                         'gravity'       => GRAVITY_COMMENT,
418                         'network'       => Protocol::DFRN,
419                         'owner-id'      => 42,
420                         'author-id'     => 42,
421                         'causer-id'     => 42,
422                         'vid'           => 8,
423                         'private'       => Item::PUBLIC,
424                         'visible'       => 1,
425                 ],
426                 [
427                         'id'            => 6,
428                         'uri-id'        => 6,
429                         'uid'           => 42,
430                         'contact-id'    => 44,
431                         'unseen'        => 0,
432                         'origin'        => 1,
433                         'parent-uri-id' => 6,
434                         'thr-parent-id' => 6,
435                         'gravity'       => GRAVITY_PARENT,
436                         'network'       => Protocol::DFRN,
437                         'owner-id'      => 42,
438                         'author-id'     => 44,
439                         'causer-id'     => 44,
440                         'vid'           => 8,
441                         'private'       => Item::PUBLIC,
442                         'visible'       => 1,
443                 ],
444                 [
445                         'id'            => 7,
446                         'uri-id'        => 1,
447                         'uid'           => 0,
448                         'contact-id'    => 42,
449                         'unseen'        => 1,
450                         'origin'        => 0,
451                         'parent-uri-id' => 1,
452                         'thr-parent-id' => 1,
453                         'gravity'       => GRAVITY_PARENT,
454                         'network'       => Protocol::DFRN,
455                         'owner-id'      => 42,
456                         'author-id'     => 42,
457                         'causer-id'     => 42,
458                         'vid'           => 8,
459                         'private'       => Item::PUBLIC,
460                         'visible'       => 1,
461                 ],
462                 [
463                         'id'            => 8,
464                         'uri-id'        => 2,
465                         'uid'           => 0,
466                         'contact-id'    => 42,
467                         'unseen'        => 0,
468                         'origin'        => 0,
469                         'parent-uri-id' => 1,
470                         'thr-parent-id' => 1,
471                         'gravity'       => GRAVITY_COMMENT,
472                         'network'       => Protocol::DFRN,
473                         'owner-id'      => 42,
474                         'author-id'     => 42,
475                         'causer-id'     => 42,
476                         'vid'           => 8,
477                         'private'       => Item::PUBLIC,
478                         'visible'       => 1,
479                 ],
480                 [
481                         'id'            => 9,
482                         'uri-id'        => 3,
483                         'uid'           => 0,
484                         'contact-id'    => 43,
485                         'unseen'        => 0,
486                         'origin'        => 0,
487                         'parent-uri-id' => 3,
488                         'thr-parent-id' => 3,
489                         'gravity'       => GRAVITY_PARENT,
490                         'network'       => Protocol::DFRN,
491                         'owner-id'      => 42,
492                         'author-id'     => 43,
493                         'causer-id'     => 43,
494                         'vid'           => 8,
495                         'private'       => Item::PUBLIC,
496                         'visible'       => 1,
497                 ],
498                 [
499                         'id'            => 10,
500                         'uri-id'        => 4,
501                         'uid'           => 0,
502                         'contact-id'    => 44,
503                         'unseen'        => 0,
504                         'origin'        => 0,
505                         'parent-uri-id' => 1,
506                         'thr-parent-id' => 1,
507                         'gravity'       => GRAVITY_COMMENT,
508                         'network'       => Protocol::DFRN,
509                         'owner-id'      => 42,
510                         'author-id'     => 44,
511                         'causer-id'     => 44,
512                         'vid'           => 8,
513                         'private'       => Item::PUBLIC,
514                         'visible'       => 1,
515                 ],
516                 [
517                         'id'            => 11,
518                         'uri-id'        => 5,
519                         'uid'           => 0,
520                         'contact-id'    => 42,
521                         'unseen'        => 0,
522                         'origin'        => 0,
523                         'parent-uri-id' => 1,
524                         'thr-parent-id' => 1,
525                         'gravity'       => GRAVITY_COMMENT,
526                         'network'       => Protocol::DFRN,
527                         'owner-id'      => 42,
528                         'author-id'     => 42,
529                         'causer-id'     => 42,
530                         'vid'           => 8,
531                         'private'       => Item::PUBLIC,
532                         'visible'       => 1,
533                 ],
534                 [
535                         'id'            => 12,
536                         'uri-id'        => 6,
537                         'uid'           => 0,
538                         'contact-id'    => 44,
539                         'unseen'        => 0,
540                         'origin'        => 0,
541                         'parent-uri-id' => 6,
542                         'thr-parent-id' => 6,
543                         'gravity'       => GRAVITY_PARENT,
544                         'network'       => Protocol::DFRN,
545                         'owner-id'      => 42,
546                         'author-id'     => 44,
547                         'causer-id'     => 44,
548                         'vid'           => 8,
549                         'private'       => Item::PUBLIC,
550                         'visible'       => 1,
551                 ],
552         ],
553         'post-thread'  => [
554                 [
555                         'uri-id'     => 1,
556                         'author-id'  => 42,
557                         'owner-id'   => 42,
558                         'causer-id'  => 42,
559                         'network'    => Protocol::DFRN,
560                 ],
561                 [
562                         'uri-id'     => 3,
563                         'author-id'  => 43,
564                         'owner-id'   => 43,
565                         'causer-id'  => 43,
566                         'network'    => Protocol::DFRN,
567                 ],
568                 [
569                         'uri-id'     => 6,
570                         'author-id'  => 44,
571                         'owner-id'   => 44,
572                         'causer-id'  => 44,
573                         'network'    => Protocol::DFRN,
574                 ],
575         ],
576         'post-thread-user'  => [
577                 [
578                         'uri-id'     => 1,
579                         'uid'        => 42,
580                         'wall'       => 1,
581                         'post-user-id' => 1,
582                         'author-id'  => 42,
583                         'owner-id'   => 42,
584                         'causer-id'  => 42,
585                         'network'    => Protocol::DFRN,
586                 ],
587                 [
588                         'uri-id'     => 3,
589                         'uid'        => 42,
590                         'wall'       => 1,
591                         'post-user-id' => 3,
592                         'author-id'  => 43,
593                         'owner-id'   => 43,
594                         'causer-id'  => 43,
595                         'network'    => Protocol::DFRN,
596                 ],
597                 [
598                         'uri-id'     => 6,
599                         'uid'        => 42,
600                         'wall'       => 1,
601                         'post-user-id' => 6,
602                         'author-id'  => 44,
603                         'owner-id'   => 44,
604                         'causer-id'  => 44,
605                         'network'    => Protocol::DFRN,
606                 ],
607                 [
608                         'uri-id'     => 1,
609                         'uid'        => 0,
610                         'wall'       => 0,
611                         'post-user-id' => 7,
612                         'author-id'  => 42,
613                         'owner-id'   => 42,
614                         'causer-id'  => 42,
615                         'network'    => Protocol::DFRN,
616                 ],
617                 [
618                         'uri-id'     => 3,
619                         'uid'        => 0,
620                         'wall'       => 0,
621                         'post-user-id' => 9,
622                         'author-id'  => 43,
623                         'owner-id'   => 43,
624                         'causer-id'  => 43,
625                         'network'    => Protocol::DFRN,
626                 ],
627                 [
628                         'uri-id'     => 6,
629                         'uid'        => 0,
630                         'wall'       => 0,
631                         'post-user-id' => 12,
632                         'author-id'  => 44,
633                         'owner-id'   => 44,
634                         'causer-id'  => 44,
635                         'network'    => Protocol::DFRN,
636                 ],
637         ],
638         'notify' => [
639                 [
640                         'id' => 1,
641                         'type' => 8,
642                         'name' => 'Reply to',
643                         'url' => 'http://localhost/display/1',
644                         'photo' => 'http://localhost/',
645                         'date' => '2020-01-01 12:12:02',
646                         'msg' => 'A test reply from an item',
647                         'uid' => 42,
648                         'link' => 'http://localhost/notification/1',
649                         'iid' => 4,
650                         'seen' => 0,
651                         'verb' => '',
652                         'otype' => Notification\ObjectType::ITEM,
653                         'name_cache' => 'Reply to',
654                         'msg_cache' => 'A test reply from an item',
655                 ],
656         ],
657         'profile' => [
658                 [
659                         'id' => 1,
660                         'uid' => 42,
661                 ],
662         ],
663         'group'   => [
664                 [
665                         'id'      => 1,
666                         'uid'     => 42,
667                         'visible' => 1,
668                         'name'    => 'Visible list',
669                 ],
670                 [
671                         'id'      => 2,
672                         'uid'     => 42,
673                         'visible' => 0,
674                         'name'    => 'Private list',
675                 ],
676         ],
677         'search'  => [
678                 [
679                         'id'   => 1,
680                         'term' => 'Saved search',
681                         'uid'  => 42,
682                 ],
683         ],
684 ];