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,
281 'parent-uri-id' => 1,
282 'thr-parent-id' => 1,
283 'gravity' => GRAVITY_COMMENT,
284 'network' => Protocol::DFRN,
289 'private' => Item::PUBLIC,
294 'parent-uri-id' => 3,
295 'thr-parent-id' => 3,
296 'gravity' => GRAVITY_PARENT,
297 'network' => Protocol::DFRN,
302 'private' => Item::PUBLIC,
307 'parent-uri-id' => 1,
308 'thr-parent-id' => 1,
309 'gravity' => GRAVITY_COMMENT,
310 'network' => Protocol::DFRN,
315 'private' => Item::PUBLIC,
320 'parent-uri-id' => 1,
321 'thr-parent-id' => 1,
322 'gravity' => GRAVITY_COMMENT,
323 'network' => Protocol::DFRN,
328 'private' => Item::PUBLIC,
333 'parent-uri-id' => 6,
334 'thr-parent-id' => 6,
335 'gravity' => GRAVITY_PARENT,
336 'network' => Protocol::DFRN,
341 'private' => Item::PUBLIC,
354 'parent-uri-id' => 1,
355 'thr-parent-id' => 1,
356 'gravity' => GRAVITY_PARENT,
357 'network' => Protocol::DFRN,
362 'private' => Item::PUBLIC,
373 'parent-uri-id' => 1,
374 'thr-parent-id' => 1,
375 'gravity' => GRAVITY_COMMENT,
376 'network' => Protocol::DFRN,
381 'private' => Item::PUBLIC,
392 'parent-uri-id' => 3,
393 'thr-parent-id' => 3,
394 'gravity' => GRAVITY_PARENT,
395 'network' => Protocol::DFRN,
400 'private' => Item::PUBLIC,
411 'parent-uri-id' => 1,
412 'thr-parent-id' => 1,
413 'gravity' => GRAVITY_COMMENT,
414 'network' => Protocol::DFRN,
419 'private' => Item::PUBLIC,
430 'parent-uri-id' => 1,
431 'thr-parent-id' => 1,
432 'gravity' => GRAVITY_COMMENT,
433 'network' => Protocol::DFRN,
438 'private' => Item::PUBLIC,
449 'parent-uri-id' => 6,
450 'thr-parent-id' => 6,
451 'gravity' => GRAVITY_PARENT,
452 'network' => Protocol::DFRN,
457 'private' => Item::PUBLIC,
468 'parent-uri-id' => 1,
469 'thr-parent-id' => 1,
470 'gravity' => GRAVITY_PARENT,
471 'network' => Protocol::DFRN,
476 'private' => Item::PUBLIC,
487 'parent-uri-id' => 1,
488 'thr-parent-id' => 1,
489 'gravity' => GRAVITY_COMMENT,
490 'network' => Protocol::DFRN,
495 'private' => Item::PUBLIC,
506 'parent-uri-id' => 3,
507 'thr-parent-id' => 3,
508 'gravity' => GRAVITY_PARENT,
509 'network' => Protocol::DFRN,
514 'private' => Item::PUBLIC,
525 'parent-uri-id' => 1,
526 'thr-parent-id' => 1,
527 'gravity' => GRAVITY_COMMENT,
528 'network' => Protocol::DFRN,
533 'private' => Item::PUBLIC,
544 'parent-uri-id' => 1,
545 'thr-parent-id' => 1,
546 'gravity' => GRAVITY_COMMENT,
547 'network' => Protocol::DFRN,
552 'private' => Item::PUBLIC,
563 'parent-uri-id' => 6,
564 'thr-parent-id' => 6,
565 'gravity' => GRAVITY_PARENT,
566 'network' => Protocol::DFRN,
571 'private' => Item::PUBLIC,
581 'network' => Protocol::DFRN,
588 'network' => Protocol::DFRN,
595 'network' => Protocol::DFRN,
598 'post-thread-user' => [
608 'network' => Protocol::DFRN,
619 'network' => Protocol::DFRN,
630 'network' => Protocol::DFRN,
641 'network' => Protocol::DFRN,
652 'network' => Protocol::DFRN,
658 'post-user-id' => 12,
663 'network' => Protocol::DFRN,
670 'name' => 'Reply to',
671 'url' => 'http://localhost/display/1',
672 'photo' => 'http://localhost/',
673 'date' => '2020-01-01 12:12:02',
674 'msg' => 'A test reply from an item',
676 'link' => 'http://localhost/notification/1',
680 'otype' => Notification\ObjectType::ITEM,
681 'name_cache' => 'Reply to',
682 'msg_cache' => 'A test reply from an item',
696 'name' => 'Visible list',
702 'name' => 'Private list',
708 'term' => 'Saved search',