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' => [
319 'verb' => 'http://activitystrea.ms/schema/1.0/post',
322 'parent-uri-id' => 1,
324 'thr-parent-id' => 1,
326 'private' => Item::PUBLIC,
327 'gravity' => GRAVITY_PARENT,
328 'author-link' => 'http://localhost/profile/selfcontact',
348 'verb' => 'http://activitystrea.ms/schema/1.0/post',
351 'parent-uri-id' => 1,
353 'thr-parent-id' => 1,
355 'private' => Item::PUBLIC,
356 'gravity' => GRAVITY_COMMENT,
357 'author-link' => 'http://localhost/profile/selfcontact',
373 'verb' => 'http://activitystrea.ms/schema/1.0/post',
376 'parent-uri-id' => 3,
378 'thr-parent-id' => 3,
380 'private' => Item::PUBLIC,
381 'gravity' => GRAVITY_PARENT,
382 'author-link' => 'http://localhost/profile/othercontact',
398 'verb' => 'http://activitystrea.ms/schema/1.0/post',
400 'body' => 'Friend user reply',
402 'parent-uri-id' => 1,
404 'thr-parent-id' => 1,
406 'private' => Item::PUBLIC,
407 'gravity' => GRAVITY_COMMENT,
408 'author-link' => 'http://localhost/profile/othercontact',
425 'verb' => 'http://activitystrea.ms/schema/1.0/post',
428 'parent-uri-id' => 1,
430 'thr-parent-id' => 1,
432 'private' => Item::PUBLIC,
433 'gravity' => GRAVITY_COMMENT,
434 'author-link' => 'http://localhost/profile/othercontact',
454 'verb' => 'http://activitystrea.ms/schema/1.0/post',
457 'parent-uri-id' => 6,
459 'thr-parent-id' => 6,
461 'private' => Item::PUBLIC,
462 'gravity' => GRAVITY_PARENT,
463 'author-link' => 'http://localhost/profile/othercontact',
474 'name' => 'Reply to',
475 'url' => 'http://localhost/display/1',
476 'photo' => 'http://localhost/',
477 'date' => '2020-01-01 12:12:02',
478 'msg' => 'A test reply from an item',
480 'link' => 'http://localhost/notification/1',
484 'otype' => Notification\ObjectType::ITEM,
485 'name_cache' => 'Reply to',
486 'msg_cache' => 'A test reply from an item',
500 'name' => 'Visible list',
506 'name' => 'Private list',
512 'term' => 'Saved search',