3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
22 use Friendica\Core\Protocol;
23 use Friendica\Model\Contact;
24 use Friendica\Model\Item;
25 use Friendica\Model\Notification;
36 // Base test config to avoid notice messages
41 'v' => 'http://localhost',
50 'k' => 'worker_dont_fork',
57 'username' => 'Test user',
58 'nickname' => 'selfcontact',
60 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
68 'name' => 'Self contact',
69 'nick' => 'selfcontact',
71 'nurl' => 'http://localhost/profile/selfcontact',
72 'url' => 'http://localhost/profile/selfcontact',
73 'about' => 'User used in tests',
76 'rel' => Contact::FOLLOWER,
77 'network' => Protocol::DFRN,
80 // Having the same name and nick allows us to test
81 // the fallback to api_get_nick() in api_get_user()
85 'name' => 'othercontact',
86 'nick' => 'othercontact',
88 'nurl' => 'http://localhost/profile/othercontact',
89 'url' => 'http://localhost/profile/othercontact',
92 'rel' => Contact::NOTHING,
93 'network' => Protocol::DFRN,
99 'name' => 'Friend contact',
100 'nick' => 'friendcontact',
102 'nurl' => 'http://localhost/profile/friendcontact',
103 'url' => 'http://localhost/profile/friendcontact',
106 'rel' => Contact::SHARING,
107 'network' => Protocol::DFRN,
108 'location' => 'DFRN',
113 'name' => 'Friend contact',
114 'nick' => 'friendcontact',
116 'nurl' => 'http://localhost/profile/friendcontact',
117 'url' => 'http://localhost/profile/friendcontact',
120 'rel' => Contact::SHARING,
121 'network' => Protocol::DFRN,
122 'location' => 'DFRN',
127 'name' => 'Mutual contact',
128 'nick' => 'mutualcontact',
130 'nurl' => 'http://localhost/profile/mutualcontact',
131 'url' => 'http://localhost/profile/mutualcontact',
134 'rel' => Contact::FRIEND,
135 'network' => Protocol::DFRN,
136 'location' => 'DFRN',
141 'name' => 'Mutual contact',
142 'nick' => 'mutualcontact',
144 'nurl' => 'http://localhost/profile/mutualcontact',
145 'url' => 'http://localhost/profile/mutualcontact',
148 'rel' => Contact::SHARING,
149 'network' => Protocol::DFRN,
150 'location' => 'DFRN',
188 'body' => 'Parent status',
189 'plink' => 'http://localhost/display/1',
194 'plink' => 'http://localhost/display/2',
198 'body' => 'Other user status',
199 'plink' => 'http://localhost/display/3',
203 'body' => 'Friend user reply',
204 'plink' => 'http://localhost/display/4',
208 'body' => '[share]Shared status[/share]',
209 'plink' => 'http://localhost/display/5',
213 'body' => 'Friend user status',
214 'plink' => 'http://localhost/display/6',
223 'network' => Protocol::DFRN,
230 'network' => Protocol::DFRN,
237 'network' => Protocol::DFRN,
338 'post-thread-user' => [
373 'post-user-id' => 12,
387 'verb' => 'http://activitystrea.ms/schema/1.0/post',
390 'parent-uri-id' => 1,
392 'thr-parent-id' => 1,
394 'private' => Item::PUBLIC,
395 'gravity' => GRAVITY_PARENT,
396 'author-link' => 'http://localhost/profile/selfcontact',
416 'verb' => 'http://activitystrea.ms/schema/1.0/post',
419 'parent-uri-id' => 1,
421 'thr-parent-id' => 1,
423 'private' => Item::PUBLIC,
424 'gravity' => GRAVITY_COMMENT,
425 'author-link' => 'http://localhost/profile/selfcontact',
441 'verb' => 'http://activitystrea.ms/schema/1.0/post',
444 'parent-uri-id' => 3,
446 'thr-parent-id' => 3,
448 'private' => Item::PUBLIC,
449 'gravity' => GRAVITY_PARENT,
450 'author-link' => 'http://localhost/profile/othercontact',
466 'verb' => 'http://activitystrea.ms/schema/1.0/post',
468 'body' => 'Friend user reply',
470 'parent-uri-id' => 1,
472 'thr-parent-id' => 1,
474 'private' => Item::PUBLIC,
475 'gravity' => GRAVITY_COMMENT,
476 'author-link' => 'http://localhost/profile/othercontact',
493 'verb' => 'http://activitystrea.ms/schema/1.0/post',
496 'parent-uri-id' => 1,
498 'thr-parent-id' => 1,
500 'private' => Item::PUBLIC,
501 'gravity' => GRAVITY_COMMENT,
502 'author-link' => 'http://localhost/profile/othercontact',
522 'verb' => 'http://activitystrea.ms/schema/1.0/post',
525 'parent-uri-id' => 6,
527 'thr-parent-id' => 6,
529 'private' => Item::PUBLIC,
530 'gravity' => GRAVITY_PARENT,
531 'author-link' => 'http://localhost/profile/othercontact',
547 'verb' => 'http://activitystrea.ms/schema/1.0/post',
550 'parent-uri-id' => 1,
552 'thr-parent-id' => 1,
554 'private' => Item::PUBLIC,
555 'gravity' => GRAVITY_PARENT,
556 'author-link' => 'http://localhost/profile/selfcontact',
576 'verb' => 'http://activitystrea.ms/schema/1.0/post',
579 'parent-uri-id' => 1,
581 'thr-parent-id' => 1,
583 'private' => Item::PUBLIC,
584 'gravity' => GRAVITY_COMMENT,
585 'author-link' => 'http://localhost/profile/selfcontact',
601 'verb' => 'http://activitystrea.ms/schema/1.0/post',
604 'parent-uri-id' => 3,
606 'thr-parent-id' => 3,
608 'private' => Item::PUBLIC,
609 'gravity' => GRAVITY_PARENT,
610 'author-link' => 'http://localhost/profile/othercontact',
626 'verb' => 'http://activitystrea.ms/schema/1.0/post',
628 'body' => 'Friend user reply',
630 'parent-uri-id' => 1,
632 'thr-parent-id' => 1,
634 'private' => Item::PUBLIC,
635 'gravity' => GRAVITY_COMMENT,
636 'author-link' => 'http://localhost/profile/othercontact',
653 'verb' => 'http://activitystrea.ms/schema/1.0/post',
656 'parent-uri-id' => 1,
658 'thr-parent-id' => 1,
660 'private' => Item::PUBLIC,
661 'gravity' => GRAVITY_COMMENT,
662 'author-link' => 'http://localhost/profile/othercontact',
682 'verb' => 'http://activitystrea.ms/schema/1.0/post',
685 'parent-uri-id' => 6,
687 'thr-parent-id' => 6,
689 'private' => Item::PUBLIC,
690 'gravity' => GRAVITY_PARENT,
691 'author-link' => 'http://localhost/profile/othercontact',
702 'name' => 'Reply to',
703 'url' => 'http://localhost/display/1',
704 'photo' => 'http://localhost/',
705 'date' => '2020-01-01 12:12:02',
706 'msg' => 'A test reply from an item',
708 'link' => 'http://localhost/notification/1',
712 'otype' => Notification\ObjectType::ITEM,
713 'name_cache' => 'Reply to',
714 'msg_cache' => 'A test reply from an item',
728 'name' => 'Visible list',
734 'name' => 'Private list',
740 'term' => 'Saved search',