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,
353 'parent-uri-id' => 1,
354 'thr-parent-id' => 1,
355 'gravity' => GRAVITY_PARENT,
356 'network' => Protocol::DFRN,
361 'private' => Item::PUBLIC,
371 'parent-uri-id' => 1,
372 'thr-parent-id' => 1,
373 'gravity' => GRAVITY_COMMENT,
374 'network' => Protocol::DFRN,
379 'private' => Item::PUBLIC,
389 'parent-uri-id' => 3,
390 'thr-parent-id' => 3,
391 'gravity' => GRAVITY_PARENT,
392 'network' => Protocol::DFRN,
397 'private' => Item::PUBLIC,
407 'parent-uri-id' => 1,
408 'thr-parent-id' => 1,
409 'gravity' => GRAVITY_COMMENT,
410 'network' => Protocol::DFRN,
415 'private' => Item::PUBLIC,
425 'parent-uri-id' => 1,
426 'thr-parent-id' => 1,
427 'gravity' => GRAVITY_COMMENT,
428 'network' => Protocol::DFRN,
433 'private' => Item::PUBLIC,
443 'parent-uri-id' => 6,
444 'thr-parent-id' => 6,
445 'gravity' => GRAVITY_PARENT,
446 'network' => Protocol::DFRN,
451 'private' => Item::PUBLIC,
461 'parent-uri-id' => 1,
462 'thr-parent-id' => 1,
463 'gravity' => GRAVITY_PARENT,
464 'network' => Protocol::DFRN,
469 'private' => Item::PUBLIC,
479 'parent-uri-id' => 1,
480 'thr-parent-id' => 1,
481 'gravity' => GRAVITY_COMMENT,
482 'network' => Protocol::DFRN,
487 'private' => Item::PUBLIC,
497 'parent-uri-id' => 3,
498 'thr-parent-id' => 3,
499 'gravity' => GRAVITY_PARENT,
500 'network' => Protocol::DFRN,
505 'private' => Item::PUBLIC,
515 'parent-uri-id' => 1,
516 'thr-parent-id' => 1,
517 'gravity' => GRAVITY_COMMENT,
518 'network' => Protocol::DFRN,
523 'private' => Item::PUBLIC,
533 'parent-uri-id' => 1,
534 'thr-parent-id' => 1,
535 'gravity' => GRAVITY_COMMENT,
536 'network' => Protocol::DFRN,
541 'private' => Item::PUBLIC,
551 'parent-uri-id' => 6,
552 'thr-parent-id' => 6,
553 'gravity' => GRAVITY_PARENT,
554 'network' => Protocol::DFRN,
559 'private' => Item::PUBLIC,
569 'network' => Protocol::DFRN,
576 'network' => Protocol::DFRN,
583 'network' => Protocol::DFRN,
586 'post-thread-user' => [
596 'network' => Protocol::DFRN,
607 'network' => Protocol::DFRN,
618 'network' => Protocol::DFRN,
629 'network' => Protocol::DFRN,
640 'network' => Protocol::DFRN,
646 'post-user-id' => 12,
651 'network' => Protocol::DFRN,
658 'name' => 'Reply to',
659 'url' => 'http://localhost/display/1',
660 'photo' => 'http://localhost/',
661 'date' => '2020-01-01 12:12:02',
662 'msg' => 'A test reply from an item',
664 'link' => 'http://localhost/notification/1',
668 'otype' => Notification\ObjectType::ITEM,
669 'name_cache' => 'Reply to',
670 'msg_cache' => 'A test reply from an item',
684 'name' => 'Visible list',
690 'name' => 'Private list',
696 'term' => 'Saved search',