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',
188 'body' => 'Parent status',
189 'plink' => 'http://localhost/display/1',
194 'plink' => 'http://localhost/display/2',
198 'body' => 'Other user status',
199 'plink' => 'http://localhost/display/3',
203 'body' => 'Friend user reply',
204 'plink' => 'http://localhost/display/4',
208 'body' => '[share]Shared status[/share]',
209 'plink' => 'http://localhost/display/5',
213 'body' => 'Friend user status',
214 'plink' => 'http://localhost/display/6',
223 'network' => Protocol::DFRN,
230 'network' => Protocol::DFRN,
237 'network' => Protocol::DFRN,
240 'post-thread-user' => [
382 'verb' => 'http://activitystrea.ms/schema/1.0/post',
385 'parent-uri-id' => 1,
387 'thr-parent-id' => 1,
389 'private' => Item::PUBLIC,
390 'gravity' => GRAVITY_PARENT,
391 'author-link' => 'http://localhost/profile/selfcontact',
411 'verb' => 'http://activitystrea.ms/schema/1.0/post',
414 'parent-uri-id' => 1,
416 'thr-parent-id' => 1,
418 'private' => Item::PUBLIC,
419 'gravity' => GRAVITY_COMMENT,
420 'author-link' => 'http://localhost/profile/selfcontact',
436 'verb' => 'http://activitystrea.ms/schema/1.0/post',
439 'parent-uri-id' => 3,
441 'thr-parent-id' => 3,
443 'private' => Item::PUBLIC,
444 'gravity' => GRAVITY_PARENT,
445 'author-link' => 'http://localhost/profile/othercontact',
461 'verb' => 'http://activitystrea.ms/schema/1.0/post',
463 'body' => 'Friend user reply',
465 'parent-uri-id' => 1,
467 'thr-parent-id' => 1,
469 'private' => Item::PUBLIC,
470 'gravity' => GRAVITY_COMMENT,
471 'author-link' => 'http://localhost/profile/othercontact',
488 'verb' => 'http://activitystrea.ms/schema/1.0/post',
491 'parent-uri-id' => 1,
493 'thr-parent-id' => 1,
495 'private' => Item::PUBLIC,
496 'gravity' => GRAVITY_COMMENT,
497 'author-link' => 'http://localhost/profile/othercontact',
517 'verb' => 'http://activitystrea.ms/schema/1.0/post',
520 'parent-uri-id' => 6,
522 'thr-parent-id' => 6,
524 'private' => Item::PUBLIC,
525 'gravity' => GRAVITY_PARENT,
526 'author-link' => 'http://localhost/profile/othercontact',
537 'name' => 'Reply to',
538 'url' => 'http://localhost/display/1',
539 'photo' => 'http://localhost/',
540 'date' => '2020-01-01 12:12:02',
541 'msg' => 'A test reply from an item',
543 'link' => 'http://localhost/notification/1',
547 'otype' => Notification\ObjectType::ITEM,
548 'name_cache' => 'Reply to',
549 'msg_cache' => 'A test reply from an item',
563 'name' => 'Visible list',
569 'name' => 'Private list',
575 'term' => 'Saved search',