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;
26 use Friendica\Model\Verb;
37 // Base test config to avoid notice messages
42 'v' => 'http://localhost',
51 'k' => 'worker_dont_fork',
58 'username' => 'Test user',
59 'nickname' => 'selfcontact',
61 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
69 'name' => 'Self contact',
70 'nick' => 'selfcontact',
72 'nurl' => 'http://localhost/profile/selfcontact',
73 'url' => 'http://localhost/profile/selfcontact',
74 'about' => 'User used in tests',
77 'rel' => Contact::FOLLOWER,
78 'network' => Protocol::DFRN,
81 // Having the same name and nick allows us to test
82 // the fallback to api_get_nick() in api_get_user()
86 'name' => 'othercontact',
87 'nick' => 'othercontact',
89 'nurl' => 'http://localhost/profile/othercontact',
90 'url' => 'http://localhost/profile/othercontact',
93 'rel' => Contact::NOTHING,
94 'network' => Protocol::DFRN,
100 'name' => 'Friend contact',
101 'nick' => 'friendcontact',
103 'nurl' => 'http://localhost/profile/friendcontact',
104 'url' => 'http://localhost/profile/friendcontact',
107 'rel' => Contact::SHARING,
108 'network' => Protocol::DFRN,
109 'location' => 'DFRN',
114 'name' => 'Friend contact',
115 'nick' => 'friendcontact',
117 'nurl' => 'http://localhost/profile/friendcontact',
118 'url' => 'http://localhost/profile/friendcontact',
121 'rel' => Contact::SHARING,
122 'network' => Protocol::DFRN,
123 'location' => 'DFRN',
128 'name' => 'Mutual contact',
129 'nick' => 'mutualcontact',
131 'nurl' => 'http://localhost/profile/mutualcontact',
132 'url' => 'http://localhost/profile/mutualcontact',
135 'rel' => Contact::FRIEND,
136 'network' => Protocol::DFRN,
137 'location' => 'DFRN',
142 'name' => 'Mutual contact',
143 'nick' => 'mutualcontact',
145 'nurl' => 'http://localhost/profile/mutualcontact',
146 'url' => 'http://localhost/profile/mutualcontact',
149 'rel' => Contact::SHARING,
150 'network' => Protocol::DFRN,
151 'location' => 'DFRN',
189 'body' => 'Parent status',
190 'plink' => 'http://localhost/display/1',
195 'plink' => 'http://localhost/display/2',
199 'body' => 'Other user status',
200 'plink' => 'http://localhost/display/3',
204 'body' => 'Friend user reply',
205 'plink' => 'http://localhost/display/4',
209 'body' => '[share]Shared status[/share]',
210 'plink' => 'http://localhost/display/5',
214 'body' => 'Friend user status',
215 'plink' => 'http://localhost/display/6',
221 'parent-uri-id' => 1,
222 'thr-parent-id' => 1,
223 'gravity' => GRAVITY_PARENT,
224 'network' => Protocol::DFRN,
228 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
229 'private' => Item::PUBLIC,
234 'parent-uri-id' => 1,
235 'thr-parent-id' => 1,
236 'gravity' => GRAVITY_COMMENT,
237 'network' => Protocol::DFRN,
241 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
242 'private' => Item::PUBLIC,
247 'parent-uri-id' => 3,
248 'thr-parent-id' => 3,
249 'gravity' => GRAVITY_PARENT,
250 'network' => Protocol::DFRN,
254 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
255 'private' => Item::PUBLIC,
260 'parent-uri-id' => 1,
261 'thr-parent-id' => 1,
262 'gravity' => GRAVITY_COMMENT,
263 'network' => Protocol::DFRN,
267 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
268 'private' => Item::PUBLIC,
273 'parent-uri-id' => 1,
274 'thr-parent-id' => 1,
275 'gravity' => GRAVITY_COMMENT,
276 'network' => Protocol::DFRN,
280 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
281 'private' => Item::PUBLIC,
286 'parent-uri-id' => 6,
287 'thr-parent-id' => 6,
288 'gravity' => GRAVITY_PARENT,
289 'network' => Protocol::DFRN,
293 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
294 'private' => Item::PUBLIC,
306 'parent-uri-id' => 1,
307 'thr-parent-id' => 1,
308 'gravity' => GRAVITY_PARENT,
309 'network' => Protocol::DFRN,
313 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
314 'private' => Item::PUBLIC,
324 'parent-uri-id' => 1,
325 'thr-parent-id' => 1,
326 'gravity' => GRAVITY_COMMENT,
327 'network' => Protocol::DFRN,
331 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
332 'private' => Item::PUBLIC,
342 'parent-uri-id' => 3,
343 'thr-parent-id' => 3,
344 'gravity' => GRAVITY_PARENT,
345 'network' => Protocol::DFRN,
349 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
350 'private' => Item::PUBLIC,
360 'parent-uri-id' => 1,
361 'thr-parent-id' => 1,
362 'gravity' => GRAVITY_COMMENT,
363 'network' => Protocol::DFRN,
367 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
368 'private' => Item::PUBLIC,
378 'parent-uri-id' => 1,
379 'thr-parent-id' => 1,
380 'gravity' => GRAVITY_COMMENT,
381 'network' => Protocol::DFRN,
385 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
386 'private' => Item::PUBLIC,
396 'parent-uri-id' => 6,
397 'thr-parent-id' => 6,
398 'gravity' => GRAVITY_PARENT,
399 'network' => Protocol::DFRN,
403 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
404 'private' => Item::PUBLIC,
414 'parent-uri-id' => 1,
415 'thr-parent-id' => 1,
416 'gravity' => GRAVITY_PARENT,
417 'network' => Protocol::DFRN,
421 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
422 'private' => Item::PUBLIC,
432 'parent-uri-id' => 1,
433 'thr-parent-id' => 1,
434 'gravity' => GRAVITY_COMMENT,
435 'network' => Protocol::DFRN,
439 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
440 'private' => Item::PUBLIC,
450 'parent-uri-id' => 3,
451 'thr-parent-id' => 3,
452 'gravity' => GRAVITY_PARENT,
453 'network' => Protocol::DFRN,
457 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
458 'private' => Item::PUBLIC,
468 'parent-uri-id' => 1,
469 'thr-parent-id' => 1,
470 'gravity' => GRAVITY_COMMENT,
471 'network' => Protocol::DFRN,
475 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
476 'private' => Item::PUBLIC,
486 'parent-uri-id' => 1,
487 'thr-parent-id' => 1,
488 'gravity' => GRAVITY_COMMENT,
489 'network' => Protocol::DFRN,
493 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
494 'private' => Item::PUBLIC,
504 'parent-uri-id' => 6,
505 'thr-parent-id' => 6,
506 'gravity' => GRAVITY_PARENT,
507 'network' => Protocol::DFRN,
511 'vid' => Verb::getID('http://activitystrea.ms/schema/1.0/post'),
512 'private' => Item::PUBLIC,
522 'network' => Protocol::DFRN,
529 'network' => Protocol::DFRN,
536 'network' => Protocol::DFRN,
539 'post-thread-user' => [
548 'network' => Protocol::DFRN,
558 'network' => Protocol::DFRN,
568 'network' => Protocol::DFRN,
578 'network' => Protocol::DFRN,
588 'network' => Protocol::DFRN,
594 'post-user-id' => 12,
598 'network' => Protocol::DFRN,
605 'name' => 'Reply to',
606 'url' => 'http://localhost/display/1',
607 'photo' => 'http://localhost/',
608 'date' => '2020-01-01 12:12:02',
609 'msg' => 'A test reply from an item',
611 'link' => 'http://localhost/notification/1',
615 'otype' => Notification\ObjectType::ITEM,
616 'name_cache' => 'Reply to',
617 'msg_cache' => 'A test reply from an item',
631 'name' => 'Visible list',
637 'name' => 'Private list',
643 'term' => 'Saved search',