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;
26 use Friendica\Model\Verb;
37 // Base test config to avoid notice messages
42 'v' => 'http://localhost',
51 'k' => 'worker_dont_fork',
58 'username' => 'Test user',
59 'nickname' => 'selfcontact',
61 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
69 'name' => 'Self contact',
70 'nick' => 'selfcontact',
72 'nurl' => 'http://localhost/profile/selfcontact',
73 'url' => 'http://localhost/profile/selfcontact',
74 'about' => 'User used in tests',
77 'rel' => Contact::FOLLOWER,
78 'network' => Protocol::DFRN,
81 // Having the same name and nick allows us to test
82 // the fallback to api_get_nick() in api_get_user()
86 'name' => 'othercontact',
87 'nick' => 'othercontact',
89 'nurl' => 'http://localhost/profile/othercontact',
90 'url' => 'http://localhost/profile/othercontact',
93 'rel' => Contact::NOTHING,
94 'network' => Protocol::DFRN,
100 'name' => 'Friend contact',
101 'nick' => 'friendcontact',
103 'nurl' => 'http://localhost/profile/friendcontact',
104 'url' => 'http://localhost/profile/friendcontact',
107 'rel' => Contact::SHARING,
108 'network' => Protocol::DFRN,
109 'location' => 'DFRN',
114 'name' => 'Friend contact',
115 'nick' => 'friendcontact',
117 'nurl' => 'http://localhost/profile/friendcontact',
118 'url' => 'http://localhost/profile/friendcontact',
121 'rel' => Contact::SHARING,
122 'network' => Protocol::DFRN,
123 'location' => 'DFRN',
128 'name' => 'Mutual contact',
129 'nick' => 'mutualcontact',
131 'nurl' => 'http://localhost/profile/mutualcontact',
132 'url' => 'http://localhost/profile/mutualcontact',
135 'rel' => Contact::FRIEND,
136 'network' => Protocol::DFRN,
137 'location' => 'DFRN',
142 'name' => 'Mutual contact',
143 'nick' => 'mutualcontact',
145 'nurl' => 'http://localhost/profile/mutualcontact',
146 'url' => 'http://localhost/profile/mutualcontact',
149 'rel' => Contact::SHARING,
150 'network' => Protocol::DFRN,
151 'location' => 'DFRN',
189 'body' => 'Parent status',
190 'plink' => 'http://localhost/display/1',
195 'plink' => 'http://localhost/display/2',
199 'body' => 'Other user status',
200 'plink' => 'http://localhost/display/3',
204 'body' => 'Friend user reply',
205 'plink' => 'http://localhost/display/4',
209 'body' => '[share]Shared status[/share]',
210 'plink' => 'http://localhost/display/5',
214 'body' => 'Friend user status',
215 'plink' => 'http://localhost/display/6',
224 'network' => Protocol::DFRN,
231 'network' => Protocol::DFRN,
238 'network' => Protocol::DFRN,
339 'post-thread-user' => [
374 'post-user-id' => 12,
380 'parent-uri-id' => 1,
381 'thr-parent-id' => 1,
382 'gravity' => GRAVITY_PARENT,
383 'network' => Protocol::DFRN,
387 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
388 'private' => Item::PUBLIC,
393 'parent-uri-id' => 1,
394 'thr-parent-id' => 1,
395 'gravity' => GRAVITY_COMMENT,
396 'network' => Protocol::DFRN,
400 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
401 'private' => Item::PUBLIC,
406 'parent-uri-id' => 3,
407 'thr-parent-id' => 3,
408 'gravity' => GRAVITY_PARENT,
409 'network' => Protocol::DFRN,
413 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
414 'private' => Item::PUBLIC,
419 'parent-uri-id' => 1,
420 'thr-parent-id' => 1,
421 'gravity' => GRAVITY_COMMENT,
422 'network' => Protocol::DFRN,
426 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
427 'private' => Item::PUBLIC,
432 'parent-uri-id' => 1,
433 'thr-parent-id' => 1,
434 'gravity' => GRAVITY_COMMENT,
435 'network' => Protocol::DFRN,
439 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
440 'private' => Item::PUBLIC,
445 'parent-uri-id' => 6,
446 'thr-parent-id' => 6,
447 'gravity' => GRAVITY_PARENT,
448 'network' => Protocol::DFRN,
452 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
453 'private' => Item::PUBLIC,
468 'verb' => 'http://activitystrea.ms/schema/1.0/post',
471 'parent-uri-id' => 1,
473 'thr-parent-id' => 1,
475 'private' => Item::PUBLIC,
476 'gravity' => GRAVITY_PARENT,
477 'author-link' => 'http://localhost/profile/selfcontact',
497 'verb' => 'http://activitystrea.ms/schema/1.0/post',
500 'parent-uri-id' => 1,
502 'thr-parent-id' => 1,
504 'private' => Item::PUBLIC,
505 'gravity' => GRAVITY_COMMENT,
506 'author-link' => 'http://localhost/profile/selfcontact',
522 'verb' => 'http://activitystrea.ms/schema/1.0/post',
525 'parent-uri-id' => 3,
527 'thr-parent-id' => 3,
529 'private' => Item::PUBLIC,
530 'gravity' => GRAVITY_PARENT,
531 'author-link' => 'http://localhost/profile/othercontact',
547 'verb' => 'http://activitystrea.ms/schema/1.0/post',
549 'body' => 'Friend user reply',
551 'parent-uri-id' => 1,
553 'thr-parent-id' => 1,
555 'private' => Item::PUBLIC,
556 'gravity' => GRAVITY_COMMENT,
557 'author-link' => 'http://localhost/profile/othercontact',
574 'verb' => 'http://activitystrea.ms/schema/1.0/post',
577 'parent-uri-id' => 1,
579 'thr-parent-id' => 1,
581 'private' => Item::PUBLIC,
582 'gravity' => GRAVITY_COMMENT,
583 'author-link' => 'http://localhost/profile/othercontact',
603 'verb' => 'http://activitystrea.ms/schema/1.0/post',
606 'parent-uri-id' => 6,
608 'thr-parent-id' => 6,
610 'private' => Item::PUBLIC,
611 'gravity' => GRAVITY_PARENT,
612 'author-link' => 'http://localhost/profile/othercontact',
628 'verb' => 'http://activitystrea.ms/schema/1.0/post',
631 'parent-uri-id' => 1,
633 'thr-parent-id' => 1,
635 'private' => Item::PUBLIC,
636 'gravity' => GRAVITY_PARENT,
637 'author-link' => 'http://localhost/profile/selfcontact',
657 'verb' => 'http://activitystrea.ms/schema/1.0/post',
660 'parent-uri-id' => 1,
662 'thr-parent-id' => 1,
664 'private' => Item::PUBLIC,
665 'gravity' => GRAVITY_COMMENT,
666 'author-link' => 'http://localhost/profile/selfcontact',
682 'verb' => 'http://activitystrea.ms/schema/1.0/post',
685 'parent-uri-id' => 3,
687 'thr-parent-id' => 3,
689 'private' => Item::PUBLIC,
690 'gravity' => GRAVITY_PARENT,
691 'author-link' => 'http://localhost/profile/othercontact',
707 'verb' => 'http://activitystrea.ms/schema/1.0/post',
709 'body' => 'Friend user reply',
711 'parent-uri-id' => 1,
713 'thr-parent-id' => 1,
715 'private' => Item::PUBLIC,
716 'gravity' => GRAVITY_COMMENT,
717 'author-link' => 'http://localhost/profile/othercontact',
734 'verb' => 'http://activitystrea.ms/schema/1.0/post',
737 'parent-uri-id' => 1,
739 'thr-parent-id' => 1,
741 'private' => Item::PUBLIC,
742 'gravity' => GRAVITY_COMMENT,
743 'author-link' => 'http://localhost/profile/othercontact',
763 'verb' => 'http://activitystrea.ms/schema/1.0/post',
766 'parent-uri-id' => 6,
768 'thr-parent-id' => 6,
770 'private' => Item::PUBLIC,
771 'gravity' => GRAVITY_PARENT,
772 'author-link' => 'http://localhost/profile/othercontact',
783 'name' => 'Reply to',
784 'url' => 'http://localhost/display/1',
785 'photo' => 'http://localhost/',
786 'date' => '2020-01-01 12:12:02',
787 'msg' => 'A test reply from an item',
789 'link' => 'http://localhost/notification/1',
793 'otype' => Notification\ObjectType::ITEM,
794 'name_cache' => 'Reply to',
795 'msg_cache' => 'A test reply from an item',
809 'name' => 'Visible list',
815 'name' => 'Private list',
821 'term' => 'Saved search',