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
43 'v' => 'http://localhost',
52 'k' => 'worker_dont_fork',
57 'k' => 'curl_timeout',
69 'username' => 'Test user',
70 'nickname' => 'selfcontact',
72 '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-----",
73 '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',
115 'uri' => 'http://localhost/profile/selfcontact',
120 'uri' => 'http://localhost/profile/othercontact',
125 'uri' => 'http://localhost/profile/friendcontact',
130 'uri' => 'http://localhost/profile/mutualcontact',
139 'name' => 'Self contact',
140 'nick' => 'selfcontact',
142 'nurl' => 'http://localhost/profile/selfcontact',
143 'url' => 'http://localhost/profile/selfcontact',
144 'notify' => 'http://localhost/friendica/inbox',
145 'about' => 'User used in tests',
146 '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-----",
147 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
150 'rel' => Contact::FOLLOWER,
151 'network' => Protocol::DFRN,
152 'location' => 'DFRN',
154 // Having the same name and nick allows us to test
155 // the fallback to api_get_nick() in api_get_user()
160 'name' => 'othercontact',
161 'nick' => 'othercontact',
163 'nurl' => 'http://localhost/profile/othercontact',
164 'url' => 'http://localhost/profile/othercontact',
165 'notify' => 'http://localhost/friendica/inbox',
168 'rel' => Contact::NOTHING,
169 'network' => Protocol::DFRN,
170 'location' => 'DFRN',
176 'name' => 'Friend contact',
177 'nick' => 'friendcontact',
179 'nurl' => 'http://localhost/profile/friendcontact',
180 'url' => 'http://localhost/profile/friendcontact',
181 'notify' => 'http://localhost/friendica/inbox',
184 'rel' => Contact::SHARING,
185 'network' => Protocol::DFRN,
186 'location' => 'DFRN',
192 'name' => 'Friend contact',
193 'nick' => 'friendcontact',
195 'nurl' => 'http://localhost/profile/friendcontact',
196 'url' => 'http://localhost/profile/friendcontact',
197 'notify' => 'http://localhost/friendica/inbox',
200 'rel' => Contact::SHARING,
201 'network' => Protocol::DFRN,
202 'location' => 'DFRN',
208 'name' => 'Mutual contact',
209 'nick' => 'mutualcontact',
211 'nurl' => 'http://localhost/profile/mutualcontact',
212 'url' => 'http://localhost/profile/mutualcontact',
213 'notify' => 'http://localhost/friendica/inbox',
216 'rel' => Contact::FRIEND,
217 'network' => Protocol::DFRN,
218 'location' => 'DFRN',
224 'name' => 'Mutual contact',
225 'nick' => 'mutualcontact',
227 'nurl' => 'http://localhost/profile/mutualcontact',
228 'url' => 'http://localhost/profile/mutualcontact',
229 'notify' => 'http://localhost/friendica/inbox',
232 'rel' => Contact::SHARING,
233 'network' => Protocol::DFRN,
234 'location' => 'DFRN',
240 'name' => 'Self contact',
241 'nick' => 'selfcontact',
243 'nurl' => 'http://localhost/profile/selfcontact',
244 'url' => 'http://localhost/profile/selfcontact',
245 'notify' => 'http://localhost/friendica/inbox',
246 'about' => 'User used in tests',
249 'rel' => Contact::FOLLOWER,
250 'network' => Protocol::DFRN,
251 'location' => 'DFRN',
256 "url" => "http://localhost/profile/selfcontact",
260 "following" => "http://localhost/following/selfcontact",
261 "followers" => "http://localhost/followers/selfcontact",
262 "inbox" => "http://localhost/inbox/selfcontact",
263 "outbox" => "http://localhost/outbox/selfcontact",
264 "sharedinbox" => "http://localhost/inbox",
265 "manually-approve" => 1,
267 "nick" => "selfcontact",
268 "name" => "Self contact",
269 "about" => "User used in tests",
272 "photo" => "http://localhost/photo/profile/admin.jpeg",
274 "addr" => "selfcontact@localhost",
276 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
277 "subscribe" => "/follow?url={uri}",
280 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
281 "following_count" => 0,
282 "followers_count" => 0,
283 "statuses_count" => 0,
284 "updated" => "2021-11-19 19:17:59",
294 'name' => 'http://activitystrea.ms/schema/1.0/like',
298 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
302 'name' => 'http://purl.org/zot/activity/attendyes',
306 'name' => 'http://purl.org/zot/activity/attendno',
310 'name' => 'http://purl.org/zot/activity/attendmaybe',
314 'name' => 'http://activitystrea.ms/schema/1.0/follow',
318 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
322 'name' => 'http://activitystrea.ms/schema/1.0/post',
328 'body' => 'Parent status',
329 'plink' => 'http://localhost/display/1',
334 'plink' => 'http://localhost/display/2',
338 'body' => 'Other user status',
339 'plink' => 'http://localhost/display/3',
343 'body' => 'Friend user reply',
344 'plink' => 'http://localhost/display/4',
348 'body' => '[share]Shared status[/share]',
349 'plink' => 'http://localhost/display/5',
353 'body' => 'Friend user status',
354 'plink' => 'http://localhost/display/6',
358 'title' => 'item_title',
359 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
360 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
361 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
362 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
363 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
364 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
365 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
366 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
367 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
368 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
369 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
370 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
371 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
372 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
373 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
374 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
375 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
376 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
377 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
378 'repellat officia illum quos impedit quam iste esse unde qui ' .
379 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
380 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
381 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
382 'plink' => 'http://localhost/display/6',
388 'parent-uri-id' => 1,
389 'thr-parent-id' => 1,
390 'gravity' => Item::GRAVITY_PARENT,
391 'network' => Protocol::DFRN,
396 'private' => Item::PUBLIC,
403 'parent-uri-id' => 1,
404 'thr-parent-id' => 1,
405 'gravity' => Item::GRAVITY_COMMENT,
406 'network' => Protocol::DFRN,
411 'private' => Item::PUBLIC,
418 'parent-uri-id' => 3,
419 'thr-parent-id' => 3,
420 'gravity' => Item::GRAVITY_PARENT,
421 'network' => Protocol::DFRN,
426 'private' => Item::PUBLIC,
433 'parent-uri-id' => 1,
434 'thr-parent-id' => 1,
435 'gravity' => Item::GRAVITY_COMMENT,
436 'network' => Protocol::DFRN,
441 'private' => Item::PUBLIC,
448 'parent-uri-id' => 1,
449 'thr-parent-id' => 1,
450 'gravity' => Item::GRAVITY_COMMENT,
451 'network' => Protocol::DFRN,
456 'private' => Item::PUBLIC,
463 'parent-uri-id' => 6,
464 'thr-parent-id' => 6,
465 'gravity' => Item::GRAVITY_PARENT,
466 'network' => Protocol::DFRN,
471 'private' => Item::PUBLIC,
478 'parent-uri-id' => 7,
479 'thr-parent-id' => 7,
480 'gravity' => Item::GRAVITY_PARENT,
481 'network' => Protocol::DFRN,
486 'private' => Item::PUBLIC,
504 'parent-uri-id' => 1,
505 'thr-parent-id' => 1,
506 'private' => Item::PUBLIC,
508 'gravity' => Item::GRAVITY_PARENT,
509 'network' => Protocol::DFRN,
520 'parent-uri-id' => 1,
521 'thr-parent-id' => 1,
522 'gravity' => Item::GRAVITY_COMMENT,
523 'network' => Protocol::DFRN,
528 'private' => Item::PUBLIC,
541 'parent-uri-id' => 3,
542 'thr-parent-id' => 3,
543 'gravity' => Item::GRAVITY_PARENT,
544 'network' => Protocol::DFRN,
549 'private' => Item::PUBLIC,
562 'parent-uri-id' => 1,
563 'thr-parent-id' => 1,
564 'gravity' => Item::GRAVITY_COMMENT,
565 'network' => Protocol::DFRN,
570 'private' => Item::PUBLIC,
583 'parent-uri-id' => 1,
584 'thr-parent-id' => 1,
585 'gravity' => Item::GRAVITY_COMMENT,
586 'network' => Protocol::DFRN,
591 'private' => Item::PUBLIC,
604 'parent-uri-id' => 6,
605 'thr-parent-id' => 6,
606 'gravity' => Item::GRAVITY_PARENT,
607 'network' => Protocol::DFRN,
612 'private' => Item::PUBLIC,
625 'parent-uri-id' => 1,
626 'thr-parent-id' => 1,
627 'gravity' => Item::GRAVITY_PARENT,
628 'network' => Protocol::DFRN,
633 'private' => Item::PUBLIC,
646 'parent-uri-id' => 1,
647 'thr-parent-id' => 1,
648 'gravity' => Item::GRAVITY_COMMENT,
649 'network' => Protocol::DFRN,
654 'private' => Item::PUBLIC,
667 'parent-uri-id' => 3,
668 'thr-parent-id' => 3,
669 'gravity' => Item::GRAVITY_PARENT,
670 'network' => Protocol::DFRN,
675 'private' => Item::PUBLIC,
688 'parent-uri-id' => 1,
689 'thr-parent-id' => 1,
690 'gravity' => Item::GRAVITY_COMMENT,
691 'network' => Protocol::DFRN,
696 'private' => Item::PUBLIC,
709 'parent-uri-id' => 1,
710 'thr-parent-id' => 1,
711 'gravity' => Item::GRAVITY_COMMENT,
712 'network' => Protocol::DFRN,
717 'private' => Item::PUBLIC,
734 'parent-uri-id' => 6,
735 'thr-parent-id' => 6,
736 'private' => Item::PUBLIC,
738 'gravity' => Item::GRAVITY_PARENT,
739 'network' => Protocol::DFRN,
755 'parent-uri-id' => 7,
756 'thr-parent-id' => 7,
757 'private' => Item::PUBLIC,
759 'gravity' => Item::GRAVITY_PARENT,
760 'network' => Protocol::DFRN,
772 'network' => Protocol::DFRN,
779 'network' => Protocol::DFRN,
786 'network' => Protocol::DFRN,
793 'network' => Protocol::DFRN,
796 'post-thread-user' => [
806 'network' => Protocol::DFRN,
819 'network' => Protocol::DFRN,
832 'network' => Protocol::DFRN,
845 'network' => Protocol::DFRN,
858 'network' => Protocol::DFRN,
866 'post-user-id' => 12,
871 'network' => Protocol::DFRN,
884 'network' => Protocol::DFRN,
892 'post-user-id' => 12,
897 'network' => Protocol::DFRN,
906 'name' => 'Friend contact',
907 'url' => 'http://localhost/profile/friendcontact',
908 'photo' => 'http://localhost/',
909 'date' => '2020-01-01 12:12:02',
910 'msg' => 'A test reply from an item',
912 'link' => 'http://localhost/display/1',
915 'verb' => \Friendica\Protocol\Activity::POST,
916 'otype' => Notification\ObjectType::ITEM,
917 'name_cache' => 'Friend contact',
918 'msg_cache' => 'A test reply from an item',
932 'name' => 'Visible list',
938 'name' => 'Private list',
961 'term' => 'Saved search',