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',
57 'username' => 'Test user',
58 'nickname' => 'selfcontact',
60 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
68 'name' => 'Self contact',
69 'nick' => 'selfcontact',
71 'nurl' => 'http://localhost/profile/selfcontact',
72 'url' => 'http://localhost/profile/selfcontact',
73 'about' => 'User used in tests',
76 'rel' => Contact::FOLLOWER,
77 'network' => Protocol::DFRN,
80 // Having the same name and nick allows us to test
81 // the fallback to api_get_nick() in api_get_user()
85 'name' => 'othercontact',
86 'nick' => 'othercontact',
88 'nurl' => 'http://localhost/profile/othercontact',
89 'url' => 'http://localhost/profile/othercontact',
92 'rel' => Contact::NOTHING,
93 'network' => Protocol::DFRN,
99 'name' => 'Friend contact',
100 'nick' => 'friendcontact',
102 'nurl' => 'http://localhost/profile/friendcontact',
103 'url' => 'http://localhost/profile/friendcontact',
106 'rel' => Contact::SHARING,
107 'network' => Protocol::DFRN,
108 'location' => 'DFRN',
113 'name' => 'Friend contact',
114 'nick' => 'friendcontact',
116 'nurl' => 'http://localhost/profile/friendcontact',
117 'url' => 'http://localhost/profile/friendcontact',
120 'rel' => Contact::SHARING,
121 'network' => Protocol::DFRN,
122 'location' => 'DFRN',
127 'name' => 'Mutual contact',
128 'nick' => 'mutualcontact',
130 'nurl' => 'http://localhost/profile/mutualcontact',
131 'url' => 'http://localhost/profile/mutualcontact',
134 'rel' => Contact::FRIEND,
135 'network' => Protocol::DFRN,
136 'location' => 'DFRN',
141 'name' => 'Mutual contact',
142 'nick' => 'mutualcontact',
144 'nurl' => 'http://localhost/profile/mutualcontact',
145 'url' => 'http://localhost/profile/mutualcontact',
148 'rel' => Contact::SHARING,
149 'network' => Protocol::DFRN,
150 'location' => 'DFRN',
192 'name' => 'http://activitystrea.ms/schema/1.0/like',
196 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
200 'name' => 'http://purl.org/zot/activity/attendyes',
204 'name' => 'http://purl.org/zot/activity/attendno',
208 'name' => 'http://purl.org/zot/activity/attendmaybe',
212 'name' => 'http://activitystrea.ms/schema/1.0/follow',
216 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
220 'name' => 'http://activitystrea.ms/schema/1.0/post',
226 'body' => 'Parent status',
227 'plink' => 'http://localhost/display/1',
232 'plink' => 'http://localhost/display/2',
236 'body' => 'Other user status',
237 'plink' => 'http://localhost/display/3',
241 'body' => 'Friend user reply',
242 'plink' => 'http://localhost/display/4',
246 'body' => '[share]Shared status[/share]',
247 'plink' => 'http://localhost/display/5',
251 'body' => 'Friend user status',
252 'plink' => 'http://localhost/display/6',
258 'parent-uri-id' => 1,
259 'thr-parent-id' => 1,
260 'gravity' => GRAVITY_PARENT,
261 'network' => Protocol::DFRN,
266 'private' => Item::PUBLIC,
271 'parent-uri-id' => 1,
272 'thr-parent-id' => 1,
273 'gravity' => GRAVITY_COMMENT,
274 'network' => Protocol::DFRN,
279 'private' => Item::PUBLIC,
284 'parent-uri-id' => 3,
285 'thr-parent-id' => 3,
286 'gravity' => GRAVITY_PARENT,
287 'network' => Protocol::DFRN,
292 'private' => Item::PUBLIC,
297 'parent-uri-id' => 1,
298 'thr-parent-id' => 1,
299 'gravity' => GRAVITY_COMMENT,
300 'network' => Protocol::DFRN,
305 '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,
323 'parent-uri-id' => 6,
324 'thr-parent-id' => 6,
325 'gravity' => GRAVITY_PARENT,
326 'network' => Protocol::DFRN,
331 'private' => Item::PUBLIC,
343 'parent-uri-id' => 1,
344 'thr-parent-id' => 1,
345 'gravity' => GRAVITY_PARENT,
346 'network' => Protocol::DFRN,
351 'private' => Item::PUBLIC,
361 'parent-uri-id' => 1,
362 'thr-parent-id' => 1,
363 'gravity' => GRAVITY_COMMENT,
364 'network' => Protocol::DFRN,
369 'private' => Item::PUBLIC,
379 'parent-uri-id' => 3,
380 'thr-parent-id' => 3,
381 'gravity' => GRAVITY_PARENT,
382 'network' => Protocol::DFRN,
387 'private' => Item::PUBLIC,
397 'parent-uri-id' => 1,
398 'thr-parent-id' => 1,
399 'gravity' => GRAVITY_COMMENT,
400 'network' => Protocol::DFRN,
405 '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,
433 'parent-uri-id' => 6,
434 'thr-parent-id' => 6,
435 'gravity' => GRAVITY_PARENT,
436 'network' => Protocol::DFRN,
441 'private' => Item::PUBLIC,
451 'parent-uri-id' => 1,
452 'thr-parent-id' => 1,
453 'gravity' => GRAVITY_PARENT,
454 'network' => Protocol::DFRN,
459 'private' => Item::PUBLIC,
469 'parent-uri-id' => 1,
470 'thr-parent-id' => 1,
471 'gravity' => GRAVITY_COMMENT,
472 'network' => Protocol::DFRN,
477 'private' => Item::PUBLIC,
487 'parent-uri-id' => 3,
488 'thr-parent-id' => 3,
489 'gravity' => GRAVITY_PARENT,
490 'network' => Protocol::DFRN,
495 'private' => Item::PUBLIC,
505 'parent-uri-id' => 1,
506 'thr-parent-id' => 1,
507 'gravity' => GRAVITY_COMMENT,
508 'network' => Protocol::DFRN,
513 'private' => Item::PUBLIC,
523 'parent-uri-id' => 1,
524 'thr-parent-id' => 1,
525 'gravity' => GRAVITY_COMMENT,
526 'network' => Protocol::DFRN,
531 'private' => Item::PUBLIC,
541 'parent-uri-id' => 6,
542 'thr-parent-id' => 6,
543 'gravity' => GRAVITY_PARENT,
544 'network' => Protocol::DFRN,
549 'private' => Item::PUBLIC,
559 'network' => Protocol::DFRN,
566 'network' => Protocol::DFRN,
573 'network' => Protocol::DFRN,
576 'post-thread-user' => [
585 'network' => Protocol::DFRN,
595 'network' => Protocol::DFRN,
605 'network' => Protocol::DFRN,
615 'network' => Protocol::DFRN,
625 'network' => Protocol::DFRN,
631 'post-user-id' => 12,
635 'network' => Protocol::DFRN,
642 'name' => 'Reply to',
643 'url' => 'http://localhost/display/1',
644 'photo' => 'http://localhost/',
645 'date' => '2020-01-01 12:12:02',
646 'msg' => 'A test reply from an item',
648 'link' => 'http://localhost/notification/1',
652 'otype' => Notification\ObjectType::ITEM,
653 'name_cache' => 'Reply to',
654 'msg_cache' => 'A test reply from an item',
668 'name' => 'Visible list',
674 'name' => 'Private list',
680 'term' => 'Saved search',