3 * @copyright Copyright (C) 2010-2021, the Friendica project
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',
55 'k' => 'curl_timeout',
67 'username' => 'Test user',
68 'nickname' => 'selfcontact',
70 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
78 'name' => 'Self contact',
79 'nick' => 'selfcontact',
81 'nurl' => 'http://localhost/profile/selfcontact',
82 'url' => 'http://localhost/profile/selfcontact',
83 'about' => 'User used in tests',
86 'rel' => Contact::FOLLOWER,
87 'network' => Protocol::DFRN,
90 // Having the same name and nick allows us to test
91 // the fallback to api_get_nick() in api_get_user()
95 'name' => 'othercontact',
96 'nick' => 'othercontact',
98 'nurl' => 'http://localhost/profile/othercontact',
99 'url' => 'http://localhost/profile/othercontact',
102 'rel' => Contact::NOTHING,
103 'network' => Protocol::DFRN,
104 'location' => 'DFRN',
109 'name' => 'Friend contact',
110 'nick' => 'friendcontact',
112 'nurl' => 'http://localhost/profile/friendcontact',
113 'url' => 'http://localhost/profile/friendcontact',
116 'rel' => Contact::SHARING,
117 'network' => Protocol::DFRN,
118 'location' => 'DFRN',
123 'name' => 'Friend contact',
124 'nick' => 'friendcontact',
126 'nurl' => 'http://localhost/profile/friendcontact',
127 'url' => 'http://localhost/profile/friendcontact',
130 'rel' => Contact::SHARING,
131 'network' => Protocol::DFRN,
132 'location' => 'DFRN',
137 'name' => 'Mutual contact',
138 'nick' => 'mutualcontact',
140 'nurl' => 'http://localhost/profile/mutualcontact',
141 'url' => 'http://localhost/profile/mutualcontact',
144 'rel' => Contact::FRIEND,
145 'network' => Protocol::DFRN,
146 'location' => 'DFRN',
151 'name' => 'Mutual contact',
152 'nick' => 'mutualcontact',
154 'nurl' => 'http://localhost/profile/mutualcontact',
155 'url' => 'http://localhost/profile/mutualcontact',
158 'rel' => Contact::SHARING,
159 'network' => Protocol::DFRN,
160 'location' => 'DFRN',
202 'name' => 'http://activitystrea.ms/schema/1.0/like',
206 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
210 'name' => 'http://purl.org/zot/activity/attendyes',
214 'name' => 'http://purl.org/zot/activity/attendno',
218 'name' => 'http://purl.org/zot/activity/attendmaybe',
222 'name' => 'http://activitystrea.ms/schema/1.0/follow',
226 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
230 'name' => 'http://activitystrea.ms/schema/1.0/post',
236 'body' => 'Parent status',
237 'plink' => 'http://localhost/display/1',
242 'plink' => 'http://localhost/display/2',
246 'body' => 'Other user status',
247 'plink' => 'http://localhost/display/3',
251 'body' => 'Friend user reply',
252 'plink' => 'http://localhost/display/4',
256 'body' => '[share]Shared status[/share]',
257 'plink' => 'http://localhost/display/5',
261 'body' => 'Friend user status',
262 'plink' => 'http://localhost/display/6',
268 'parent-uri-id' => 1,
269 'thr-parent-id' => 1,
270 'gravity' => GRAVITY_PARENT,
271 'network' => Protocol::DFRN,
276 'private' => Item::PUBLIC,
282 'parent-uri-id' => 1,
283 'thr-parent-id' => 1,
284 'gravity' => GRAVITY_COMMENT,
285 'network' => Protocol::DFRN,
290 'private' => Item::PUBLIC,
296 'parent-uri-id' => 3,
297 'thr-parent-id' => 3,
298 'gravity' => GRAVITY_PARENT,
299 'network' => Protocol::DFRN,
304 'private' => Item::PUBLIC,
310 'parent-uri-id' => 1,
311 'thr-parent-id' => 1,
312 'gravity' => GRAVITY_COMMENT,
313 'network' => Protocol::DFRN,
318 'private' => Item::PUBLIC,
324 'parent-uri-id' => 1,
325 'thr-parent-id' => 1,
326 'gravity' => GRAVITY_COMMENT,
327 'network' => Protocol::DFRN,
332 'private' => Item::PUBLIC,
338 'parent-uri-id' => 6,
339 'thr-parent-id' => 6,
340 'gravity' => GRAVITY_PARENT,
341 'network' => Protocol::DFRN,
346 'private' => Item::PUBLIC,
363 'parent-uri-id' => 1,
364 'thr-parent-id' => 1,
365 'private' => Item::PUBLIC,
366 'gravity' => GRAVITY_PARENT,
367 'network' => Protocol::DFRN,
378 'parent-uri-id' => 1,
379 'thr-parent-id' => 1,
380 'gravity' => GRAVITY_COMMENT,
381 'network' => Protocol::DFRN,
386 'private' => Item::PUBLIC,
398 'parent-uri-id' => 3,
399 'thr-parent-id' => 3,
400 'gravity' => GRAVITY_PARENT,
401 'network' => Protocol::DFRN,
406 'private' => Item::PUBLIC,
418 'parent-uri-id' => 1,
419 'thr-parent-id' => 1,
420 'gravity' => GRAVITY_COMMENT,
421 'network' => Protocol::DFRN,
426 'private' => Item::PUBLIC,
438 'parent-uri-id' => 1,
439 'thr-parent-id' => 1,
440 'gravity' => GRAVITY_COMMENT,
441 'network' => Protocol::DFRN,
446 'private' => Item::PUBLIC,
458 'parent-uri-id' => 6,
459 'thr-parent-id' => 6,
460 'gravity' => GRAVITY_PARENT,
461 'network' => Protocol::DFRN,
466 'private' => Item::PUBLIC,
478 'parent-uri-id' => 1,
479 'thr-parent-id' => 1,
480 'gravity' => GRAVITY_PARENT,
481 'network' => Protocol::DFRN,
486 'private' => Item::PUBLIC,
498 'parent-uri-id' => 1,
499 'thr-parent-id' => 1,
500 'gravity' => GRAVITY_COMMENT,
501 'network' => Protocol::DFRN,
506 'private' => Item::PUBLIC,
518 'parent-uri-id' => 3,
519 'thr-parent-id' => 3,
520 'gravity' => GRAVITY_PARENT,
521 'network' => Protocol::DFRN,
526 'private' => Item::PUBLIC,
538 'parent-uri-id' => 1,
539 'thr-parent-id' => 1,
540 'gravity' => GRAVITY_COMMENT,
541 'network' => Protocol::DFRN,
546 'private' => Item::PUBLIC,
558 'parent-uri-id' => 1,
559 'thr-parent-id' => 1,
560 'gravity' => GRAVITY_COMMENT,
561 'network' => Protocol::DFRN,
566 'private' => Item::PUBLIC,
582 'parent-uri-id' => 6,
583 'thr-parent-id' => 6,
584 'private' => Item::PUBLIC,
585 'gravity' => GRAVITY_PARENT,
586 'network' => Protocol::DFRN,
598 'network' => Protocol::DFRN,
605 'network' => Protocol::DFRN,
612 'network' => Protocol::DFRN,
615 'post-thread-user' => [
625 'network' => Protocol::DFRN,
638 'network' => Protocol::DFRN,
651 'network' => Protocol::DFRN,
664 'network' => Protocol::DFRN,
677 'network' => Protocol::DFRN,
685 'post-user-id' => 12,
690 'network' => Protocol::DFRN,
699 'name' => 'Reply to',
700 'url' => 'http://localhost/display/1',
701 'photo' => 'http://localhost/',
702 'date' => '2020-01-01 12:12:02',
703 'msg' => 'A test reply from an item',
705 'link' => 'http://localhost/notification/1',
709 'otype' => Notification\ObjectType::ITEM,
710 'name_cache' => 'Reply to',
711 'msg_cache' => 'A test reply from an item',
725 'name' => 'Visible list',
731 'name' => 'Private list',
737 'term' => 'Saved search',