3 * @copyright Copyright (C) 2010-2024, 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;
40 'url' => 'https://friendica.local',
41 'nurl' => 'http://friendica.local',
42 'register_policy' => 0,
43 'registered-users' => 0,
47 // Base test config to avoid notice messages
51 'username' => 'Test user',
52 'nickname' => 'selfcontact',
54 'prvkey' => "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDVqxF9kIgtgRL0+q+jTi578FA1r1+crEmlYc0pdxcbmmrhjuRc\nrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/KHVks7eQ4yr4MxTRlsxo5qf2o\nnbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjsQPX240vGNXIkfLiAWwIDAQAB\nAoGBAIwuiPIdggqAtWQ+mD8HCx5LQwSFw6/xpPu5F7ZNqL52aAsGCbL3o2QoIG4c\na1qf9Ot16BNgNBqxQF3hzRTkBMrKYlmNTUkwJXun/zjQJq2JvOlcrSuXlIucUjs4\nXekVN25aYPHrX9m2FEIUwZTb4UYXbR80KbIDI53BkQ6EwSbpAkEA7aO49CR2Hf1Y\n1d2GaUI/Z0wvbj//+t0Kg0bPt16ca8KVjEQQA5ylsDaiw510jDz9NBQxSOk6If23\nUeRixc1RDQJBAOYtN4YnPM1Zfp6IxXlqMCc+xUWRTPEPFt+WpG+v79koNamAeA6o\nZzTl92hl58IqSdbgojeE2zXWQRvlimFMLQcCQQCV6jND0byyLqFcSeQBg0l8YROK\n+dUC7W80YfeoNod3c8nkMwvnO2tLPyxvO2XLEq6prBNra7bAus5rWyj0oBIBAkEA\n1EvUMFm0TLpEfLgtWuTD8Q6GKLnxO0ztjd+FXrXpBGN/ywyArxRHzJRmctW6wmz6\nmcOqGobhIHCysKYv0bnOtQJAc2M5RwlASHH4jGJzXgt3nboyiJfufM0RV9iry3ho\nCXQRWAONKoLqnsfC6qNP8OzY8FMJcwmPWj7Q/6z6yLBFTA==\n-----END RSA PRIVATE KEY-----",
55 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----", 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
97 'uri' => 'http://localhost/profile/selfcontact',
102 'uri' => 'http://localhost/profile/othercontact',
107 'uri' => 'http://localhost/profile/friendcontact',
112 'uri' => 'http://localhost/profile/mutualcontact',
117 'uri' => 'https://friendica.local/posts/100',
126 'name' => 'Self contact',
127 'nick' => 'selfcontact',
129 'nurl' => 'http://localhost/profile/selfcontact',
130 'url' => 'http://localhost/profile/selfcontact',
131 'notify' => 'http://localhost/friendica/inbox',
132 'about' => 'User used in tests',
133 'prvkey' => "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDVqxF9kIgtgRL0+q+jTi578FA1r1+crEmlYc0pdxcbmmrhjuRc\nrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/KHVks7eQ4yr4MxTRlsxo5qf2o\nnbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjsQPX240vGNXIkfLiAWwIDAQAB\nAoGBAIwuiPIdggqAtWQ+mD8HCx5LQwSFw6/xpPu5F7ZNqL52aAsGCbL3o2QoIG4c\na1qf9Ot16BNgNBqxQF3hzRTkBMrKYlmNTUkwJXun/zjQJq2JvOlcrSuXlIucUjs4\nXekVN25aYPHrX9m2FEIUwZTb4UYXbR80KbIDI53BkQ6EwSbpAkEA7aO49CR2Hf1Y\n1d2GaUI/Z0wvbj//+t0Kg0bPt16ca8KVjEQQA5ylsDaiw510jDz9NBQxSOk6If23\nUeRixc1RDQJBAOYtN4YnPM1Zfp6IxXlqMCc+xUWRTPEPFt+WpG+v79koNamAeA6o\nZzTl92hl58IqSdbgojeE2zXWQRvlimFMLQcCQQCV6jND0byyLqFcSeQBg0l8YROK\n+dUC7W80YfeoNod3c8nkMwvnO2tLPyxvO2XLEq6prBNra7bAus5rWyj0oBIBAkEA\n1EvUMFm0TLpEfLgtWuTD8Q6GKLnxO0ztjd+FXrXpBGN/ywyArxRHzJRmctW6wmz6\nmcOqGobhIHCysKYv0bnOtQJAc2M5RwlASHH4jGJzXgt3nboyiJfufM0RV9iry3ho\nCXQRWAONKoLqnsfC6qNP8OzY8FMJcwmPWj7Q/6z6yLBFTA==\n-----END RSA PRIVATE KEY-----",
134 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
137 'rel' => Contact::FOLLOWER,
138 'network' => Protocol::DFRN,
139 'location' => 'DFRN',
141 // Having the same name and nick allows us to test
142 // the fallback to api_get_nick() in api_get_user()
147 'name' => 'othercontact',
148 'nick' => 'othercontact',
150 'nurl' => 'http://localhost/profile/othercontact',
151 'url' => 'http://localhost/profile/othercontact',
152 'notify' => 'http://localhost/friendica/inbox',
155 'rel' => Contact::NOTHING,
156 'network' => Protocol::DFRN,
157 'location' => 'DFRN',
163 'name' => 'Friend contact',
164 'nick' => 'friendcontact',
166 'nurl' => 'http://localhost/profile/friendcontact',
167 'url' => 'http://localhost/profile/friendcontact',
168 'notify' => 'http://localhost/friendica/inbox',
171 'rel' => Contact::SHARING,
172 'network' => Protocol::DFRN,
173 'location' => 'DFRN',
179 'name' => 'Friend contact',
180 'nick' => 'friendcontact',
182 'nurl' => 'http://localhost/profile/friendcontact',
183 'url' => 'http://localhost/profile/friendcontact',
184 'notify' => 'http://localhost/friendica/inbox',
187 'rel' => Contact::SHARING,
188 'network' => Protocol::DFRN,
189 'location' => 'DFRN',
195 'name' => 'Mutual contact',
196 'nick' => 'mutualcontact',
198 'nurl' => 'http://localhost/profile/mutualcontact',
199 'url' => 'http://localhost/profile/mutualcontact',
200 'notify' => 'http://localhost/friendica/inbox',
203 'rel' => Contact::FRIEND,
204 'network' => Protocol::DFRN,
205 'location' => 'DFRN',
211 'name' => 'Mutual contact',
212 'nick' => 'mutualcontact',
214 'nurl' => 'http://localhost/profile/mutualcontact',
215 'url' => 'http://localhost/profile/mutualcontact',
216 'notify' => 'http://localhost/friendica/inbox',
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 'notify' => 'http://localhost/friendica/inbox',
233 'about' => 'User used in tests',
236 'rel' => Contact::FOLLOWER,
237 'network' => Protocol::DFRN,
238 'location' => 'DFRN',
243 "url" => "http://localhost/profile/selfcontact",
247 "following" => "http://localhost/following/selfcontact",
248 "followers" => "http://localhost/followers/selfcontact",
249 "inbox" => "http://localhost/inbox/selfcontact",
250 "outbox" => "http://localhost/outbox/selfcontact",
251 "sharedinbox" => "http://localhost/inbox",
252 "manually-approve" => 1,
254 "nick" => "selfcontact",
255 "name" => "Self contact",
256 "about" => "User used in tests",
259 "photo" => "http://localhost/photo/profile/admin.jpeg",
261 "addr" => "selfcontact@localhost",
263 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
264 "subscribe" => "/follow?url={uri}",
267 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
268 "following_count" => 0,
269 "followers_count" => 0,
270 "statuses_count" => 0,
271 "updated" => "2021-11-19 19:17:59",
281 'name' => 'http://activitystrea.ms/schema/1.0/like',
285 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
289 'name' => 'http://purl.org/zot/activity/attendyes',
293 'name' => 'http://purl.org/zot/activity/attendno',
297 'name' => 'http://purl.org/zot/activity/attendmaybe',
301 'name' => 'http://activitystrea.ms/schema/1.0/follow',
305 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
309 'name' => 'http://activitystrea.ms/schema/1.0/post',
315 'body' => 'Parent status',
316 'plink' => 'http://localhost/display/1',
321 'plink' => 'http://localhost/display/2',
325 'body' => 'Other user status',
326 'plink' => 'http://localhost/display/3',
330 'body' => 'Friend user reply',
331 'plink' => 'http://localhost/display/4',
335 'body' => '[share]Shared status[/share]',
336 'plink' => 'http://localhost/display/5',
340 'body' => 'Friend user status',
341 'plink' => 'http://localhost/display/6',
345 'title' => 'item_title',
346 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
347 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
348 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
349 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
350 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
351 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
352 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
353 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
354 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
355 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
356 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
357 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
358 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
359 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
360 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
361 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
362 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
363 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
364 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
365 'repellat officia illum quos impedit quam iste esse unde qui ' .
366 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
367 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
368 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
369 'plink' => 'http://localhost/display/6',
373 'title' => 'item_title',
374 'body' => ':like ~friendica no [code]:dislike[/code] :-p :-[ :hugging face: <3 :smiley heart 333: ⽕',
375 'plink' => 'https://friendica.local/post/100',
381 'parent-uri-id' => 1,
382 'thr-parent-id' => 1,
383 'gravity' => Item::GRAVITY_PARENT,
384 'network' => Protocol::DFRN,
389 'private' => Item::PUBLIC,
396 'parent-uri-id' => 1,
397 'thr-parent-id' => 1,
398 'gravity' => Item::GRAVITY_COMMENT,
399 'network' => Protocol::DFRN,
404 'private' => Item::PUBLIC,
411 'parent-uri-id' => 3,
412 'thr-parent-id' => 3,
413 'gravity' => Item::GRAVITY_PARENT,
414 'network' => Protocol::DFRN,
419 'private' => Item::PUBLIC,
426 'parent-uri-id' => 1,
427 'thr-parent-id' => 1,
428 'gravity' => Item::GRAVITY_COMMENT,
429 'network' => Protocol::DFRN,
434 'private' => Item::PUBLIC,
441 'parent-uri-id' => 1,
442 'thr-parent-id' => 1,
443 'gravity' => Item::GRAVITY_COMMENT,
444 'network' => Protocol::DFRN,
449 'private' => Item::PUBLIC,
456 'parent-uri-id' => 6,
457 'thr-parent-id' => 6,
458 'gravity' => Item::GRAVITY_PARENT,
459 'network' => Protocol::DFRN,
464 'private' => Item::PUBLIC,
471 'parent-uri-id' => 7,
472 'thr-parent-id' => 7,
473 'gravity' => Item::GRAVITY_PARENT,
474 'network' => Protocol::DFRN,
479 'private' => Item::PUBLIC,
497 'parent-uri-id' => 1,
498 'thr-parent-id' => 1,
499 'private' => Item::PUBLIC,
501 'gravity' => Item::GRAVITY_PARENT,
502 'network' => Protocol::DFRN,
513 'parent-uri-id' => 1,
514 'thr-parent-id' => 1,
515 'gravity' => Item::GRAVITY_COMMENT,
516 'network' => Protocol::DFRN,
521 'private' => Item::PUBLIC,
534 'parent-uri-id' => 3,
535 'thr-parent-id' => 3,
536 'gravity' => Item::GRAVITY_PARENT,
537 'network' => Protocol::DFRN,
542 'private' => Item::PUBLIC,
555 'parent-uri-id' => 1,
556 'thr-parent-id' => 1,
557 'gravity' => Item::GRAVITY_COMMENT,
558 'network' => Protocol::DFRN,
563 'private' => Item::PUBLIC,
576 'parent-uri-id' => 1,
577 'thr-parent-id' => 1,
578 'gravity' => Item::GRAVITY_COMMENT,
579 'network' => Protocol::DFRN,
584 'private' => Item::PUBLIC,
597 'parent-uri-id' => 6,
598 'thr-parent-id' => 6,
599 'gravity' => Item::GRAVITY_PARENT,
600 'network' => Protocol::DFRN,
605 'private' => Item::PUBLIC,
618 'parent-uri-id' => 1,
619 'thr-parent-id' => 1,
620 'gravity' => Item::GRAVITY_PARENT,
621 'network' => Protocol::DFRN,
626 'private' => Item::PUBLIC,
639 'parent-uri-id' => 1,
640 'thr-parent-id' => 1,
641 'gravity' => Item::GRAVITY_COMMENT,
642 'network' => Protocol::DFRN,
647 'private' => Item::PUBLIC,
660 'parent-uri-id' => 3,
661 'thr-parent-id' => 3,
662 'gravity' => Item::GRAVITY_PARENT,
663 'network' => Protocol::DFRN,
668 'private' => Item::PUBLIC,
681 'parent-uri-id' => 1,
682 'thr-parent-id' => 1,
683 'gravity' => Item::GRAVITY_COMMENT,
684 'network' => Protocol::DFRN,
689 'private' => Item::PUBLIC,
702 'parent-uri-id' => 1,
703 'thr-parent-id' => 1,
704 'gravity' => Item::GRAVITY_COMMENT,
705 'network' => Protocol::DFRN,
710 'private' => Item::PUBLIC,
727 'parent-uri-id' => 6,
728 'thr-parent-id' => 6,
729 'private' => Item::PUBLIC,
731 'gravity' => Item::GRAVITY_PARENT,
732 'network' => Protocol::DFRN,
748 'parent-uri-id' => 7,
749 'thr-parent-id' => 7,
750 'private' => Item::PUBLIC,
752 'gravity' => Item::GRAVITY_PARENT,
753 'network' => Protocol::DFRN,
770 'parent-uri-id' => 7,
771 'thr-parent-id' => 7,
772 'private' => Item::PUBLIC,
774 'gravity' => Item::GRAVITY_PARENT,
775 'network' => Protocol::DFRN,
787 'network' => Protocol::DFRN,
794 'network' => Protocol::DFRN,
801 'network' => Protocol::DFRN,
808 'network' => Protocol::DFRN,
811 'post-thread-user' => [
821 'network' => Protocol::DFRN,
834 'network' => Protocol::DFRN,
847 'network' => Protocol::DFRN,
860 'network' => Protocol::DFRN,
873 'network' => Protocol::DFRN,
881 'post-user-id' => 12,
886 'network' => Protocol::DFRN,
899 'network' => Protocol::DFRN,
907 'post-user-id' => 12,
912 'network' => Protocol::DFRN,
921 'name' => 'Friend contact',
922 'url' => 'http://localhost/profile/friendcontact',
923 'photo' => 'http://localhost/',
924 'date' => '2020-01-01 12:12:02',
925 'msg' => 'A test reply from an item',
927 'link' => 'http://localhost/display/1',
930 'verb' => \Friendica\Protocol\Activity::POST,
931 'otype' => Notification\ObjectType::ITEM,
932 'name_cache' => 'Friend contact',
933 'msg_cache' => 'A test reply from an item',
947 'name' => 'Visible list',
953 'name' => 'Private list',
976 'term' => 'Saved search',