3 * @copyright Copyright (C) 2010-2023, 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
42 'username' => 'Test user',
43 'nickname' => 'selfcontact',
45 '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-----",
46 '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',
88 'uri' => 'http://localhost/profile/selfcontact',
93 'uri' => 'http://localhost/profile/othercontact',
98 'uri' => 'http://localhost/profile/friendcontact',
103 'uri' => 'http://localhost/profile/mutualcontact',
112 'name' => 'Self contact',
113 'nick' => 'selfcontact',
115 'nurl' => 'http://localhost/profile/selfcontact',
116 'url' => 'http://localhost/profile/selfcontact',
117 'notify' => 'http://localhost/friendica/inbox',
118 'about' => 'User used in tests',
119 '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-----",
120 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
123 'rel' => Contact::FOLLOWER,
124 'network' => Protocol::DFRN,
125 'location' => 'DFRN',
127 // Having the same name and nick allows us to test
128 // the fallback to api_get_nick() in api_get_user()
133 'name' => 'othercontact',
134 'nick' => 'othercontact',
136 'nurl' => 'http://localhost/profile/othercontact',
137 'url' => 'http://localhost/profile/othercontact',
138 'notify' => 'http://localhost/friendica/inbox',
141 'rel' => Contact::NOTHING,
142 'network' => Protocol::DFRN,
143 'location' => 'DFRN',
149 'name' => 'Friend contact',
150 'nick' => 'friendcontact',
152 'nurl' => 'http://localhost/profile/friendcontact',
153 'url' => 'http://localhost/profile/friendcontact',
154 'notify' => 'http://localhost/friendica/inbox',
157 'rel' => Contact::SHARING,
158 'network' => Protocol::DFRN,
159 'location' => 'DFRN',
165 'name' => 'Friend contact',
166 'nick' => 'friendcontact',
168 'nurl' => 'http://localhost/profile/friendcontact',
169 'url' => 'http://localhost/profile/friendcontact',
170 'notify' => 'http://localhost/friendica/inbox',
173 'rel' => Contact::SHARING,
174 'network' => Protocol::DFRN,
175 'location' => 'DFRN',
181 'name' => 'Mutual contact',
182 'nick' => 'mutualcontact',
184 'nurl' => 'http://localhost/profile/mutualcontact',
185 'url' => 'http://localhost/profile/mutualcontact',
186 'notify' => 'http://localhost/friendica/inbox',
189 'rel' => Contact::FRIEND,
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',
202 'notify' => 'http://localhost/friendica/inbox',
205 'rel' => Contact::SHARING,
206 'network' => Protocol::DFRN,
207 'location' => 'DFRN',
213 'name' => 'Self contact',
214 'nick' => 'selfcontact',
216 'nurl' => 'http://localhost/profile/selfcontact',
217 'url' => 'http://localhost/profile/selfcontact',
218 'notify' => 'http://localhost/friendica/inbox',
219 'about' => 'User used in tests',
222 'rel' => Contact::FOLLOWER,
223 'network' => Protocol::DFRN,
224 'location' => 'DFRN',
229 "url" => "http://localhost/profile/selfcontact",
233 "following" => "http://localhost/following/selfcontact",
234 "followers" => "http://localhost/followers/selfcontact",
235 "inbox" => "http://localhost/inbox/selfcontact",
236 "outbox" => "http://localhost/outbox/selfcontact",
237 "sharedinbox" => "http://localhost/inbox",
238 "manually-approve" => 1,
240 "nick" => "selfcontact",
241 "name" => "Self contact",
242 "about" => "User used in tests",
245 "photo" => "http://localhost/photo/profile/admin.jpeg",
247 "addr" => "selfcontact@localhost",
249 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
250 "subscribe" => "/follow?url={uri}",
253 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
254 "following_count" => 0,
255 "followers_count" => 0,
256 "statuses_count" => 0,
257 "updated" => "2021-11-19 19:17:59",
267 'name' => 'http://activitystrea.ms/schema/1.0/like',
271 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
275 'name' => 'http://purl.org/zot/activity/attendyes',
279 'name' => 'http://purl.org/zot/activity/attendno',
283 'name' => 'http://purl.org/zot/activity/attendmaybe',
287 'name' => 'http://activitystrea.ms/schema/1.0/follow',
291 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
295 'name' => 'http://activitystrea.ms/schema/1.0/post',
301 'body' => 'Parent status',
302 'plink' => 'http://localhost/display/1',
307 'plink' => 'http://localhost/display/2',
311 'body' => 'Other user status',
312 'plink' => 'http://localhost/display/3',
316 'body' => 'Friend user reply',
317 'plink' => 'http://localhost/display/4',
321 'body' => '[share]Shared status[/share]',
322 'plink' => 'http://localhost/display/5',
326 'body' => 'Friend user status',
327 'plink' => 'http://localhost/display/6',
331 'title' => 'item_title',
332 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
333 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
334 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
335 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
336 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
337 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
338 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
339 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
340 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
341 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
342 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
343 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
344 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
345 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
346 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
347 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
348 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
349 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
350 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
351 'repellat officia illum quos impedit quam iste esse unde qui ' .
352 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
353 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
354 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
355 'plink' => 'http://localhost/display/6',
361 'parent-uri-id' => 1,
362 'thr-parent-id' => 1,
363 'gravity' => Item::GRAVITY_PARENT,
364 'network' => Protocol::DFRN,
369 'private' => Item::PUBLIC,
376 'parent-uri-id' => 1,
377 'thr-parent-id' => 1,
378 'gravity' => Item::GRAVITY_COMMENT,
379 'network' => Protocol::DFRN,
384 'private' => Item::PUBLIC,
391 'parent-uri-id' => 3,
392 'thr-parent-id' => 3,
393 'gravity' => Item::GRAVITY_PARENT,
394 'network' => Protocol::DFRN,
399 'private' => Item::PUBLIC,
406 'parent-uri-id' => 1,
407 'thr-parent-id' => 1,
408 'gravity' => Item::GRAVITY_COMMENT,
409 'network' => Protocol::DFRN,
414 'private' => Item::PUBLIC,
421 'parent-uri-id' => 1,
422 'thr-parent-id' => 1,
423 'gravity' => Item::GRAVITY_COMMENT,
424 'network' => Protocol::DFRN,
429 'private' => Item::PUBLIC,
436 'parent-uri-id' => 6,
437 'thr-parent-id' => 6,
438 'gravity' => Item::GRAVITY_PARENT,
439 'network' => Protocol::DFRN,
444 'private' => Item::PUBLIC,
451 'parent-uri-id' => 7,
452 'thr-parent-id' => 7,
453 'gravity' => Item::GRAVITY_PARENT,
454 'network' => Protocol::DFRN,
459 'private' => Item::PUBLIC,
477 'parent-uri-id' => 1,
478 'thr-parent-id' => 1,
479 'private' => Item::PUBLIC,
481 'gravity' => Item::GRAVITY_PARENT,
482 'network' => Protocol::DFRN,
493 'parent-uri-id' => 1,
494 'thr-parent-id' => 1,
495 'gravity' => Item::GRAVITY_COMMENT,
496 'network' => Protocol::DFRN,
501 'private' => Item::PUBLIC,
514 'parent-uri-id' => 3,
515 'thr-parent-id' => 3,
516 'gravity' => Item::GRAVITY_PARENT,
517 'network' => Protocol::DFRN,
522 'private' => Item::PUBLIC,
535 'parent-uri-id' => 1,
536 'thr-parent-id' => 1,
537 'gravity' => Item::GRAVITY_COMMENT,
538 'network' => Protocol::DFRN,
543 'private' => Item::PUBLIC,
556 'parent-uri-id' => 1,
557 'thr-parent-id' => 1,
558 'gravity' => Item::GRAVITY_COMMENT,
559 'network' => Protocol::DFRN,
564 'private' => Item::PUBLIC,
577 'parent-uri-id' => 6,
578 'thr-parent-id' => 6,
579 'gravity' => Item::GRAVITY_PARENT,
580 'network' => Protocol::DFRN,
585 'private' => Item::PUBLIC,
598 'parent-uri-id' => 1,
599 'thr-parent-id' => 1,
600 'gravity' => Item::GRAVITY_PARENT,
601 'network' => Protocol::DFRN,
606 'private' => Item::PUBLIC,
619 'parent-uri-id' => 1,
620 'thr-parent-id' => 1,
621 'gravity' => Item::GRAVITY_COMMENT,
622 'network' => Protocol::DFRN,
627 'private' => Item::PUBLIC,
640 'parent-uri-id' => 3,
641 'thr-parent-id' => 3,
642 'gravity' => Item::GRAVITY_PARENT,
643 'network' => Protocol::DFRN,
648 'private' => Item::PUBLIC,
661 'parent-uri-id' => 1,
662 'thr-parent-id' => 1,
663 'gravity' => Item::GRAVITY_COMMENT,
664 'network' => Protocol::DFRN,
669 'private' => Item::PUBLIC,
682 'parent-uri-id' => 1,
683 'thr-parent-id' => 1,
684 'gravity' => Item::GRAVITY_COMMENT,
685 'network' => Protocol::DFRN,
690 'private' => Item::PUBLIC,
707 'parent-uri-id' => 6,
708 'thr-parent-id' => 6,
709 'private' => Item::PUBLIC,
711 'gravity' => Item::GRAVITY_PARENT,
712 'network' => Protocol::DFRN,
728 'parent-uri-id' => 7,
729 'thr-parent-id' => 7,
730 'private' => Item::PUBLIC,
732 'gravity' => Item::GRAVITY_PARENT,
733 'network' => Protocol::DFRN,
745 'network' => Protocol::DFRN,
752 'network' => Protocol::DFRN,
759 'network' => Protocol::DFRN,
766 'network' => Protocol::DFRN,
769 'post-thread-user' => [
779 'network' => Protocol::DFRN,
792 'network' => Protocol::DFRN,
805 'network' => Protocol::DFRN,
818 'network' => Protocol::DFRN,
831 'network' => Protocol::DFRN,
839 'post-user-id' => 12,
844 'network' => Protocol::DFRN,
857 'network' => Protocol::DFRN,
865 'post-user-id' => 12,
870 'network' => Protocol::DFRN,
879 'name' => 'Friend contact',
880 'url' => 'http://localhost/profile/friendcontact',
881 'photo' => 'http://localhost/',
882 'date' => '2020-01-01 12:12:02',
883 'msg' => 'A test reply from an item',
885 'link' => 'http://localhost/display/1',
888 'verb' => \Friendica\Protocol\Activity::POST,
889 'otype' => Notification\ObjectType::ITEM,
890 'name_cache' => 'Friend contact',
891 'msg_cache' => 'A test reply from an item',
905 'name' => 'Visible list',
911 'name' => 'Private list',
934 'term' => 'Saved search',