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',
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,
377 'parent-uri-id' => 1,
378 'thr-parent-id' => 1,
379 'gravity' => GRAVITY_COMMENT,
380 'network' => Protocol::DFRN,
385 'private' => Item::PUBLIC,
396 'parent-uri-id' => 3,
397 'thr-parent-id' => 3,
398 'gravity' => GRAVITY_PARENT,
399 'network' => Protocol::DFRN,
404 'private' => Item::PUBLIC,
415 'parent-uri-id' => 1,
416 'thr-parent-id' => 1,
417 'gravity' => GRAVITY_COMMENT,
418 'network' => Protocol::DFRN,
423 'private' => Item::PUBLIC,
434 'parent-uri-id' => 1,
435 'thr-parent-id' => 1,
436 'gravity' => GRAVITY_COMMENT,
437 'network' => Protocol::DFRN,
442 'private' => Item::PUBLIC,
453 'parent-uri-id' => 6,
454 'thr-parent-id' => 6,
455 'gravity' => GRAVITY_PARENT,
456 'network' => Protocol::DFRN,
461 'private' => Item::PUBLIC,
472 'parent-uri-id' => 1,
473 'thr-parent-id' => 1,
474 'gravity' => GRAVITY_PARENT,
475 'network' => Protocol::DFRN,
480 'private' => Item::PUBLIC,
491 'parent-uri-id' => 1,
492 'thr-parent-id' => 1,
493 'gravity' => GRAVITY_COMMENT,
494 'network' => Protocol::DFRN,
499 'private' => Item::PUBLIC,
510 'parent-uri-id' => 3,
511 'thr-parent-id' => 3,
512 'gravity' => GRAVITY_PARENT,
513 'network' => Protocol::DFRN,
518 'private' => Item::PUBLIC,
529 'parent-uri-id' => 1,
530 'thr-parent-id' => 1,
531 'gravity' => GRAVITY_COMMENT,
532 'network' => Protocol::DFRN,
537 'private' => Item::PUBLIC,
548 'parent-uri-id' => 1,
549 'thr-parent-id' => 1,
550 'gravity' => GRAVITY_COMMENT,
551 'network' => Protocol::DFRN,
556 'private' => Item::PUBLIC,
571 'parent-uri-id' => 6,
572 'thr-parent-id' => 6,
573 'private' => Item::PUBLIC,
574 'gravity' => GRAVITY_PARENT,
575 'network' => Protocol::DFRN,
586 'network' => Protocol::DFRN,
593 'network' => Protocol::DFRN,
600 'network' => Protocol::DFRN,
603 'post-thread-user' => [
613 'network' => Protocol::DFRN,
626 'network' => Protocol::DFRN,
639 'network' => Protocol::DFRN,
652 'network' => Protocol::DFRN,
665 'network' => Protocol::DFRN,
673 'post-user-id' => 12,
678 'network' => Protocol::DFRN,
687 'name' => 'Reply to',
688 'url' => 'http://localhost/display/1',
689 'photo' => 'http://localhost/',
690 'date' => '2020-01-01 12:12:02',
691 'msg' => 'A test reply from an item',
693 'link' => 'http://localhost/notification/1',
697 'otype' => Notification\ObjectType::ITEM,
698 'name_cache' => 'Reply to',
699 'msg_cache' => 'A test reply from an item',
713 'name' => 'Visible list',
719 'name' => 'Private list',
725 'term' => 'Saved search',