3 * @copyright Copyright (C) 2010-2021, the Friendica project
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;
38 // Base test config to avoid notice messages
43 'v' => 'http://localhost',
52 'k' => 'worker_dont_fork',
57 'k' => 'curl_timeout',
69 'username' => 'Test user',
70 'nickname' => 'selfcontact',
72 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
110 'uri' => 'http://localhost/profile/selfcontact',
115 'uri' => 'http://localhost/profile/othercontact',
120 'uri' => 'http://localhost/profile/friendcontact',
125 'uri' => 'http://localhost/profile/mutualcontact',
134 'name' => 'Self contact',
135 'nick' => 'selfcontact',
137 'nurl' => 'http://localhost/profile/selfcontact',
138 'url' => 'http://localhost/profile/selfcontact',
139 'about' => 'User used in tests',
142 'rel' => Contact::FOLLOWER,
143 'network' => Protocol::DFRN,
144 'location' => 'DFRN',
146 // Having the same name and nick allows us to test
147 // the fallback to api_get_nick() in api_get_user()
152 'name' => 'othercontact',
153 'nick' => 'othercontact',
155 'nurl' => 'http://localhost/profile/othercontact',
156 'url' => 'http://localhost/profile/othercontact',
159 'rel' => Contact::NOTHING,
160 'network' => Protocol::DFRN,
161 'location' => 'DFRN',
167 'name' => 'Friend contact',
168 'nick' => 'friendcontact',
170 'nurl' => 'http://localhost/profile/friendcontact',
171 'url' => 'http://localhost/profile/friendcontact',
174 'rel' => Contact::SHARING,
175 'network' => Protocol::DFRN,
176 'location' => 'DFRN',
182 'name' => 'Friend contact',
183 'nick' => 'friendcontact',
185 'nurl' => 'http://localhost/profile/friendcontact',
186 'url' => 'http://localhost/profile/friendcontact',
189 'rel' => Contact::SHARING,
190 'network' => Protocol::DFRN,
191 'location' => 'DFRN',
197 'name' => 'Mutual contact',
198 'nick' => 'mutualcontact',
200 'nurl' => 'http://localhost/profile/mutualcontact',
201 'url' => 'http://localhost/profile/mutualcontact',
204 'rel' => Contact::FRIEND,
205 'network' => Protocol::DFRN,
206 'location' => 'DFRN',
212 'name' => 'Mutual contact',
213 'nick' => 'mutualcontact',
215 'nurl' => 'http://localhost/profile/mutualcontact',
216 'url' => 'http://localhost/profile/mutualcontact',
219 'rel' => Contact::SHARING,
220 'network' => Protocol::DFRN,
221 'location' => 'DFRN',
227 'name' => 'Self contact',
228 'nick' => 'selfcontact',
230 'nurl' => 'http://localhost/profile/selfcontact',
231 'url' => 'http://localhost/profile/selfcontact',
232 'about' => 'User used in tests',
235 'rel' => Contact::FOLLOWER,
236 'network' => Protocol::DFRN,
237 'location' => 'DFRN',
242 "url" => "http://localhost/profile/selfcontact",
246 "following" => "http://localhost/following/selfcontact",
247 "followers" => "http://localhost/followers/selfcontact",
248 "inbox" => "http://localhost/inbox/selfcontact",
249 "outbox" => "http://localhost/outbox/selfcontact",
250 "sharedinbox" => "http://localhost/inbox",
251 "manually-approve" => 1,
253 "nick" => "selfcontact",
254 "name" => "Self contact",
255 "about" => "User used in tests",
258 "photo" => "http://localhost/photo/profile/admin.jpeg",
260 "addr" => "selfcontact@localhost",
262 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzLquDFnFxNYZZFQNbA9f\nkgtUJpC+MPrhxhEsjxme1ivvE4itdPnCueBHifknUkwfmqormyeqr4TdoVbNuKRg\nj2QRBdtaGbUJLQVdbiTKFOmJIYMtV05WIIHEhUW84fwIXmF+6u3kbOw+sIjWY3OW\nwC/2+54HiYS2n8cddfwoZBim6Na8yyQI8pQSKqJ+I4gDfkGuoVex0svNPEv9liLE\nykpQ3PuoeLJV2Wex0Cy6FYPgcfH6xvvUVxh6e8w0w22jC3DJInfDrmbw5H7aUbf+\nMMwV3TVI6/CqTO0cLEOZUjsUwdm6lIV0O0fTsrkjU9G0bc0sLJl7n9i9ICDOKOMf\nCLaK2Pj2sVbpkzXJoufLUDf0oSftdVvN9jR9WYxRdnwsyF8N/xVTw8AsyHhkXawR\n3YDgi6i2uZj5kvG7GPBf7EPZ/MpbGhEZB+/GQuZuyhLdgFDSi/uX8STBmn1jI/zY\nTLZ8JCwMzFKAXAtYaBPklZBbcRyz9O1893MsAXO8d6ODTOkD324gAjRUtuOMscYc\nWV98NZIUSbqQrznmMoJn1fiMNVgx+UXOPkiZuDxnrr1T3vynKnl5LXmadx2YeoAf\nxPeCoDb0eJtCDLcsTZ9qlztaEaohPV+H3HBSpdItea7LgAbccILHPssk9tUgmHVl\na5yV8uFenhKKQ9g93Pt63LsCAwEAAQ==\n-----END PUBLIC KEY-----",
263 "subscribe" => "/follow?url={uri}",
266 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
267 "following_count" => 0,
268 "followers_count" => 0,
269 "statuses_count" => 0,
270 "updated" => "2021-11-19 19:17:59",
280 'name' => 'http://activitystrea.ms/schema/1.0/like',
284 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
288 'name' => 'http://purl.org/zot/activity/attendyes',
292 'name' => 'http://purl.org/zot/activity/attendno',
296 'name' => 'http://purl.org/zot/activity/attendmaybe',
300 'name' => 'http://activitystrea.ms/schema/1.0/follow',
304 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
308 'name' => 'http://activitystrea.ms/schema/1.0/post',
314 'body' => 'Parent status',
315 'plink' => 'http://localhost/display/1',
320 'plink' => 'http://localhost/display/2',
324 'body' => 'Other user status',
325 'plink' => 'http://localhost/display/3',
329 'body' => 'Friend user reply',
330 'plink' => 'http://localhost/display/4',
334 'body' => '[share]Shared status[/share]',
335 'plink' => 'http://localhost/display/5',
339 'body' => 'Friend user status',
340 'plink' => 'http://localhost/display/6',
346 'parent-uri-id' => 1,
347 'thr-parent-id' => 1,
348 'gravity' => GRAVITY_PARENT,
349 'network' => Protocol::DFRN,
354 '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,
376 'parent-uri-id' => 3,
377 'thr-parent-id' => 3,
378 'gravity' => GRAVITY_PARENT,
379 'network' => Protocol::DFRN,
384 'private' => Item::PUBLIC,
391 'parent-uri-id' => 1,
392 'thr-parent-id' => 1,
393 'gravity' => GRAVITY_COMMENT,
394 'network' => Protocol::DFRN,
399 'private' => Item::PUBLIC,
406 'parent-uri-id' => 1,
407 'thr-parent-id' => 1,
408 'gravity' => GRAVITY_COMMENT,
409 'network' => Protocol::DFRN,
414 'private' => Item::PUBLIC,
421 'parent-uri-id' => 6,
422 'thr-parent-id' => 6,
423 'gravity' => GRAVITY_PARENT,
424 'network' => Protocol::DFRN,
429 'private' => Item::PUBLIC,
447 'parent-uri-id' => 1,
448 'thr-parent-id' => 1,
449 'private' => Item::PUBLIC,
451 'gravity' => GRAVITY_PARENT,
452 'network' => Protocol::DFRN,
463 'parent-uri-id' => 1,
464 'thr-parent-id' => 1,
465 'gravity' => GRAVITY_COMMENT,
466 'network' => Protocol::DFRN,
471 'private' => Item::PUBLIC,
484 'parent-uri-id' => 3,
485 'thr-parent-id' => 3,
486 'gravity' => GRAVITY_PARENT,
487 'network' => Protocol::DFRN,
492 '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,
526 'parent-uri-id' => 1,
527 'thr-parent-id' => 1,
528 'gravity' => GRAVITY_COMMENT,
529 'network' => Protocol::DFRN,
534 'private' => Item::PUBLIC,
547 'parent-uri-id' => 6,
548 'thr-parent-id' => 6,
549 'gravity' => GRAVITY_PARENT,
550 'network' => Protocol::DFRN,
555 'private' => Item::PUBLIC,
568 'parent-uri-id' => 1,
569 'thr-parent-id' => 1,
570 'gravity' => GRAVITY_PARENT,
571 'network' => Protocol::DFRN,
576 'private' => Item::PUBLIC,
589 'parent-uri-id' => 1,
590 'thr-parent-id' => 1,
591 'gravity' => GRAVITY_COMMENT,
592 'network' => Protocol::DFRN,
597 'private' => Item::PUBLIC,
610 'parent-uri-id' => 3,
611 'thr-parent-id' => 3,
612 'gravity' => GRAVITY_PARENT,
613 'network' => Protocol::DFRN,
618 'private' => Item::PUBLIC,
631 'parent-uri-id' => 1,
632 'thr-parent-id' => 1,
633 'gravity' => GRAVITY_COMMENT,
634 'network' => Protocol::DFRN,
639 'private' => Item::PUBLIC,
652 'parent-uri-id' => 1,
653 'thr-parent-id' => 1,
654 'gravity' => GRAVITY_COMMENT,
655 'network' => Protocol::DFRN,
660 'private' => Item::PUBLIC,
677 'parent-uri-id' => 6,
678 'thr-parent-id' => 6,
679 'private' => Item::PUBLIC,
681 'gravity' => GRAVITY_PARENT,
682 'network' => Protocol::DFRN,
694 'network' => Protocol::DFRN,
701 'network' => Protocol::DFRN,
708 'network' => Protocol::DFRN,
711 'post-thread-user' => [
721 'network' => Protocol::DFRN,
734 'network' => Protocol::DFRN,
747 'network' => Protocol::DFRN,
760 'network' => Protocol::DFRN,
773 'network' => Protocol::DFRN,
781 'post-user-id' => 12,
786 'network' => Protocol::DFRN,
795 'name' => 'Reply to',
796 'url' => 'http://localhost/display/1',
797 'photo' => 'http://localhost/',
798 'date' => '2020-01-01 12:12:02',
799 'msg' => 'A test reply from an item',
801 'link' => 'http://localhost/notification/1',
804 'verb' => \Friendica\Protocol\Activity::POST,
805 'otype' => Notification\ObjectType::ITEM,
806 'name_cache' => 'Reply to',
807 'msg_cache' => 'A test reply from an item',
821 'name' => 'Visible list',
827 'name' => 'Private list',
840 'term' => 'Saved search',